fixed ledger account listing + quotation listing

This commit is contained in:
Stephan D
2026-01-23 02:48:10 +01:00
parent 218c4e20b3
commit 41f653775f
60 changed files with 469 additions and 283 deletions

View File

@@ -6,23 +6,25 @@ import (
"github.com/tech/sendico/pkg/api/http/response"
"github.com/tech/sendico/pkg/mlogger"
"github.com/tech/sendico/pkg/model"
moneyv1 "github.com/tech/sendico/pkg/proto/common/money/v1"
ledgerv1 "github.com/tech/sendico/pkg/proto/ledger/v1"
)
type ledgerAccount struct {
LedgerAccountRef string `json:"ledgerAccountRef"`
OrganizationRef string `json:"organizationRef"`
OwnerRef string `json:"ownerRef,omitempty"`
AccountCode string `json:"accountCode"`
AccountType string `json:"accountType"`
Currency string `json:"currency"`
Status string `json:"status"`
AllowNegative bool `json:"allowNegative"`
IsSettlement bool `json:"isSettlement"`
Metadata map[string]string `json:"metadata,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
model.Describable `bson:",inline" json:",inline"`
LedgerAccountRef string `json:"ledgerAccountRef"`
OrganizationRef string `json:"organizationRef"`
OwnerRef string `json:"ownerRef,omitempty"`
AccountCode string `json:"accountCode"`
AccountType string `json:"accountType"`
Currency string `json:"currency"`
Status string `json:"status"`
AllowNegative bool `json:"allowNegative"`
IsSettlement bool `json:"isSettlement"`
Metadata map[string]string `json:"metadata,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
}
type ledgerAccountsResponse struct {
@@ -82,6 +84,10 @@ func toLedgerAccount(acc *ledgerv1.LedgerAccount) ledgerAccount {
return ledgerAccount{}
}
return ledgerAccount{
Describable: model.Describable{
Name: acc.GetDescribable().GetName(),
Description: acc.GetDescribable().Description,
},
LedgerAccountRef: acc.GetLedgerAccountRef(),
OrganizationRef: acc.GetOrganizationRef(),
OwnerRef: acc.GetOwnerRef(),