+
    |w¼j\  ã                   ó¸   € R t ^ RIHt ^ RIt^ RIHt ^ RIHt ^ RIH	t
 ^ RIH	t ^ RIHtHt ^ RIHtHtHtHt ^ RIHt ] ! R	 R
4      4       tR R ltR R ltR# )a8  Automatic subscriber access synchronization owned by the billing module.

Billing remains usable when no device is configured, but every payment/suspend
operation attempts the assigned MikroTik directly when credentials are present.
Secrets are decrypted only in memory and are never returned to templates/logs.
)Ú	dataclassN)ÚAsyncSession)Údecrypt_pppoe_password)Údecrypt_secret)ÚRealMikrotikAdapterÚMikrotikProvisioningError)ÚCustomerÚDeviceCredentialÚMikrotikConfigÚMikrotikDevice)Úselectc                   ó,   a € ] tR t^t o V 3R ltRtV tR# )ÚAccessSyncResultc                ó2   <€ V ^8„  d   Qh/ S[ ;R&   S[ ;R&   # )é   ÚstatusÚmessage)Ústr)ÚformatÚ__classdict__s   "€Ú0/var/www/html/bestweb/app/core/billing_access.pyÚ__annotate__ÚAccessSyncResult.__annotate__   s   ø‡ ‚ á�Kñ ñ �Lò ó    © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r      s   ø‡ ‡ „ r   r   c                ó0   € V ^8„  d   QhR\         R\        /# )r   ÚcustomerÚdb)r   r   )r   s   "r   r   r      s   € ÷ ñ ¬(ð ¼ñ r   c              ƒ  óš  "  € \        V RR4      pV'       dÝ   VP                  \        V4      G Rj  x€L
 pV'       d%   VP                  '       d   VP                  '       g   R# VP                  \
        VP                  4      G Rj  x€L
 pV'       d   VP                  '       g   R# \        VP                  VP                  \        VP                  4      VP                  ;'       g    RR7      R3# VP                  \        \        4      P                  ^4      4      G Rj  x€L
 P!                  4       pV'       d7   VP                  '       d%   VP                  '       d   VP"                  '       g   R# \        VP                  VP                  \%        VP"                  4      VP                  ;'       g    RR7      R3#  EL’ EL? L¤5i)zCResolve assigned device first, then the billing-wide legacy config.Úmikrotik_device_idNi"  )ÚhostÚusernameÚpasswordÚapi_port)NzGDevice MikroTik pelanggan belum aktif atau credential belum ditetapkan.)Nz*Credential MikroTik pelanggan belum aktif.)NzaMikroTik belum dikonfigurasi di Billing. Pembayaran tersimpan; sinkronisasi menunggu konfigurasi.)ÚgetattrÚgetr   Ú	is_activeÚcredential_idr	   r   r'   r(   Údecrypt_device_secretÚencrypted_secretr*   Úexecuter   r
   ÚlimitÚscalar_one_or_noner)   Údecrypt_legacy_secret)r#   r$   r&   ÚdeviceÚ
