Set up default currency accounts automatically (#72)
This commit is contained in:
1 parent
62df9eac5f
commit
5c255296d3
21 files changed
+675
-62
No files matched your search
@@ -76,15 +76,25 @@ func (s *memoryStore) Attach(_ context.Context, r *Record, id string) error {
|
||||
}
|
||||
|
||||
type provider struct {
|
||||
mu sync.Mutex
|
||||
accepted int
|
||||
lost bool
|
||||
status string
|
||||
key string
|
||||
namespace string
|
||||
mu sync.Mutex
|
||||
accepted int
|
||||
lost bool
|
||||
status string
|
||||
key string
|
||||
namespace string
|
||||
setupCalls int
|
||||
setupSubject string
|
||||
setupErr error
|
||||
}
|
||||
|
||||
func (p *provider) Namespace() string { return p.namespace }
|
||||
func (p *provider) EnsureAccounts(_ context.Context, subject string) error {
|
||||
p.mu.Lock()
|
||||
defer p.mu.Unlock()
|
||||
p.setupCalls++
|
||||
p.setupSubject = subject
|
||||
return p.setupErr
|
||||
}
|
||||
func (p *provider) Accounts(context.Context, string) ([]Account, error) {
|
||||
return []Account{{ID: "ledger", Currency: "EUR", Precision: 2, Available: 5000}}, nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user