Skip to content

Commit f6c0feb

Browse files
committed
remove special handling of 'world' in charts
1 parent 5cc5a53 commit f6c0feb

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

internal/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ func (s *ChartOfAccounts) UnmarshalJSON(data []byte) error
473473

474474

475475
<a name="ChartOfAccounts.ValidatePosting"></a>
476-
### func \(\*ChartOfAccounts\) [ValidatePosting](<https://github.com/formancehq/ledger/blob/main/internal/chart.go#L275>)
476+
### func \(\*ChartOfAccounts\) [ValidatePosting](<https://github.com/formancehq/ledger/blob/main/internal/chart.go#L272>)
477477

478478
```go
479479
func (c *ChartOfAccounts) ValidatePosting(posting Posting) error

internal/chart.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,6 @@ func findAccountSchema(path []string, fixedSegments map[string]ChartSegment, var
264264
func (c *ChartOfAccounts) FindAccountSchema(account string) (*ChartAccount, error) {
265265
schema, err := findAccountSchema([]string{}, map[string]ChartSegment(*c), nil, strings.Split(account, ":"))
266266
if err != nil {
267-
if account == "world" {
268-
return &ChartAccount{}, nil
269-
}
270267
return nil, err
271268
}
272269
return schema, nil

internal/chart_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ func TestChartValidation(t *testing.T) {
245245

246246
func testChart() ChartOfAccounts {
247247
return ChartOfAccounts{
248+
"world": {
249+
Account: &ChartAccount{},
250+
},
248251
"bank": {
249252
VariableSegment: &ChartVariableSegment{
250253
Label: "bankID",

0 commit comments

Comments
 (0)