Improve the frontend 3
This commit is contained in:
@@ -19,7 +19,11 @@ from ..schemas.tenant_settings import (
|
||||
ProductionSettings,
|
||||
SupplierSettings,
|
||||
POSSettings,
|
||||
OrderSettings
|
||||
OrderSettings,
|
||||
ReplenishmentSettings,
|
||||
SafetyStockSettings,
|
||||
MOQSettings,
|
||||
SupplierSelectionSettings
|
||||
)
|
||||
|
||||
logger = structlog.get_logger()
|
||||
@@ -38,7 +42,11 @@ class TenantSettingsService:
|
||||
"production": ProductionSettings,
|
||||
"supplier": SupplierSettings,
|
||||
"pos": POSSettings,
|
||||
"order": OrderSettings
|
||||
"order": OrderSettings,
|
||||
"replenishment": ReplenishmentSettings,
|
||||
"safety_stock": SafetyStockSettings,
|
||||
"moq": MOQSettings,
|
||||
"supplier_selection": SupplierSelectionSettings
|
||||
}
|
||||
|
||||
# Map category names to database column names
|
||||
@@ -48,7 +56,11 @@ class TenantSettingsService:
|
||||
"production": "production_settings",
|
||||
"supplier": "supplier_settings",
|
||||
"pos": "pos_settings",
|
||||
"order": "order_settings"
|
||||
"order": "order_settings",
|
||||
"replenishment": "replenishment_settings",
|
||||
"safety_stock": "safety_stock_settings",
|
||||
"moq": "moq_settings",
|
||||
"supplier_selection": "supplier_selection_settings"
|
||||
}
|
||||
|
||||
def __init__(self, db: AsyncSession):
|
||||
@@ -125,6 +137,18 @@ class TenantSettingsService:
|
||||
if updates.order_settings is not None:
|
||||
settings.order_settings = updates.order_settings.dict()
|
||||
|
||||
if updates.replenishment_settings is not None:
|
||||
settings.replenishment_settings = updates.replenishment_settings.dict()
|
||||
|
||||
if updates.safety_stock_settings is not None:
|
||||
settings.safety_stock_settings = updates.safety_stock_settings.dict()
|
||||
|
||||
if updates.moq_settings is not None:
|
||||
settings.moq_settings = updates.moq_settings.dict()
|
||||
|
||||
if updates.supplier_selection_settings is not None:
|
||||
settings.supplier_selection_settings = updates.supplier_selection_settings.dict()
|
||||
|
||||
return await self.repository.update(settings)
|
||||
|
||||
async def get_category(self, tenant_id: UUID, category: str) -> Dict[str, Any]:
|
||||
@@ -247,7 +271,11 @@ class TenantSettingsService:
|
||||
production_settings=defaults["production_settings"],
|
||||
supplier_settings=defaults["supplier_settings"],
|
||||
pos_settings=defaults["pos_settings"],
|
||||
order_settings=defaults["order_settings"]
|
||||
order_settings=defaults["order_settings"],
|
||||
replenishment_settings=defaults["replenishment_settings"],
|
||||
safety_stock_settings=defaults["safety_stock_settings"],
|
||||
moq_settings=defaults["moq_settings"],
|
||||
supplier_selection_settings=defaults["supplier_selection_settings"]
|
||||
)
|
||||
|
||||
return await self.repository.create(settings)
|
||||
|
||||
Reference in New Issue
Block a user