
    a$iM                        d dl mZ d dlmZmZmZmZmZmZm	Z	m
Z
mZmZ d dlmZ  G d de      Z G d de      Z G d d	e      Z G d
 de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d  d!e      Z G d" d#e      Z G d$ d%e      Z G d& d'e      Z G d( d)e      Z  G d* d+e      Z! G d, d-e      Z" G d. d/e      Z# G d0 d1e      Z$ G d2 d3e      Z% G d4 d5e      Z& G d6 d7e      Z' G d8 d9e      Z( G d: d;e      Z) G d< d=e      Z* G d> d?e      Z+ G d@ dAe      Z, G dB dCe      Z- G dD dEe      Z. G dF dGe      Z/ G dH dIe      Z0 G dJ dKe      Z1 G dL dMe      Z2 G dN dOe      Z3 G dP dQe      Z4 G dR dSe      Z5 G dT dUe      Z6 G dV dWe      Z7 G dX dYe      Z8 G dZ d[e      Z9 G d\ d]e      Z: G d^ d_e      Z; G d` dae      Z< G db dce      Z= G dd dee      Z> G df dge      Z?yh)i    )Base)
ColumnIntegerStringDateTimeDate
ForeignKeyFloatBooleanTextNumeric)datetimec                   t    e Zd ZdZ eed      Z e ed            Z e e	             Z
 e e	             Zy)AccountTypeModelaccount_typesTprimary_key   N)__name__
__module____qualname____tablename__r   r   idr   account_typer   
added_dateupdated_date     SC:\Users\jesus\OneDrive\Escritorio\proyecto_pie360\backend\app\backend\db\models.pyr   r      9    #M	T	*B&+&L
#J(*%Lr   r   c                      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            Z e ed            Z e ed            Z e ed            Z ee      Z e e             Z e ed            Z e ed            Z ee      Z e ed            Z e e             Zy)SettingModelsettingsTr   r   N)r   r   r   r   r   r   r   r   	tax_valueidentification_numberr   account_numberaccount_nameaccount_emailbankdelivery_costr   simplefactura_tokenshop_addresspayment_card_urlprepaid_discountphoner   r   r   r   r   r"   r"      s    M	T	*Bvc{#I"6#;/&+&LF3K(N&+&L6#;'M&+D7OM .&+&LfSk*g6#;E(*%Lr   r"   c                      e Zd ZdZ eed      Z e ed            Z ee      Z	 ee      Z
 e ed            Z e edd            Z e edd            Z e edd            Z e edd            Z e edd            Z e edd            Z e edd            Z e edd            Z e edd            Z e edd            Z e edd            Z e edd            Z e edd            Z e e             Z e edd            Z ee      Z e edd            Z ee      Z  e edd            Z! e e             Z" e e#             Z$ e e#             Z% ee      Z&y)	ShoppingModel	shoppingsTr   d   r   
      N)'r   r   r   r   r   r   r   r   shopping_numbersupplier_id	status_idemailr   totalmaritime_freightmerchandise_insurancemanifest_openingdeconsolidationland_freightport_charges
honorariesphysical_assessment_expensesadministrative_expensesdollar_valuefolder_processingvalija_expensesr   customs_company_supportwire_transfer_amountr   wire_transfer_date
commissionexchange_rateextra_expensespayment_supportr   r   r   prepaid_status_idr   r   r   r1   r1       s   M	T	*BVC[)O/KwI6#;E72q>"Egb!n-"72q>2gb!n-WR^,O'"a.)L'"a.)LA'J#)'"a.#9 $WR^4'"a.)Lwr1~.WR^,O$TVn!'"a.1A'J7OMGBN+NTVnO
#J(*%L wr   r1   c                       e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	 ee      Z
 e edd            Z e edd            Z ee      Z e edd            Z e edd            Z e e             Z e e             Zy)ShoppingProductModelshoppings_productsTr   r4   r5   N)r   r   r   r   r   r   r   shopping_id
