mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-23 14:55:42 +00:00
Feat[BE-300]: add preload for kandang for get penjualan
This commit is contained in:
@@ -28,8 +28,6 @@ type SalesDTO struct {
|
|||||||
PaymentStatus string `json:"payment_status"`
|
PaymentStatus string `json:"payment_status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
type PenjualanRealisasiResponseDTO struct {
|
type PenjualanRealisasiResponseDTO struct {
|
||||||
ProjectType string `json:"project_type"`
|
ProjectType string `json:"project_type"`
|
||||||
FlockId uint `json:"flock_id"`
|
FlockId uint `json:"flock_id"`
|
||||||
@@ -57,6 +55,10 @@ func ToSalesDTO(e entity.MarketingDeliveryProduct) SalesDTO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var kandang *kandangDTO.KandangRelationDTO
|
var kandang *kandangDTO.KandangRelationDTO
|
||||||
|
if e.MarketingProduct.ProductWarehouse.ProjectFlockKandang != nil && e.MarketingProduct.ProductWarehouse.ProjectFlockKandang.Kandang.Id != 0 {
|
||||||
|
mapped := kandangDTO.ToKandangRelationDTO(e.MarketingProduct.ProductWarehouse.ProjectFlockKandang.Kandang)
|
||||||
|
kandang = &mapped
|
||||||
|
}
|
||||||
|
|
||||||
doNumber := deliveryOrdersDTO.GenerateDeliveryOrderNumber(e.MarketingProduct.Marketing.SoNumber, e.DeliveryDate, e.MarketingProduct.ProductWarehouse.Warehouse.Id)
|
doNumber := deliveryOrdersDTO.GenerateDeliveryOrderNumber(e.MarketingProduct.Marketing.SoNumber, e.DeliveryDate, e.MarketingProduct.ProductWarehouse.Warehouse.Id)
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ func (s closingService) GetPenjualan(c *fiber.Ctx, projectFlockID uint) ([]entit
|
|||||||
Preload("MarketingProduct.ProductWarehouse.Product.Flags").
|
Preload("MarketingProduct.ProductWarehouse.Product.Flags").
|
||||||
Preload("MarketingProduct.ProductWarehouse.Warehouse").
|
Preload("MarketingProduct.ProductWarehouse.Warehouse").
|
||||||
Preload("MarketingProduct.ProductWarehouse.ProjectFlockKandang").
|
Preload("MarketingProduct.ProductWarehouse.ProjectFlockKandang").
|
||||||
|
Preload("MarketingProduct.ProductWarehouse.ProjectFlockKandang.Kandang").
|
||||||
Preload("MarketingProduct.Marketing").
|
Preload("MarketingProduct.Marketing").
|
||||||
Preload("MarketingProduct.Marketing.Customer").
|
Preload("MarketingProduct.Marketing.Customer").
|
||||||
Order("marketing_delivery_products.delivery_date DESC")
|
Order("marketing_delivery_products.delivery_date DESC")
|
||||||
|
|||||||
Reference in New Issue
Block a user