feat: Add `acquisition_year_ref` column to the equipment model and update the historical data schema to use `HistoricalBase`.

rest-api
MrWaradana 1 month ago
parent d10f9a2bde
commit e1db01f9a8

@ -157,3 +157,4 @@ class EquipmentHistoricalTransactionRecords(Base, DefaultMixin, IdentityMixin):
eac_eac = Column(Float, nullable=False)
efdh_equivalent_forced_derated_hours = Column(Float, nullable=False)
foh_forced_outage_hours = Column(Float, nullable=False)
acquisition_year_ref = Column(String, nullable=True)

@ -87,6 +87,8 @@ class MasterBase(DefaultBase):
category_no: Optional[str] = Field(None, nullable=True)
proportion: Optional[float] = Field(None, nullable=True)
class HistoricalBase(MasterBase):
acquisition_year_ref: Optional[str] = Field(None, nullable=True)
class EquipmentCreate(EquipmentBase):
pass
@ -106,7 +108,7 @@ class EquipmentRead(DefaultBase):
maximo_data: Optional[List[dict]] = Field(None, nullable=True)
joined_maximo: Optional[List[dict]] = Field(None, nullable=True)
min_eac_disposal_cost: Optional[float] = Field(None, nullable=True, le=MAX_PRICE)
historical_data: Optional[List[MasterBase]] = Field(None, nullable=True)
historical_data: Optional[List[HistoricalBase]] = Field(None, nullable=True)
class EquipmentTop10(EquipmentBase):
id: UUID

Loading…
Cancel
Save