product_idunit_measure_idquantityr   quantity_per_packageoriginal_unit_costdiscount_percentagefinal_unit_costamountr   r   r   r   r   r   rP   rP   B   s    (M	T	*B/KJWoOgH!'"a.1A/ /WR^,OGBN#F
#J(*%Lr   rP   c                       e Zd ZdZ eed      Z e ed            Z e ed            Z	 e e
             Z e e             Z e e             Zy)SupplierModel	suppliersTr   r   N)r   r   r   r   r   r   r   r   r%   supplierr   addressr   r   r   r   r   r   r\   r\   R   sS    M	T	*B"6#;/fSk"HTVnG
#J(*%Lr   r\   c                   t    e Zd ZdZ eed      Z e ed            Z e e	             Z
 e e	             Zy)UnitMeasureModelunit_measuresTr   r   N)r   r   r   r   r   r   r   r   unit_measurer   r   r   r   r   r   ra   ra   \   r    r   ra   c                   T   e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	 ee      Z
 eed      Z ee      Z ee      Z eed      Z ee      Z e e             Z e e             Z e e       ej,                        Z e e       ej,                        Zy)	SaleModelsalesTr   r   defaultN)r   r   r   r   r   r   r   customer_idshipping_method_iddte_type_idr8   folior
   subtotaltaxshipping_costr:   r   rM   delivery_addressr   r   nowr   r   r   r   r   re   re   d   s    M	T	*B/K/KwI7A&Ee}H
-C5!,M5METVnOdf~
HLL9J(*hll;Lr   re   c                       e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	 ee      Z
 ee      Z ee      Z ee      Zy)SaleProductModelsales_productsTr   N)r   r   r   r   r   r   r   sale_idrS   inventory_movement_idinventory_idlot_item_idrU   pricer   r   r   rs   rs   v   sS    $M	T	*BWoGJ"7O'?L/KgH7OEr   rs   c                   l   e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	 ee      Z
 ee      Z e e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            Z e e             Z e e             Zy)CustomerModel	customersTr   r   N)r   r   r   r   r   r   r   
country_id	region_id
commune_id
package_idbill_or_ticket_idr   r%   names	lastnamesr_   company_namer/   r9   r   r   r   r   r   r   r{   r{      s    M	T	*BJwIJJw"6#;/6#;Evc{#IVC[!G&+&L6#;E6#;E
#J(*%Lr   r{   c                   t    e Zd ZdZ eed      Z e ed            Z e e	             Z
 e e	             Zy)LocationModel	locationsTr   r   N)r   r   r   r   r   r   r   r   locationr   r   r   r   r   r   r   r      s9    M	T	*BfSk"H
#J(*%Lr   r   c                       e Zd ZdZ eed      Z e ed            Z e ed            Z	 e ed            Z
 e e             Z e e             Zy)CategoryModel
categoriesTr   r   N)r   r   r   r   r   r   r   r   categorypublic_namecolorr   r   r   r   r   r   r   r      sU     M	T	*BfSk"H%K6#;E
#J(*%Lr   r   c                       e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	 e e
d            Z e e
d            Z e e             Z e e             Zy)LiterFeatureModelliter_featuresTr   r   N)r   r   r   r   r   r   r   rS   rV   quantity_per_palletr   weight_per_literweight_per_palletr   r   r   r   r   r   r   r      sf    $M	T	*BJ!'? /fSk*vc{+
#J(*%Lr   r   c                       e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	 ee      Z
 e e             Z e e             Zy)PreInventoryStockModelpre_inventory_stocksTr   N)r   r   r   r   r   r   r   rS   rR   
lot_numberstockr   r   r   r   r   r   r   r      sO    *M	T	*BJ/KJ7OE
#J(*%Lr   r   c                       e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	 e e
d            Z e e
d            Z e e             Z e e             Zy)UnitFeatureModelunit_featuresTr   r   N)r   r   r   r   r   r   r   rS   rV   r   r   weight_per_unitr   r   r   r   r   r   r   r   r      se    #M	T	*BJ!'? /VC[)Ovc{+
#J(*%Lr   r   c                       e Zd ZdZ eed      Z e ed            Z ee      Z	 e e
             Z e e
             Zy)RegionModelregionsTr   r   N)r   r   r   r   r   r   r   r   regionregion_remuneration_coder   r   r   r   r   r   r   r      sC    M	T	*BF3K F%g
#J(*%Lr   r   c                      e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	 e e
d            Z e e
d            Z e e             Z e e             Z e e             Z e e             Z e e             Z e e             Z e e             Z ee      Z ee      Z e e             Z e e             Zy)ProductModelproductsTr   r   N)r   r   r   r   r   r   r   r7   category_idrT   r   codeproductr   rW   rX   rY   short_descriptiondescriptionphotocatalogis_compoundcompound_product_idr   r   r   r   r   r   r   r      s    M	T	*B/K/KWoO&+DVC[!G .TVnOtv.K46NETVnG/K /
#J(*%Lr   r   c                   "   e Zd ZdZ eed      Z ee      Z ee ed            Z	 ee      Z
 e ed            Z e ed            Z e ed            Z e ed            Z e ed            Z e e             Z e e             Zy)	UserModelusersTr   rols.idr   N)r   r   r   r   r   r   r   ri   r	   rol_iddeleted_status_idr   rut	full_namer9   r/   hashed_passwordr   r   r   r   r   r   r   r      s    M	T	*B/KGZ	23Fw

Cvc{#I6#;E6#;EVC[)O
#J(*%Lr   r   c                       e Zd ZdZ eed      Z ee      Z ee      Z e e	d            Z
 e e             Z e e             Zy)RolModelrolsTr   r   N)r   r   r   r   r   r   r   ri   r   r   rolr   r   r   r   r   r   r   r      sL    M	T	*B/Kw

C
#J(*%Lr   r   c                       e Zd ZdZ eed      Z e ed            Z ee      Z	 ee      Z
 e e             Z e e             Zy)PermissionModelpermissionsTr   r   N)r   r   r   r   r   r   r   r   
permissionpermission_type_idpermission_order_idr   r   r   r   r   r   r   r     sM    !M	T	*Bs$J /
#J(*%Lr   r   c                       e Zd ZdZ eed      Z ee ed            Z ee ed            Z	 e e
             Z e e
             Zy)RolPermissionModelrols_permissionsTr   r   zpermissions.idN)r   r   r   r   r   r   r   r	   r   permission_idr   r   r   r   r   r   r   r     sN    &M	T	*BGZ	23F7J/?$@AM
#J(*%Lr   r   c                       e Zd ZdZ eed      Z ee      Z e ed            Z	 e e
             Z e e
             Z ee      Zy)TeachingModel	teachingsTr   r   N)r   r   r   r   r   r   r   	school_idr   teaching_namer   r   r   r   r   r   r   r   r     sL    M	T	*BwI6#;'M
#J(*%Lwr   r   c                       e Zd ZdZ eed      Z ee      Z ee      Z e e	d            Z
 e e             Z e e             Zy)CourseModelcoursesTr   r   N)r   r   r   r   r   r   r   r   teaching_idr   course_namer   r   r   r   r   r   r   r     sK    M	T	*BwI/K%K
