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:
@@ -173,6 +173,20 @@ class DocumentProcessResponse(BaseModel):
|
||||
confidence: Optional[float] = None
|
||||
error: Optional[str] = None
|
||||
receipt_currency: Optional[str] = "CAD"
|
||||
receipt_location: Optional[str] = (
|
||||
None # Location from receipt (e.g., "Ontario, Canada" or "California, USA")
|
||||
)
|
||||
calculated_tax: Optional[float] = None # Calculated sales tax if not clearly shown
|
||||
is_depreciable: Optional[bool] = None # Whether item is a depreciable asset
|
||||
cca_rate: Optional[float] = (
|
||||
None # CCA rate for tax depreciation (e.g., 0.30 for 30%)
|
||||
)
|
||||
useful_life: Optional[int] = (
|
||||
None # Useful life in years for straight-line depreciation
|
||||
)
|
||||
residual_value: Optional[float] = (
|
||||
None # Residual value for straight-line depreciation
|
||||
)
|
||||
|
||||
|
||||
# New tax-related models
|
||||
|
||||
Reference in New Issue
Block a user