
    i;                     H    d Z ddlmZ ddlZddlmZ dZdZdZ	dZ
d	dZd	dZy)
u  Dual teller readings and new threshold fields.

Replaces:
  - master_spbu.losses_threshold_liter
    → losses_threshold_penerimaan_pct (default 0.150)
    → losses_threshold_penjualan_pct  (default 0.500)
    → teller_discrepancy_threshold_pct (default 0.300)

  - master_spbu_nozzle.teller_terakhir
    → teller_terakhir_manual
    → teller_terakhir_digital
    + primary_teller VARCHAR(10) DEFAULT 'manual'

  - penjualan_nozzle.teller_awal / teller_akhir
    → teller_awal_manual / teller_akhir_manual
    → teller_awal_digital / teller_akhir_digital

Revision ID: d4e5f6a1b2c3
Revises: c3d4e5f6a1b2
Create Date: 2026-04-02
    )opN)
postgresqld4e5f6a1b2c3c3d4e5f6a1b2c            
         t        j                  dt        j                  dt        j                  dd      dd             t        j                  dt        j                  d	t        j                  dd      dd
             t        j                  dt        j                  dt        j                  dd      dd             t        j
                  dd       t        j                  dt        j                  dt        j                  dd      d             t        j                  dt        j                  dt        j                  dd      d             t        j                  dt        j                  dt        j                  d      dd             t        j                  d       t        j
                  dd       t        j                  dt        j                  dt        j                  dd      d             t        j                  dt        j                  dt        j                  dd      d             t        j                  dt        j                  dt        j                  dd      d             t        j                  dt        j                  dt        j                  dd      d             t        j                  d       t        j                  ddd       t        j                  ddd       t        j                  ddd       t        j                  ddd       t        j
                  dd        t        j
                  dd!       y )"Nmaster_spbulosses_threshold_penerimaan_pct      	precisionscaleFz0.150nullableserver_defaultlosses_threshold_penjualan_pctz0.500 teller_discrepancy_threshold_pctz0.300losses_threshold_litermaster_spbu_nozzleteller_terakhir_manual   Tr   teller_terakhir_digitalprimary_teller
   )lengthmanualzFUPDATE master_spbu_nozzle SET teller_terakhir_manual = teller_terakhirteller_terakhirpenjualan_nozzleteller_awal_manualteller_akhir_manualteller_awal_digitalteller_akhir_digitalz
        UPDATE penjualan_nozzle
        SET teller_awal_manual   = teller_awal,
            teller_akhir_manual  = teller_akhir,
            teller_awal_digital  = 0,
            teller_akhir_digital = 0
    teller_awalteller_akhir)	r   
add_columnsaColumnNumericdrop_columnStringexecutealter_column     ^/var/www/html/spbu.com/backend/alembic/versions/d4e5f6a1b2c3_dual_teller_and_new_thresholds.pyupgrader1   !   s   MM-)


Qa(	"  MM-(


Qa(	"  MM-*


Qa(	"  NN=":; MM&		 


Rq)) 
 MM&		!


Rq)) 
 MM&		
			)  JJP NN'):; MM$bii


Rq)' 
 MM$bii


Rq)' 
 MM$bii


Rq)' 
 MM$bii


Rq)'  JJ  	 OO&(<uMOO&(=NOO&(=NOO&(>ONN%}5NN%~6r/   c            
      z   t        j                  dt        j                  dt        j                  dd      d             t        j                  dt        j                  dt        j                  dd      d             t        j
                  d	       t        j                  ddd
       t        j                  ddd
       t        j                  dd       t        j                  dd       t        j                  dd       t        j                  dd       t        j                  dt        j                  dt        j                  dd      d             t        j
                  d       t        j                  dd       t        j                  dd       t        j                  dd       t        j                  dt        j                  dt        j                  dd      d
d             t        j                  dd       t        j                  dd       t        j                  dd       y )Nr   r$   r   r   r   Tr   r%   z
        UPDATE penjualan_nozzle
        SET teller_awal  = teller_awal_manual,
            teller_akhir = teller_akhir_manual
    Fr    r!   r"   r#   r   r   zFUPDATE master_spbu_nozzle SET teller_terakhir = teller_terakhir_manualr   r   r   r   r   z50.000r   r	   r   r   )r   r&   r'   r(   r)   r,   r-   r*   r.   r/   r0   	downgrader3   t   s   MM$biirzzBa84'  MM$bii

Rq9D'  JJ  	
 OO&FOO&GNN%';<NN%'<=NN%'<=NN%'=> MM&		2::!<t)  JJP NN')ABNN')BCNN')9: MM- 


Rq)	"  NN="CDNN="BCNN="DEr/   )returnN)__doc__alembicr   
sqlalchemyr'   sqlalchemy.dialectsr   revisiondown_revisionbranch_labels
depends_onr1   r3   r.   r/   r0   <module>r=      s6   ,   *
P7f(Fr/   