add mixing topping with override
This commit is contained in:
parent
35ebde967d
commit
79dddd1fbc
15 changed files with 296 additions and 91 deletions
|
|
@ -3,12 +3,13 @@ package contracts
|
|||
// ================================== Recipes Dashboard and Overview ==================================
|
||||
|
||||
type RecipeOverview struct {
|
||||
ID int `json:"id"`
|
||||
ProductCode string `json:"productCode"`
|
||||
Name string `json:"name"`
|
||||
OtherName string `json:"otherName"`
|
||||
Description string `json:"description"`
|
||||
LastUpdated string `json:"lastUpdated"`
|
||||
ID int `json:"id"`
|
||||
ProductCode string `json:"productCode"`
|
||||
Name string `json:"name"`
|
||||
OtherName string `json:"otherName"`
|
||||
Description string `json:"description"`
|
||||
OtherDescription string `json:"otherDescription"`
|
||||
LastUpdated string `json:"lastUpdated"`
|
||||
}
|
||||
|
||||
type RecipeDashboardRequest struct {
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ func (d *Data) GetRecipe01ByProductCode(filename, countryID, productCode string)
|
|||
d.taoLogger.Log.Error("GetRecipe01ByProductCode: Error when read recipe file, Return default recipe", zap.Error(err))
|
||||
for _, v := range d.currentRecipe[countryID].Recipe01 {
|
||||
if v.ProductCode == productCode {
|
||||
return v, nil
|
||||
return v, fmt.Errorf("[DEFAULT]-ERR")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ func (mr *MaterialRouter) GetFullMaterialDetail(w http.ResponseWriter, r *http.R
|
|||
materialDetails = append(materialDetails, map[string]interface{}{
|
||||
"materialId": matSetting.ID,
|
||||
"name": mat_name,
|
||||
"nameEN": matSetting.MaterialOtherName,
|
||||
"type": "powder:" + strconv.FormatBool(matSetting.PowderChannel) + ",syrup:" + strconv.FormatBool(matSetting.SyrupChannel) + ",bean:" + strconv.FormatBool(matSetting.BeanChannel) + ",equipment:" + strconv.FormatBool(matSetting.IsEquipment) + ",soda:" + strconv.FormatBool(matSetting.SodaChannel) + ",icecream:" + strconv.FormatBool(matSetting.IceScreamBingsuChannel),
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -245,12 +245,13 @@ func (rs *recipeService) GetRecipeOverview(request *contracts.RecipeOverviewRequ
|
|||
// Map to contracts.RecipeOverview
|
||||
for _, v := range recipeFilter {
|
||||
result.Result = append(result.Result, contracts.RecipeOverview{
|
||||
ID: v.ID,
|
||||
ProductCode: v.ProductCode,
|
||||
Name: v.Name,
|
||||
OtherName: v.OtherName,
|
||||
Description: v.Description,
|
||||
LastUpdated: v.LastChange,
|
||||
ID: v.ID,
|
||||
ProductCode: v.ProductCode,
|
||||
Name: v.Name,
|
||||
OtherName: v.OtherName,
|
||||
Description: v.Description,
|
||||
OtherDescription: v.OtherDescription,
|
||||
LastUpdated: v.LastChange,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue