Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateLedgerInput ¶
type CreateLedgerInput struct { Name string `json:"name" validate:"required"` Status Status `json:"status"` Metadata map[string]any `json:"metadata"` }
CreateLedgerInput is a struct design to encapsulate request create payload data.
type Ledger ¶
type Ledger struct { ID string `json:"id"` Name string `json:"name"` OrganizationID string `json:"organizationId"` Status Status `json:"status"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt *time.Time `json:"deletedAt" sql:"index"` Metadata map[string]any `json:"metadata"` }
Ledger is a struct designed to encapsulate payload data.
type LedgerPostgreSQLModel ¶
type LedgerPostgreSQLModel struct { ID string Name string OrganizationID string Status string StatusDescription *string CreatedAt time.Time UpdatedAt time.Time DeletedAt sql.NullTime Metadata map[string]any }
LedgerPostgreSQLModel represents the entity.Ledger into SQL context in Database
func (*LedgerPostgreSQLModel) FromEntity ¶
func (t *LedgerPostgreSQLModel) FromEntity(ledger *Ledger)
FromEntity converts an entity.Ledger to LedgerPostgreSQLModel
func (*LedgerPostgreSQLModel) ToEntity ¶
func (t *LedgerPostgreSQLModel) ToEntity() *Ledger
ToEntity converts an LedgerPostgreSQLModel to entity.Ledger
type Repository ¶
type Repository interface { Create(ctx context.Context, ledger *Ledger) (*Ledger, error) Find(ctx context.Context, organizationID, id uuid.UUID) (*Ledger, error) FindAll(ctx context.Context, organizationID uuid.UUID, limit, page int) ([]*Ledger, error) ListByIDs(ctx context.Context, organizationID uuid.UUID, ids []uuid.UUID) ([]*Ledger, error) Update(ctx context.Context, organizationID, id uuid.UUID, ledger *Ledger) (*Ledger, error) Delete(ctx context.Context, organizationID, id uuid.UUID) error }
Repository provides an interface for operations related to ledger entities.
Click to show internal directories.
Click to hide internal directories.