Documentation ¶
Index ¶
- func CreateItemRepo(conn *gorm.DB) items.Repository
- func ToListDomain(data []Items) (result []items.Domain)
- type Items
- type ItemsRepo
- func (rep *ItemsRepo) Create(ctx context.Context, itemCreate *items.Domain) (items.Domain, error)
- func (repo *ItemsRepo) Delete(ctx context.Context, id int) error
- func (repo *ItemsRepo) GetAll(ctx context.Context) ([]items.Domain, error)
- func (repo *ItemsRepo) GetByCategoryId(ctx context.Context, id int) ([]items.Domain, error)
- func (repo *ItemsRepo) GetByItemId(ctx context.Context, id int) (items.Domain, error)
- func (repo *ItemsRepo) Update(ctx context.Context, itemUpdate items.Domain) (items.Domain, error)
- func (repo *ItemsRepo) UpdateStock(ctx context.Context, itemUpdate items.Domain) (items.Domain, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateItemRepo ¶
func CreateItemRepo(conn *gorm.DB) items.Repository
func ToListDomain ¶
Types ¶
type Items ¶
type Items struct { Id int `gorm:"primaryKey"` CategoryId int Category category.Category `gorm:"foreignKey:CategoryId;association_foreignkey:Id"` Name string PointRedeem int Stock int CreatedAt time.Time UpdatedAt time.Time }
func FromDomain ¶
Click to show internal directories.
Click to hide internal directories.