mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-24 07:15:43 +00:00
feat(BE): price-product-supplier
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
type SupplierNonstockDTO struct {
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Price float64 `json:"price"`
|
||||
Uom *uomDTO.UomRelationDTO `json:"uom,omitempty"`
|
||||
Flags []string `json:"flags"`
|
||||
}
|
||||
@@ -42,6 +43,7 @@ func toSupplierNonstockDTOs(relations []entity.NonstockSupplier) []SupplierNonst
|
||||
result = append(result, SupplierNonstockDTO{
|
||||
Id: Nonstock.Id,
|
||||
Name: Nonstock.Name,
|
||||
Price: relation.Price,
|
||||
Uom: uomRef,
|
||||
Flags: flags,
|
||||
})
|
||||
|
||||
@@ -8,12 +8,13 @@ import (
|
||||
// === DTO Structs ===
|
||||
|
||||
type SupplierProductDTO struct {
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
ProductPrice float64 `gorm:"type:numeric(15,3);not null"`
|
||||
SellingPrice *float64 `gorm:"type:numeric(15,3)"`
|
||||
Uom *uomDTO.UomRelationDTO `json:"uom,omitempty"`
|
||||
Flags []string `json:"flags"`
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
ProductPrice float64 `gorm:"type:numeric(15,3);not null"`
|
||||
SellingPrice *float64 `gorm:"type:numeric(15,3)"`
|
||||
SupplierPrice float64 `json:"supplier_price"`
|
||||
Uom *uomDTO.UomRelationDTO `json:"uom,omitempty"`
|
||||
Flags []string `json:"flags"`
|
||||
}
|
||||
|
||||
// === Mapper Functions ===
|
||||
@@ -42,12 +43,13 @@ func toSupplierProductDTOs(relations []entity.ProductSupplier) []SupplierProduct
|
||||
}
|
||||
|
||||
result = append(result, SupplierProductDTO{
|
||||
Id: product.Id,
|
||||
Name: product.Name,
|
||||
ProductPrice: product.ProductPrice,
|
||||
SellingPrice: product.SellingPrice,
|
||||
Uom: uomRef,
|
||||
Flags: flags,
|
||||
Id: product.Id,
|
||||
Name: product.Name,
|
||||
ProductPrice: product.ProductPrice,
|
||||
SellingPrice: product.SellingPrice,
|
||||
SupplierPrice: relation.Price,
|
||||
Uom: uomRef,
|
||||
Flags: flags,
|
||||
})
|
||||
}
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user