Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProductPostgreSQLModel ¶
type ProductPostgreSQLModel struct { ID string Name string LedgerID string OrganizationID string Status string StatusDescription *string CreatedAt time.Time UpdatedAt time.Time DeletedAt sql.NullTime Metadata map[string]any }
ProductPostgreSQLModel represents the entity Product into SQL context in Database
func (*ProductPostgreSQLModel) FromEntity ¶
func (t *ProductPostgreSQLModel) FromEntity(product *mmodel.Product)
FromEntity converts an entity.Product to ProductPostgreSQLModel
func (*ProductPostgreSQLModel) ToEntity ¶
func (t *ProductPostgreSQLModel) ToEntity() *mmodel.Product
ToEntity converts an ProductPostgreSQLModel to entity.Product
type Repository ¶
type Repository interface { Create(ctx context.Context, product *mmodel.Product) (*mmodel.Product, error) FindByName(ctx context.Context, organizationID, ledgerID uuid.UUID, name string) (bool, error) FindAll(ctx context.Context, organizationID, ledgerID uuid.UUID, limit, page int) ([]*mmodel.Product, error) FindByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*mmodel.Product, error) Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*mmodel.Product, error) Update(ctx context.Context, organizationID, ledgerID, id uuid.UUID, product *mmodel.Product) (*mmodel.Product, error) Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error }
Repository provides an interface for operations related to product entities.
Click to show internal directories.
Click to hide internal directories.