o
    Ah                     @   s   d dl mZmZmZmZ d dlmZmZ d dlm	Z	 G dd deZ
G dd deZG dd	 d	eZG d
d deZG dd deZG dd deZdS )    )	BaseModelFieldHttpUrlfield_validator)OptionalLiteral)datec                   @   s   e Zd ZU edddZeed< edddZeed< edddZe	e ed	< edd
dZ
eed< edddZeed< edddZeed< dS )PlanOverview.z/Name of the subscription plan, e.g., 'Pro Plan'description	plan_namez5Internal identifier for the plan, e.g., 'plan_ABC123'plan_idNz Optional description of the planplan_descriptionz%Start date of the subscription period
start_datez#End date of the subscription periodend_datez/Flag indicating if the plan is currently active	is_active)__name__
__module____qualname__r   r   str__annotations__r   r   r   r   r   r   r   bool r   r   ?/var/www/html/moveengine/app/v1/models/platform/subscription.pyr	      s   
 r	   c                   @   s^   e Zd ZU edddZeed< edddZeed< edddZeed< edd	dZ	eed
< dS )UsageLimits.zMaximum number of users allowedr
   	max_usersz!Maximum number of devices allowedmax_devicesz#Maximum number of geofences allowedmax_geofencesz'Maximum number of tasks allowed per daymax_tasks_per_dayN)
r   r   r   r   r   intr   r   r   r   r   r   r   r   r      s
   
 r   c                   @   sN   e Zd ZU edddZeed< edddZed ed< edddZ	e
ed	< d
S )RenewalPreferences.z$Whether the subscription auto-renewsr
   auto_renewalzCycle of renewal)monthlyyearly	quarterlyrenewal_cyclez+Days before expiry to send renewal reminderreminder_daysN)r   r   r   r   r!   r   r   r%   r   r&   r   r   r   r   r   r       s   
 r    c                   @   s   e Zd ZU edddZee ed< edddZee	 ed< edddZ
ee	 ed< edd	dZee ed
< edddddd Zed
dddd ZdS )InvoiceInfoNzID of the last invoicer
   last_invoice_idzDate of the last invoicelast_invoice_datezExpected date for next invoicenext_invoice_datez URL to download the last invoicedownload_invoice_urlbefore)modec                 C      |pd S Nr   clsvr   r   r   validate_optional_date"      z"InvoiceInfo.validate_optional_datec                 C   r.   r/   r   r0   r   r   r   validate_optional_url&   r4   z!InvoiceInfo.validate_optional_url)r   r   r   r   r(   r   r   r   r)   r   r*   r+   r   r   r3   r5   r   r   r   r   r'      s   
 

r'   c                   @   s   e Zd ZU edddZeed< edZee ed< edZ	ee ed< edZ
ee ed< edZee ed	< edd
d ZdS )PaymentMode.zMode of paymentr
   payment_modeNstripe_customer_idbank_account_name	bank_iban	bank_namec                 C   s    |dkrdS |dvrt d|S )Nbankbank_transfer)striper=   z0payment_mode must be 'stripe' or 'bank_transfer')
ValueError)r1   valuer   r   r   validate_payment_mode2   s
   z!PaymentMode.validate_payment_mode)r   r   r   r   r7   r   r   r8   r   r9   r:   r;   r   rA   r   r   r   r   r6   +   s   
 r6   c                   @   sr   e Zd ZU edddZeed< edddZeed< edddZ	e
ed< edd	dZeed
< edddZeed< dS )SubscriptionSettings.z#Details about the subscription planr
   plan_overviewz Limits related to resource usageusage_limitszSettings for auto-renewalrenewal_preferenceszInvoice-related informationinvoice_infozPayment method detailspaymentN)r   r   r   r   rC   r	   r   rD   r   rE   r    rF   r'   rG   r6   r   r   r   r   rB   ;   s   
 rB   N)pydanticr   r   r   r   typingr   r   datetimer   r	   r   r    r'   r6   rB   r   r   r   r   <module>   s    	