Add new fields for tax and depreciation in receipt processing

- Introduced fields: receipt_location, calculated_tax, is_depreciable, cca_rate, useful_life, and residual_value in DBReceipt model.
- Updated process_document function to handle new receipt data attributes.
- Enhanced DocumentProcessResponse schema to include new fields.
- Updated document processing rules to incorporate tax calculation based on location and depreciation rules.
This commit is contained in:
bolade
2025-10-07 11:15:26 +01:00
parent 823c05f78d
commit d8315f13ac
5 changed files with 172 additions and 23 deletions
+6
View File
@@ -88,3 +88,9 @@ class DBReceipt(Base):
extraction_success = Column(String, nullable=True)
error_message = Column(String, nullable=True)
receipt_currency = Column(String, nullable=True)
receipt_location = Column(String, nullable=True)
calculated_tax = Column(Float, nullable=True)
is_depreciable = Column(String, nullable=True) # Store as string "True"/"False"
cca_rate = Column(Float, nullable=True)
useful_life = Column(Integer, nullable=True)
residual_value = Column(Float, nullable=True)