product

package
v1.29.0-beta.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL