Feat(BE-36,37,38,39): master area, customer, kandang, location, warehouse

This commit is contained in:
Hafizh A. Y
2025-10-02 10:51:15 +07:00
parent dbc1f79a36
commit e8905be856
79 changed files with 3745 additions and 169 deletions
@@ -1,21 +1,30 @@
package repository
import (
model "gitlab.com/mbugroup/lti-api.git/internal/modules/master/uoms/models"
"gitlab.com/mbugroup/lti-api.git/internal/repository"
"context"
"gitlab.com/mbugroup/lti-api.git/internal/common/repository"
entity "gitlab.com/mbugroup/lti-api.git/internal/entities"
"gorm.io/gorm"
)
type UomRepository interface {
repository.BaseRepository[model.Uom]
repository.BaseRepository[entity.Uom]
NameExists(ctx context.Context, name string, excludeID *uint) (bool, error)
}
type UomRepositoryImpl struct {
*repository.BaseRepositoryImpl[model.Uom]
*repository.BaseRepositoryImpl[entity.Uom]
db *gorm.DB
}
func NewUomRepository(db *gorm.DB) UomRepository {
return &UomRepositoryImpl{
BaseRepositoryImpl: repository.NewBaseRepository[model.Uom](db),
BaseRepositoryImpl: repository.NewBaseRepository[entity.Uom](db),
db: db,
}
}
func (r *UomRepositoryImpl) NameExists(ctx context.Context, name string, excludeID *uint) (bool, error) {
return repository.ExistsByName[entity.Uom](ctx, r.db, name, excludeID)
}