fix: preserve billing response shape
This commit is contained in:
1 parent
600cba023c
commit
2ef3da7af5
7 files changed
+488
-6
No files matched your search
@@ -53,6 +53,9 @@ func (s *Service) Overview(ctx context.Context, organizationID, accountID string
|
||||
if err != nil {
|
||||
return Overview{}, err
|
||||
}
|
||||
if ledger == nil {
|
||||
ledger = []LedgerEntry{}
|
||||
}
|
||||
personal, err := s.store.BillingLedger(ctx, organizationID, accountID, 500)
|
||||
if err != nil {
|
||||
return Overview{}, err
|
||||
@@ -118,6 +121,18 @@ func (s *Service) AdminOverview(ctx context.Context) (AdminOverview, error) {
|
||||
if err != nil {
|
||||
return AdminOverview{}, err
|
||||
}
|
||||
if organizations == nil {
|
||||
organizations = []Organization{}
|
||||
}
|
||||
if members == nil {
|
||||
members = []Member{}
|
||||
}
|
||||
if ledger == nil {
|
||||
ledger = []LedgerEntry{}
|
||||
}
|
||||
if rules == nil {
|
||||
rules = []PriceRule{}
|
||||
}
|
||||
byOrganization := map[string]Wallet{}
|
||||
for _, wallet := range wallets {
|
||||
byOrganization[wallet.OrganizationID] = wallet
|
||||
|
||||
Reference in new issue
Block a user