update order status
This commit is contained in:
@@ -74,6 +74,21 @@ func (r *OrderRepositoryImpl) Update(ctx context.Context, order *entities.Order)
|
||||
return r.db.WithContext(ctx).Save(order).Error
|
||||
}
|
||||
|
||||
func (r *OrderRepositoryImpl) UpdateStatusSuccess(
|
||||
ctx context.Context,
|
||||
id uuid.UUID,
|
||||
orderStatus entities.OrderStatus,
|
||||
paymentStatus entities.PaymentStatus,
|
||||
) error {
|
||||
return r.db.WithContext(ctx).
|
||||
Model(&entities.Order{}).
|
||||
Where("id = ?", id).
|
||||
Updates(map[string]interface{}{
|
||||
"order_status": orderStatus,
|
||||
"payment_status": paymentStatus,
|
||||
}).Error
|
||||
}
|
||||
|
||||
func (r *OrderRepositoryImpl) Delete(ctx context.Context, id uuid.UUID) error {
|
||||
return r.db.WithContext(ctx).Delete(&entities.Order{}, "id = ?", id).Error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user