credentialÚconfigs   &&    r   Ú_adapter_for_customerr8      s\  é € ä  Ð+?ÀÓFÐßØ—v‘vœnÐ.@ÓA×Aˆß˜V×-×-Ð-°V×5I×5IÐ5IØbÐbØŸ6™6Ô"2°F×4HÑ4HÓI×Iˆ
ß ×!5×!5Ð!5ØEÐEÜ"Ø—‘Ø×(Ñ(Ü*¨:×+FÑ+FÓGØ—_‘_×,Ð,¨ô	
ð
 ðð 	ð —J‘Jœv¤nÓ5×;Ñ;¸AÓ>Ó?×?×SÑSÓU€Fß˜ŸŸ˜¨F¯O¯O¨OÀ6Ç?Ç?À?ØxÐxÜØ�[‰[Ø—‘Ü& v§¡Ó7Ø—‘×(Ð( Dô	ð
 ðð ò! Bò Jñ @ùsv   ‚/G±G²G¾GÁGÁ"%GÂGÂGÂGÂ&AGÃ*:GÄ$G	Ä%GÄ?GÅGÅ#GÅ5AGÆ9GÇGÇ	Gc                óH   € V ^8„  d   QhR\         R\        R\        R\        /# )r   r#   r$   ÚenabledÚreturn)r   r   Úboolr   )r   s   "r   r   r   6   s0   € ÷ dñ d¬ð d´|ð dÔQUð dÔZjñ dr   c             ƒ  ój  "  € V P                   '       d   V P                  '       g   \        RR4      #  \        W4      G Rj  x€L
 w  r4T'       d   \        RT4      #  \        T P                  4      pT'       d…   \        P                  ! TP                  T P                  4      G Rj  x€L
 w  rg\        P                  ! TP                  T P                   YV4      G Rj  x€L
  T'       d   RMRp\        R	R
T 24      # \        P                  ! TP                  T P                   R4      G Rj  x€L
  \        R	R4      #  Lü  \         d    \        RR4      u # i ; i L´ L€ L3  \         d*   p	\        RR\        T	4      R,           24      u Rp	?	# Rp	?	i\         d    \        RR4      u # i ; i5i)z7Enable/disable a PPPoE secret as a billing side effect.ÚblockedzBData PPPoE pelanggan belum lengkap; sinkronisasi tidak dijalankan.NÚfailedzDCredential MikroTik tidak dapat dibaca; periksa konfigurasi Billing.Úpendingz> Profile default dipakai karena profile paket tidak ditemukan.Ú Úsyncedz-Akses PPPoE diaktifkan otomatis dari Billing.Fz0Akses PPPoE dinonaktifkan otomatis dari Billing.zSinkronisasi MikroTik gagal: :Ni,  Nz6Sinkronisasi MikroTik gagal karena kesalahan internal.)Úpppoe_usernameÚpppoe_passwordr   r8   Ú	Exceptionr   ÚasyncioÚ	to_threadÚresolve_profileÚservice_profileÚupsert_pppoe_secretÚset_pppoe_secret_enabledr   r   )
r#   r$   r:   ÚadapterÚproblemr)   ÚprofileÚfallbackÚsuffixÚexcs
   &&$       r   Úsync_customer_accessrR   6   s…  é € à×"×"Ð"¨(×*A×*AÐ*AÜ 	Ð+oÓpÐpðrÜ!6°xÓ!D×DÑˆ÷ Ü 	¨7Ó3Ð3ðdÜ)¨(×*AÑ*AÓBˆßÜ&-×&7Ò&7¸×8OÑ8OÐQY×QiÑQiÓ&j× jÑˆGÜ×#Ò# G×$?Ñ$?À×AXÑAXÐZbÓl×lÐlßYaÑUÐgiˆFÜ# HÐ0]Ð^dÐ]eÐ.fÓgÐgÜ×Ò × @Ñ @À(×BYÑBYÐ[`Óa×aÐaÜ Ð*\Ó]Ð]ñ EøÜô rÜ Ð*pÓqÒqðrúñ !kÙlñ 	bøä$ô \Ü Ð,IÌ#ÈcË(ÐSWÍ.ÐIYÐ*ZÓ[Õ[ûÜô dÜ Ð*bÓcÒcðdüsÐ   ‚$F3§F3´E ÁD?ÁE Á	F3ÁF3ÁAE$ Â)EÂ*5E$ ÃE Ã E$ Ã,E$ Ã>F3Ã?/E$ Ä.E"Ä/E$ Ä>F3Ä?E ÅEÅF3ÅEÅF3ÅE$ Å E$ Å"E$ Å$F0Å/FÆF0ÆF3ÆF0Æ F0Æ-F3Æ/F0Æ0F3)Ú__doc__Údataclassesr   rF   Úsqlalchemy.ext.asyncior   Úapp.core.customer_identityr   Úapp.core.device_credentialsr   r/   Úapp.core.secretsr4   Úapp.core.mikrotikr   r   Úapp.models.modelsr   r	   r
   r   Ú
sqlalchemyr   r   r8   rR   r   r   r   Ú<module>r\      sN   ðñõ "Û å /å =Ý OÝ Dß Lß XÓ XÝ ð ÷ð ó ðõ
÷8dr   