add OutletID field to category across all layers

This commit is contained in:
2026-05-13 15:04:42 +07:00
parent fa037b4d2a
commit c5f94229a7
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -55,6 +55,7 @@ func (p *CategoryProcessorImpl) CreateCategory(ctx context.Context, req *models.
// Map request to entity
categoryEntity := mappers.CreateCategoryRequestToEntity(req)
categoryEntity.OutletID = req.OutletID
// Create category
if err := p.categoryRepo.Create(ctx, categoryEntity); err != nil {
@@ -86,6 +87,9 @@ func (p *CategoryProcessorImpl) UpdateCategory(ctx context.Context, id uuid.UUID
// Apply updates to entity
mappers.UpdateCategoryEntityFromRequest(existingCategory, req)
if req.OutletID != nil {
existingCategory.OutletID = *req.OutletID
}
// Update category
if err := p.categoryRepo.Update(ctx, existingCategory); err != nil {