feat[BE]: enhance marketing module by adding ProductWarehouseId to marketing delivery product creation

This commit is contained in:
aguhh18
2025-12-28 10:40:20 +07:00
parent 56811f7c5b
commit a0d2c1c7dd
2 changed files with 11 additions and 17 deletions
@@ -603,15 +603,16 @@ func (s *salesOrdersService) createMarketingProductWithDelivery(ctx context.Cont
}
marketingDeliveryProduct := &entity.MarketingDeliveryProduct{
MarketingProductId: marketingProduct.Id,
UnitPrice: 0,
TotalWeight: 0,
AvgWeight: 0,
TotalPrice: 0,
DeliveryDate: nil,
VehicleNumber: rp.VehicleNumber,
UsageQty: 0,
PendingQty: 0,
MarketingProductId: marketingProduct.Id,
ProductWarehouseId: marketingProduct.ProductWarehouseId,
UnitPrice: 0,
TotalWeight: 0,
AvgWeight: 0,
TotalPrice: 0,
DeliveryDate: nil,
VehicleNumber: rp.VehicleNumber,
UsageQty: 0,
PendingQty: 0,
}
if err := invDeliveryRepo.CreateOne(ctx, marketingDeliveryProduct, nil); err != nil {
return err