Update payment
This commit is contained in:
@@ -19,6 +19,7 @@ type InventoryMovementRepository interface {
|
||||
GetByPaymentID(ctx context.Context, paymentID uuid.UUID) ([]*entities.InventoryMovement, error)
|
||||
Count(ctx context.Context, filters map[string]interface{}) (int64, error)
|
||||
CreateWithTransaction(tx *gorm.DB, movement *entities.InventoryMovement) error
|
||||
CreateInBatches(ctx context.Context, movements []*entities.InventoryMovement, batchSize int) error
|
||||
}
|
||||
|
||||
type InventoryMovementRepositoryImpl struct {
|
||||
@@ -39,6 +40,13 @@ func (r *InventoryMovementRepositoryImpl) CreateWithTransaction(tx *gorm.DB, mov
|
||||
return tx.Create(movement).Error
|
||||
}
|
||||
|
||||
func (r *InventoryMovementRepositoryImpl) CreateInBatches(ctx context.Context, movements []*entities.InventoryMovement, batchSize int) error {
|
||||
if len(movements) == 0 {
|
||||
return nil
|
||||
}
|
||||
return r.db.WithContext(ctx).CreateInBatches(movements, batchSize).Error
|
||||
}
|
||||
|
||||
func (r *InventoryMovementRepositoryImpl) GetByID(ctx context.Context, id uuid.UUID) (*entities.InventoryMovement, error) {
|
||||
var movement entities.InventoryMovement
|
||||
err := r.db.WithContext(ctx).First(&movement, "id = ?", id).Error
|
||||
|
||||
Reference in New Issue
Block a user