
    j                     `    d Z ddlmZmZmZmZmZmZmZm	Z	 ddl
mZ  e       Z G d de      Zy)u  
StagedTransactionModel — operates against a SEPARATE staging database.

Architecture note (Epic 9):
  - staging_pipeline.py opens instance/import_staging.db with a separate SQLAlchemy
    engine bound to this model's StagingBase (not the main db).
  - This model is intentionally NOT imported in app/models/__init__.py — it must NOT
    appear in the main Flask-Migrate migrations.
  - staged_txn_to_model() in staging_pipeline.py converts the StagedTransaction
    dataclass to StagedTransactionModel for persistence in the staging DB.
  - On successful user commit: rows are promoted to Transaction (main DB).
  - On abandon or error: staging DB is wiped; no main DB debris.
    )ColumnIntegerTextNumericBooleanFloatDateTimeString)declarative_basec                   r   e Zd ZdZ eed      Z eed      Z eed      Z	 eed      Z
 e edd      d      Z eedd      Z e ed	      d      Z eed      Z e ed
      d      Z eed      Z eed      Z eed      Z eed      Z eed      Z e ed      dd      Zy)StagedTransactionModelstaged_transactionsT)primary_keyF)nullable
      )r   defaultd   @      pendingN)__name__
__module____qualname____tablename__r   r   idr   datemerchant_rawmerchant_normalizedr   amountr   	is_creditr
   issuerr   confidence_score
dedup_hashraw_textimport_batch_idcategory_id
account_idr	   committed_atstatus     9/var/www/html/financials/app/models/staged_transaction.pyr   r      s    )M	T	*B$'D$/L 6GBNU3Fw>IF3K$/Fed3r
T2JdT*H Wt4O40K$/J(T2LF2J	BFr,   r   N)__doc__
sqlalchemyr   r   r   r   r   r   r	   r
   sqlalchemy.ormr   StagingBaser   r+   r,   r-   <module>r2      s/    X W W + C[ Cr,   