mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-23 23:05:44 +00:00
feat(BE-48): auto-create product_warehouse on stock adjustment & remove unused APIs
- Change logic: automatically create product_warehouse if it does not exist during stock adjustment - Remove unnecessary/unused API endpoints - Ensure adjustment process continues even if product_warehouse was not previously available
This commit is contained in:
@@ -14,6 +14,7 @@ type WarehouseRepository interface {
|
||||
LocationExists(ctx context.Context, locationId uint) (bool, error)
|
||||
KandangExists(ctx context.Context, kandangId uint) (bool, error)
|
||||
NameExists(ctx context.Context, name string, excludeID *uint) (bool, error)
|
||||
IdExists(ctx context.Context, id uint) (bool, error)
|
||||
}
|
||||
|
||||
type WarehouseRepositoryImpl struct {
|
||||
@@ -43,3 +44,6 @@ func (r *WarehouseRepositoryImpl) KandangExists(ctx context.Context, kandangId u
|
||||
func (r *WarehouseRepositoryImpl) NameExists(ctx context.Context, name string, excludeID *uint) (bool, error) {
|
||||
return repository.ExistsByName[entity.Warehouse](ctx, r.db, name, excludeID)
|
||||
}
|
||||
func (r *WarehouseRepositoryImpl) IdExists(ctx context.Context, id uint) (bool, error) {
|
||||
return repository.Exists[entity.Warehouse](ctx, r.db, id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user