feat: add limit owner
This commit is contained in:
@@ -12,25 +12,30 @@ func CreateCategoryRequestToModel(apctx *appcontext.ContextInfo, req *contract.C
|
||||
order = *req.Order
|
||||
}
|
||||
return &models.CreateCategoryRequest{
|
||||
OrganizationID: apctx.OrganizationID,
|
||||
OutletID: req.OutletID,
|
||||
ParentID: req.ParentID,
|
||||
Name: req.Name,
|
||||
Description: req.Description,
|
||||
ImageURL: nil,
|
||||
Order: order,
|
||||
OrganizationID: apctx.OrganizationID,
|
||||
OutletID: req.OutletID,
|
||||
ParentID: req.ParentID,
|
||||
Name: req.Name,
|
||||
Description: req.Description,
|
||||
ImageURL: nil,
|
||||
Order: order,
|
||||
OwnerFeePercent: req.OwnerFeePercent,
|
||||
}
|
||||
}
|
||||
|
||||
func UpdateCategoryRequestToModel(req *contract.UpdateCategoryRequest) *models.UpdateCategoryRequest {
|
||||
return &models.UpdateCategoryRequest{
|
||||
Name: req.Name,
|
||||
Description: req.Description,
|
||||
ImageURL: nil,
|
||||
OutletID: req.OutletID,
|
||||
ParentID: req.ParentID,
|
||||
Order: req.Order,
|
||||
IsActive: nil,
|
||||
Name: req.Name,
|
||||
Description: req.Description,
|
||||
ImageURL: nil,
|
||||
OutletID: req.OutletID,
|
||||
ParentID: req.ParentID,
|
||||
Order: req.Order,
|
||||
OwnerFeePercent: req.OwnerFeePercent,
|
||||
IsActive: nil,
|
||||
|
||||
ClearParentID: req.ClearParentID,
|
||||
ClearOwnerFeePercent: req.ClearOwnerFeePercent,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,18 +45,19 @@ func CategoryModelResponseToResponse(cat *models.CategoryResponse) *contract.Cat
|
||||
}
|
||||
|
||||
return &contract.CategoryResponse{
|
||||
ID: cat.ID,
|
||||
OrganizationID: cat.OrganizationID,
|
||||
OutletID: cat.OutletID,
|
||||
ParentID: cat.ParentID,
|
||||
ParentName: cat.ParentName,
|
||||
Name: cat.Name,
|
||||
Description: cat.Description,
|
||||
BusinessType: "restaurant",
|
||||
Order: cat.Order,
|
||||
Metadata: map[string]interface{}{},
|
||||
CreatedAt: cat.CreatedAt,
|
||||
UpdatedAt: cat.UpdatedAt,
|
||||
ID: cat.ID,
|
||||
OrganizationID: cat.OrganizationID,
|
||||
OutletID: cat.OutletID,
|
||||
ParentID: cat.ParentID,
|
||||
ParentName: cat.ParentName,
|
||||
Name: cat.Name,
|
||||
Description: cat.Description,
|
||||
BusinessType: "restaurant",
|
||||
Order: cat.Order,
|
||||
OwnerFeePercent: cat.OwnerFeePercent,
|
||||
Metadata: map[string]interface{}{},
|
||||
CreatedAt: cat.CreatedAt,
|
||||
UpdatedAt: cat.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user