Feat[BE-261,265]: createing BOP and BOP realization(Unfinished)

This commit is contained in:
aguhh18
2025-11-19 16:05:11 +07:00
parent a57ef82ebb
commit 105b20c333
18 changed files with 1279 additions and 115 deletions
@@ -18,6 +18,7 @@ type NonstockRepository interface {
SyncFlags(ctx context.Context, tx *gorm.DB, nonstockID uint, flags []string) error
DeleteFlags(ctx context.Context, tx *gorm.DB, nonstockID uint) error
GetFlags(ctx context.Context, nonstockID uint) ([]entity.Flag, error)
IdExists(ctx context.Context, id uint) (bool, error)
}
type NonstockRepositoryImpl struct {
@@ -34,6 +35,10 @@ func (r *NonstockRepositoryImpl) NameExists(ctx context.Context, name string, ex
return repository.ExistsByName[entity.Nonstock](ctx, r.DB(), name, excludeID)
}
func (r *NonstockRepositoryImpl) IdExists(ctx context.Context, id uint) (bool, error) {
return repository.Exists[entity.Nonstock](ctx, r.DB(), id)
}
func (r *NonstockRepositoryImpl) SyncSuppliersDiff(ctx context.Context, tx *gorm.DB, nonstockID uint, supplierIDs []uint) error {
db := tx
if db == nil {