o
    di9                     @   sl   d dl mZ d dlmZmZmZ d dl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dS )    )models)VehicleMakeManagerVehicleModelMasterManagerVehicleInsuranceManager)DocumentsPath)	BaseModelc                   @   sL   e Zd ZdZejddddZejej	ddZ
e ZG dd dZdd	 Zd
S )VehicleMakeMasteraC  
    This is the VehicleMakeMaster model.
    It represents system vehicle makers.

    Attributes:
        name (CharField): The name of the vehicle maker.
        logo (FileField): The logo associated with the vehicle maker.

    Meta:
        db_table (str): The database table name for the VehicleMakeMaster model.
    FT)nullblankunique)	upload_tor	   c                   @      e Zd ZdZdS )zVehicleMakeMaster.MetaZvehicle_make_masterN__name__
__module____qualname__db_table r   r   N/var/www/html/evchargy.com/django-station-ev/station_ev/apps/vehicle/models.pyMeta       r   c                 C      | j  S Nnameselfr   r   r   __str__!      zVehicleMakeMaster.__str__N)r   r   r   __doc__r   	CharFieldr   	FileFieldr   get_vehicle_make_pathlogor   objectsr   r   r   r   r   r   r      s    r   c                   @   s`   e Zd ZdZejdddZejeej	ddZ
ejdej	ddd	Ze ZG d
d dZdd ZdS )VehicleModelMasteras  
    This is the VehicleModel model.
    It represents the system vehicle models of a specific vehicle maker.

    Attributes:
        name (CharField): The name of the vehicle model.
        vehicle_make (ForeignKey): A foreign key reference to the associated VehicleMakeMaster.

    Meta:
        db_table (str): The database table name for the VehicleModel model.
    F)r	   r
   Zvehicle_model_makes	on_deleterelated_namezmaster.ConnectorMasterZvehicle_model_connectorsT)r'   r(   r	   c                   @   r   )zVehicleModelMaster.MetaZvehicle_model_masterNr   r   r   r   r   r   ?   r   r   c                 C   r   r   r   r   r   r   r   r   B   r   zVehicleModelMaster.__str__N)r   r   r   r   r   r    r   
ForeignKeyr   CASCADEvehicle_make	connectorr   r$   r   r   r   r   r   r   r%   %   s    r%   c                   @   s   e Zd ZdZejdejddZejdejddZej	ddd	Z
ejd
ejddZe Ze ZejejdZe ZG dd dZdS )VehicleInsuranceai  
    Model class for representing vehicle insurances.

    This model represents VehicleInsurance instances with fields for 'user_vehicle',
    'insurance_company', 'insurance_type', 'user', 'start_date', 'end_date', and 'policy'.

    Attributes:
        user_vehicle: ForeignKey to the UserVehicle model, establishing a relationship.
        insurance_company: ForeignKey to the InsuranceCompanyMaster model, establishing a relationship.
        insurance_type: ForeignKey to the InsuranceTypeMaster model, establishing a relationship.
        user: ForeignKey to the User model, establishing a relationship.
        start_date: The start date of the insurance coverage.
        end_date: The end date of the insurance coverage.
        policy: FileField for storing the insurance policy file.
        objects: Custom manager for querying VehicleInsurance instances.
    zaccount.UserVehicleZuser_vehicle_insurancesr&   zmaster.InsuranceCompanyMasterZinsurance_company_insuranceszmaster.InsuranceTypeMasterZinsurance_type_insurances)r(   zaccount.UserZuser_insurances)r   c                   @   r   )zVehicleInsurance.MetaZvehicle_insuranceNr   r   r   r   r   r   q   r   r   N)r   r   r   r   r   r)   r*   user_vehicleinsurance_companyManyToManyFieldZinsurance_typesuser	DateField
start_dateend_dater!   r   get_vehicle_insurance_pathpolicyr   r$   r   r   r   r   r   r-   F   s4    r-   N)	django.dbr   Z&apps.vehicle.managers.vehicle_managersr   r   r   base.documents_pathr   base.modelsr   r   r%   r-   r   r   r   r   <module>   s    !