#J(*%Lr   r   c                       e Zd ZdZ eed      Z ee      Z e ed            Z	 e e
             Z e e
             Zy)CommuneModelcommunesTr   r   N)r   r   r   r   r   r   r   r~   r   communer   r   r   r   r   r   r   r   (  sB    M	T	*BwIVC[!G
#J(*%Lr   r   c                   T    e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	y)CustomerProductDiscountModelcustomers_products_discountsTr   N)
r   r   r   r   r   r   r   ri   rS   rX   r   r   r   r   r   1  s/    2M	T	*B/KJ /r   r   c                       e Zd ZdZ eedd      Z ee      Z ee      Z ee      Z	 ee      Z
 e e             Z e e             Zy)InventoryModelinventoriesTr   autoincrementN)r   r   r   r   r   r   r   rS   location_idminimum_stockmaximum_stockr   last_updater   r   r   r   r   r   9  sQ    !M	T	>BJ/K7OM7OM$K
#Jr   r   c                       e Zd ZdZ eedd      Z ee      Z e ed            Z	 e e
             Z e e             Z e e             Zy)LotModellotsTr   r   N)r   r   r   r   r   r   r   r7   r   r   r   arrival_dater   r   r   r   r   r   r   r   D  sO    M	T	>B/Ks$J$&>L
#J(*%Lr   r   c                       e Zd ZdZ eedd      Z ee      Z ee      Z ee      Z	 ee      Z
 ee      Z ee      Z e e             Z e e             Zy)LotItemModel	lot_itemsTr   N)r   r   r   r   r   r   r   lot_idrS   rU   	unit_costpublic_sale_priceprivate_sale_pricer   r   r   r   r   r   r   r   N  se    M	T	>BG_FJgHwIw
#J(*%Lr   r   c                       e Zd ZdZ eedd      Z ee ed            Z ee ed            Z	 ee      Z
 e e             Z e e             Zy)InventoryLotItemModelinventories_lotsTr   inventories.idzlots.idN)r   r   r   r   r   r   r   r	   rw   rx   rU   r   r   r   r   r   r   r   r   [  sY    &M	T	>B':.>#?@L*Y"78KgH
#J(*%Lr   r   c                   v    e Zd ZdZ eedd      Z e ed            Z e e	             Z
 e e	             Zy)MovementTypeModelmovement_typesTr   r   N)r   r   r   r   r   r   r   r   movement_typer   r   r   r   r   r   r   r   e  s;    $M	T	>B6#;'M
#J(*%Lr   r   c                       e Zd ZdZ eedd      Z ee ed            Z ee ed            Z	 ee ed            Z
 ee      Z ee      Z e e             Z e e             Zy)InventoryMovementModelinventories_movementsTr   r   zlot_items.idzmovement_types.idN)r   r   r   r   r   r   r   r	   rw   rx   movement_type_idrU   r   r   reasonr   r   r   r   r   r   r   m  st    +M	T	>B':.>#?@L*^"<=Kgz2E'FGgHwIDF^F
#Jr   r   c                       e Zd ZdZ eedd      Z ee ed            Z ee ed            Z	 ee      Z
 ee      Z e e             Z e e       ej                         Zy)InventoryAuditModelinventories_auditsTr   zusers.idr   rg   N)r   r   r   r   r   r   r   r	   user_idrw   previous_stock	new_stockr   r   r   r   rq   r   r   r   r   r   r   y  sg    (M	T	>BWj45G':.>#?@LG_NwIDF^F
HLL9Jr   r   c                       e Zd ZdZ eedd      Z ee ed            Z ee ed            Z	 e e
       ej                        Z e e
             Zy)SupplierCategoryModelsuppliers_categoriesTr   zsuppliers.idzcategories.idrg   N)r   r   r   r   r   r   r   r	   r7   r   r   r   rq   r   r   r   r   r   r   r     sU    *M	T	>B*^"<=K*_"=>K
HLL9J(*%Lr   r   c                       e Zd ZdZ eedd      Z ee ed            Z eed      Z	 eed      Z
 e e       ej                        Z e e       ej                        Zy)KardexValuesModelkardex_valuesTr   zproducts.idr   rg   N)r   r   r   r   r   r   r   r	   rS   rU   average_costr   r   rq   r   r   r   r   r   r  r    sb    #M	T	>BM!:;Jgq)H'1-L
