Spaces:
Runtime error
Runtime error
Commit ·
9198eea
1
Parent(s): b8aa454
feat(catalogues): add uom_group_id field to catalogue reference model
Browse files- Add uom_group_id column to CatalogueRef model to store UOM group UUID
- Remove redundant unit field from Inventory model for cleaner data structure
- Maintain uom_group_code field for backward compatibility with existing code
- Enable proper tracking of UOM group associations at the catalogue level
app/catalogues/models/model.py
CHANGED
|
@@ -30,6 +30,7 @@ class CatalogueRef(Base):
|
|
| 30 |
base_price = Column(Numeric(12, 2))
|
| 31 |
track_inventory = Column(Boolean, default=False)
|
| 32 |
batch_managed = Column(Boolean, default=False)
|
|
|
|
| 33 |
uom_group_code = Column(Text) # UOM group code (e.g., UOM-VOL-000001)
|
| 34 |
status = Column(Text, nullable=False)
|
| 35 |
created_at = Column(TIMESTAMP, nullable=False, default=datetime.utcnow)
|
|
@@ -171,7 +172,6 @@ class InventoryLevel(BaseModel):
|
|
| 171 |
|
| 172 |
class Inventory(BaseModel):
|
| 173 |
"""Enhanced inventory configuration model"""
|
| 174 |
-
unit: str = Field(default="PCS", description="Unit of measurement")
|
| 175 |
levels: Dict[str, InventoryLevel] = Field(..., description="Inventory levels by merchant type (ncnf, cnf, distributor, retail)")
|
| 176 |
|
| 177 |
# Legacy fields for backward compatibility
|
|
|
|
| 30 |
base_price = Column(Numeric(12, 2))
|
| 31 |
track_inventory = Column(Boolean, default=False)
|
| 32 |
batch_managed = Column(Boolean, default=False)
|
| 33 |
+
uom_group_id = Column(Text) # UOM group UUID
|
| 34 |
uom_group_code = Column(Text) # UOM group code (e.g., UOM-VOL-000001)
|
| 35 |
status = Column(Text, nullable=False)
|
| 36 |
created_at = Column(TIMESTAMP, nullable=False, default=datetime.utcnow)
|
|
|
|
| 172 |
|
| 173 |
class Inventory(BaseModel):
|
| 174 |
"""Enhanced inventory configuration model"""
|
|
|
|
| 175 |
levels: Dict[str, InventoryLevel] = Field(..., description="Inventory levels by merchant type (ncnf, cnf, distributor, retail)")
|
| 176 |
|
| 177 |
# Legacy fields for backward compatibility
|