Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { ID string `json:"id"` Name string `json:"name"` ParentAccountID *string `json:"parentAccountId"` EntityID string `json:"entityId"` InstrumentCode string `json:"instrumentCode"` OrganizationID string `json:"organizationId"` LedgerID string `json:"ledgerId"` PortfolioID string `json:"portfolioId"` ProductID *string `json:"productId"` Balance Balance `json:"balance"` Status Status `json:"status"` Alias *string `json:"alias"` Type string `json:"type"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt *time.Time `json:"deletedAt"` Metadata map[string]any `json:"metadata"` }
Account is a struct designed to encapsulate response payload data.
type AccountPostgreSQLModel ¶
type AccountPostgreSQLModel struct { ID string Name string ParentAccountID *string EntityID string InstrumentCode string OrganizationID string LedgerID string PortfolioID string ProductID *string AvailableBalance *float64 OnHoldBalance *float64 BalanceScale *float64 Status string StatusDescription *string AllowSending bool AllowReceiving bool Alias *string Type string CreatedAt time.Time UpdatedAt time.Time DeletedAt sql.NullTime Metadata map[string]any }
AccountPostgreSQLModel represents the entity Account into SQL context in Database
func (*AccountPostgreSQLModel) FromEntity ¶
func (t *AccountPostgreSQLModel) FromEntity(account *Account)
FromEntity converts a request entity Account to AccountPostgreSQLModel
func (*AccountPostgreSQLModel) ToEntity ¶
func (t *AccountPostgreSQLModel) ToEntity() *Account
ToEntity converts an AccountPostgreSQLModel to a response entity Account
type Balance ¶
type Balance struct { Available *float64 `json:"available"` OnHold *float64 `json:"onHold"` Scale *float64 `json:"scale"` }
Balance structure for marshaling/unmarshalling JSON.
type CreateAccountInput ¶
type CreateAccountInput struct { InstrumentCode string `json:"instrumentCode"` Name string `json:"name"` Alias *string `json:"alias"` Type string `json:"type"` ParentAccountID *string `json:"parentAccountId"` ProductID *string `json:"productId"` EntityID *string `json:"entityId"` Status Status `json:"status"` Metadata map[string]any `json:"metadata"` }
CreateAccountInput is a struct design to encapsulate request create payload data.
type Repository ¶
type Repository interface { Create(ctx context.Context, account *Account) (*Account, error) FindAll(ctx context.Context, organizationID, ledgerID, portfolioID uuid.UUID, limit, page int) ([]*Account, error) Find(ctx context.Context, organizationID, ledgerID, portfolioID, id uuid.UUID) (*Account, error) FindByAlias(ctx context.Context, organizationID, ledgerID, portfolioID uuid.UUID, alias string) (bool, error) ListByIDs(ctx context.Context, organizationID, ledgerID, portfolioID uuid.UUID, ids []uuid.UUID) ([]*Account, error) Update(ctx context.Context, organizationID, ledgerID, portfolioID, id uuid.UUID, account *Account) (*Account, error) Delete(ctx context.Context, organizationID, ledgerID, portfolioID, id uuid.UUID) error }
Repository provides an interface for operations related to account entities.
type Status ¶
type Status struct { Code string `json:"code"` Description *string `json:"description"` AllowSending bool `json:"allowSending"` AllowReceiving bool `json:"allowReceiving"` }
Status structure for marshaling/unmarshalling JSON.
type UpdateAccountInput ¶
type UpdateAccountInput struct { Name string `json:"name"` Status Status `json:"status"` Alias *string `json:"alias"` ProductID *string `json:"productId"` Metadata map[string]any `json:"metadata"` }
UpdateAccountInput is a struct design to encapsulate request update payload data.