HLL9J(*hll;Lr   r  c                   t    e Zd ZdZ eed      Z e ed            Z e e	             Z
 e e	             Zy)NativeLanguageProficiencyModelnative_language_proficienciesTr   r   N)r   r   r   r   r   r   r   r   native_language_proficiencyr   r   r   r   r   r   r  r    s:    3M	T	*B"("5
#J(*%Lr   r  c                       e Zd ZdZ eed      Z ee      Z e ed            Z	 e e
             Z e e
             Zy)FamilyMemberModelfamily_membersTr   r   N)r   r   r   r   r   r   r   r   r   family_memberr   r   r   r   r   r   r
  r
    sC    $M	T	*Bw6#;'M
#J(*%Lr   r
  c                       e Zd ZdZ eed      Z ee      Z e ed            Z	 e ed            Z
 e e             Z e ed            Z e e             Z e e             Zy)	NewsModelnewsTr   r   N)r   r   r   r   r   r   r   r   r   titler   r   r   imager   r   r   r   r   r   r  r    sk    M	T	*Bw6#;Evc{+.K6#;E
#J(*%Lr   r  c                       e Zd ZdZ eed      Z ee      Z e ed            Z	 e e
             Z e e
             Zy)NationalityModelnationalitiesTr   r   N)r   r   r   r   r   r   r   r   r   nationalityr   r   r   r   r   r   r  r    sC    #M	T	*Bw%K
#J(*%Lr   r  c                       e Zd ZdZ eed      Z ee      Z e ed            Z	 e e
             Z e e
             Zy)GenderModelgendersTr   r   N)r   r   r   r   r   r   r   r   r   genderr   r   r   r   r   r   r  r    sC    M	T	*BwF3K F
#J(*%Lr   r  c                       e Zd ZdZ eed      Z ee      Z e ed            Z	 e ed            Z
 e ed            Z e ed            Z e e             Z e e             Zy)SchoolModelschoolsTr   r   N)r   r   r   r   r   r   r   ri   r   school_nameschool_addressdirector_namecommunity_school_passwordr   r   r   r   r   r   r  r    sm    M	T	*B/K%KF3K(N6#;'M &vc{ 3
#J(*%Lr   r  c                       e Zd ZdZ eed      Z ee      Z ee      Z e e	d            Z
 e e             Z e e             Zy)StudentModelstudentsTr   r   N)r   r   r   r   r   r   r   r   r   r   r%   r   r   r   r   r   r   r"  r"    sM    M	T	*BwwI"6#;/
#J(*%Lr   r"  c                       e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	 ee      Z
 ee      Z ee      Zy)StudentAcademicInfoModelstudent_academic_dataTr   N)r   r   r   r   r   r   r   
student_idspecial_educational_need_id	course_idsip_admission_yearr   r   r   r   r   r   r%  r%    sM    +M	T	*BJ"(/wI!J(#Lr   r%  c                      e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	 ee      Z
 ee      Z ee      Z e e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            Z e ed            Z e ed            Z e ed            Z e ed            Z e ed            Z ee      Z ee      Zy)StudentPersonalInfoModelstudent_personal_dataTr   r   N)r   r   r   r   r   r   r   r'  r~   r   	gender_idproficiency_native_language_idproficiency_language_used_idr   r%   r   father_lastnamemother_lastnamesocial_name	born_dater  r_   r/   r9   native_languagelanguage_usually_usedr   r   r   r   r   r   r,  r,    s	   +M	T	*BJwIJwI%+G_"#)'? "6#;/6#;EVC[)OVC[)O%Kvc{#I%KVC[!G6#;E6#;EVC[)O"6#;/!J(#Lr   r,  c                   d    e Zd ZdZ eed      Z ee      Z ee      Z	 ee
      Z ee
      Zy)StudentDocumentModelbirth_certificatesTr   N)r   r   r   r   r   r   r   r'  r   birth_certificater   r   r   r   r   r   r8  r8     s:    (M	T	*BJt!J(#Lr   r8  c                   ,   e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	 e e
