Merge branch 'main' of https://gits.altru.id/apksel-dev/apskel-pos-backend into feature/expense
This commit is contained in:
@@ -100,6 +100,8 @@ func OrderModelToContract(resp *models.OrderResponse) *contract.OrderResponse {
|
||||
ProductName: item.ProductName,
|
||||
ProductVariantID: item.ProductVariantID,
|
||||
ProductVariantName: item.ProductVariantName,
|
||||
CategoryID: item.CategoryID,
|
||||
CategoryName: item.CategoryName,
|
||||
Quantity: item.Quantity,
|
||||
UnitPrice: item.UnitPrice,
|
||||
TotalPrice: item.TotalPrice,
|
||||
@@ -110,6 +112,7 @@ func OrderModelToContract(resp *models.OrderResponse) *contract.OrderResponse {
|
||||
CreatedAt: item.CreatedAt,
|
||||
UpdatedAt: item.UpdatedAt,
|
||||
PrinterType: item.PrinterType,
|
||||
PrintToChecker: item.PrintToChecker,
|
||||
PaidQuantity: item.PaidQuantity,
|
||||
}
|
||||
}
|
||||
@@ -168,6 +171,8 @@ func AddToOrderModelToContract(resp *models.AddToOrderResponse) *contract.AddToO
|
||||
ProductName: item.ProductName,
|
||||
ProductVariantID: item.ProductVariantID,
|
||||
ProductVariantName: item.ProductVariantName,
|
||||
CategoryID: item.CategoryID,
|
||||
CategoryName: item.CategoryName,
|
||||
Quantity: item.Quantity,
|
||||
UnitPrice: item.UnitPrice,
|
||||
TotalPrice: item.TotalPrice,
|
||||
@@ -177,6 +182,7 @@ func AddToOrderModelToContract(resp *models.AddToOrderResponse) *contract.AddToO
|
||||
Status: string(item.Status),
|
||||
CreatedAt: item.CreatedAt,
|
||||
UpdatedAt: item.UpdatedAt,
|
||||
PrintToChecker: item.PrintToChecker,
|
||||
}
|
||||
}
|
||||
return &contract.AddToOrderResponse{
|
||||
|
||||
@@ -11,9 +11,10 @@ func CreateProductOutletPriceRequestToModel(req *contract.CreateProductOutletPri
|
||||
}
|
||||
|
||||
return &models.CreateProductOutletPriceRequest{
|
||||
ProductID: req.ProductID,
|
||||
OutletID: req.OutletID,
|
||||
Price: req.Price,
|
||||
ProductID: req.ProductID,
|
||||
OutletID: req.OutletID,
|
||||
Price: req.Price,
|
||||
PrintToChecker: req.PrintToChecker,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +24,8 @@ func UpdateProductOutletPriceRequestToModel(req *contract.UpdateProductOutletPri
|
||||
}
|
||||
|
||||
return &models.UpdateProductOutletPriceRequest{
|
||||
Price: &req.Price,
|
||||
Price: &req.Price,
|
||||
PrintToChecker: req.PrintToChecker,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,12 +35,13 @@ func ProductOutletPriceModelToResponse(m *models.ProductOutletPrice) *contract.P
|
||||
}
|
||||
|
||||
return &contract.ProductOutletPriceResponse{
|
||||
ID: m.ID,
|
||||
ProductID: m.ProductID,
|
||||
OutletID: m.OutletID,
|
||||
Price: m.Price,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
ID: m.ID,
|
||||
ProductID: m.ProductID,
|
||||
OutletID: m.OutletID,
|
||||
Price: m.Price,
|
||||
PrintToChecker: m.PrintToChecker,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ func CreateProductRequestToModel(apctx *appcontext.ContextInfo, req *contract.Cr
|
||||
BusinessType: businessType,
|
||||
ImageURL: req.ImageURL,
|
||||
PrinterType: req.PrinterType,
|
||||
PrintToChecker: req.PrintToChecker,
|
||||
Metadata: metadata,
|
||||
Variants: variants,
|
||||
}
|
||||
@@ -75,17 +76,18 @@ func UpdateProductRequestToModel(apctx *appcontext.ContextInfo, req *contract.Up
|
||||
}
|
||||
|
||||
return &models.UpdateProductRequest{
|
||||
OutletID: outletID,
|
||||
CategoryID: req.CategoryID,
|
||||
SKU: req.SKU,
|
||||
Name: req.Name,
|
||||
Description: req.Description,
|
||||
Price: req.Price,
|
||||
Cost: req.Cost,
|
||||
ImageURL: req.ImageURL,
|
||||
PrinterType: req.PrinterType,
|
||||
Metadata: metadata,
|
||||
IsActive: req.IsActive,
|
||||
OutletID: outletID,
|
||||
CategoryID: req.CategoryID,
|
||||
SKU: req.SKU,
|
||||
Name: req.Name,
|
||||
Description: req.Description,
|
||||
Price: req.Price,
|
||||
Cost: req.Cost,
|
||||
ImageURL: req.ImageURL,
|
||||
PrinterType: req.PrinterType,
|
||||
PrintToChecker: req.PrintToChecker,
|
||||
Metadata: metadata,
|
||||
IsActive: req.IsActive,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,9 +121,10 @@ func ProductModelResponseToResponse(prod *models.ProductResponse) *contract.Prod
|
||||
outletPriceResponses = make([]contract.ProductOutletPriceResponse, len(prod.OutletPrices))
|
||||
for i, op := range prod.OutletPrices {
|
||||
outletPriceResponses[i] = contract.ProductOutletPriceResponse{
|
||||
OutletID: op.OutletID,
|
||||
OutletName: op.OutletName,
|
||||
Price: op.Price,
|
||||
OutletID: op.OutletID,
|
||||
OutletName: op.OutletName,
|
||||
Price: op.Price,
|
||||
PrintToChecker: op.PrintToChecker,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -141,6 +144,7 @@ func ProductModelResponseToResponse(prod *models.ProductResponse) *contract.Prod
|
||||
BusinessType: string(prod.BusinessType),
|
||||
ImageURL: prod.ImageURL,
|
||||
PrinterType: prod.PrinterType,
|
||||
PrintToChecker: prod.PrintToChecker,
|
||||
Metadata: prod.Metadata,
|
||||
IsActive: prod.IsActive,
|
||||
CreatedAt: prod.CreatedAt,
|
||||
|
||||
Reference in New Issue
Block a user