d            Z e e
d            Z e e
d            Z e e
d            Z ee      Z e e
d            Z e e
d            Z ee      Z ee      Zy)StudentGuardianModelstudent_guardiansTr   r   N)r   r   r   r   r   r   r   r'  family_member_idr.  r   r%   r   r1  r2  r   r4  r9   celphoner   r   r   r   r   r   r<  r<  	  s    'M	T	*BJgwI"6#;/6#;EVC[)OVC[)OtI6#;EfSk"H!J(#Lr   r<  c                      e Zd ZdZ eed      Z ee      Z ee      Z ee	      Z
 e ed            Z e ed            Z e ed            Z ee      Z e ed            Z e ed            Z ee      Z ee      Zy)ProfessionalModelprofessionalsTr   r   N)r   r   r   r   r   r   r   r   r   r   r%   r   r   r   r9   r   
birth_dater_   r/   r   r   r   r   r   r   rA  rA    s    #M	T	*BwIG_F"4L6#;Evc{#I6#;EJVC[!G6#;E!J(#Lr   rA  c                       e Zd ZdZ eed      Z ee      Z e ed            Z	 ee      Z
 ee      Z ee      Z ee      Zy)PackageModelpackagesTr   r   N)r   r   r   r   r   r   r   r   r   package_namestudents_per_packageprofessionals_per_packager   r   r   r   r   r   rE  rE  *  sS    M	T	*Bw&+&L!'? &w!J(#Lr   rE  c                   p    e Zd ZdZ eed      Z ee      Z e ed            Z	 ee
      Z ee
      Zy)SpecialEducationalNeedModelspecial_educational_needsTr   r   N)r   r   r   r   r   r   r   r   r   rL  r   r   r   r   r   r   rK  rK  5  s@    /M	T	*Bw &vc{ 3!J(#Lr   rK  c                   p    e Zd ZdZ eed      Z ee      Z e ed            Z	 ee
      Z ee
      Zy)DocumentTypeModeldocument_typesTr   r   Nr   r   r   r   r   r   r   document_type_idr   documentr   r   r   r   r   r   rN  rN  >  s?    $M	T	*BgfSk"H!J(#Lr   rN  c                   p    e Zd ZdZ eed      Z ee      Z e ed            Z	 ee
      Z ee
      Zy)DocumentModel	documentsTr   r   NrP  r   r   r   rT  rT  G  s?    M	T	*BgfSk"H!J(#Lr   rT  c                       e Zd ZdZ eed      Z ee      Z ee      Z e e	d            Z
 ee      Z ee      Zy)BirthCertificateDocumentModelbirth_certificate_documentsTr   r   N)r   r   r   r   r   r   r   r'  
version_idr   r:  r   r   r   r   r   r   rW  rW  P  sH    1M	T	*BJJvc{+!J(#Lr   rW  N)@app.backend.db.databaser   
sqlalchemyr   r   r   r   r   r	   r
   r   r   r   r   r   r"   r1   rP   r\   ra   re   rs   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r
  r  r  r  r  r"  r%  r,  r8  r<  rA  rE  rK  rN  rT  rW  r   r   r   <module>r\     sm   ( i i i &t &&4 && (D  (D&4 & &D &&t &< <$
t 
&D &&&D &&D &
& 
&	&T 	&
&t 
&&$ &&4 &*& &&t &&d && &(D (&$ &&4 &*4 *	$T 	$&t &&4 &&D && &
$T 
$	:$ 	:&D &< <&T && &
& 
&&t &&$ &
&$ 
&&4 &	$t 	$$t $2$4 $$4 $"$ $ 	$4 	$$$ $$ $$D $$D $r   