- Implemented SvelteKit frontend with authentication callback handling. - Created demo routes and paraglide localization functionality. - Added health check and entrypoint scripts for backend services. - Established PostgreSQL and Keycloak initialization scripts with health checks. - Introduced models for database schema using SQLAlchemy. - Configured Vite and SvelteKit for development and testing environments. - Added health check script to verify service statuses and resource usage. - Created Docker entrypoint scripts for seamless service startup.
168 lines
6.6 KiB
Python
168 lines
6.6 KiB
Python
from typing import List, Optional
|
|
|
|
from sqlalchemy import Boolean, Column, Date, DateTime, ForeignKeyConstraint, Index, Integer, PrimaryKeyConstraint, SmallInteger, String, Table, UniqueConstraint, text
|
|
from sqlalchemy.orm import Mapped, declarative_base, mapped_column, relationship
|
|
from sqlalchemy.orm.base import Mapped
|
|
|
|
Base = declarative_base()
|
|
metadata = Base.metadata
|
|
|
|
|
|
class Gdatosvu(Base):
|
|
__tablename__ = 'gdatosvu'
|
|
__table_args__ = (
|
|
PrimaryKeyConstraint('id_empageaadu', name='gdatosvu_pkey'),
|
|
)
|
|
|
|
id_empageaadu = mapped_column(String(10))
|
|
ruta_arch_cer = mapped_column(String(1500))
|
|
ruta_arch_key = mapped_column(String(1500))
|
|
clave_acceso_fiel = mapped_column(String(50))
|
|
usuario_webservice = mapped_column(String(100))
|
|
clave_acceso_webservice = mapped_column(String(100))
|
|
email_vu = mapped_column(String(800))
|
|
tipo_figura_vu = mapped_column(String(30))
|
|
ruta_vu_central = mapped_column(String(1500))
|
|
ruta_archivos_xml = mapped_column(String(1500))
|
|
rfc_consulta = mapped_column(String(30))
|
|
toma_configuracion_vu = mapped_column(String(30))
|
|
unidad_medida_vu = mapped_column(String(3))
|
|
rfc_validacion_vu = mapped_column(String(30))
|
|
ruta_archivo_cfdi = mapped_column(String(5000))
|
|
ruta_archivo_key_cfdi = mapped_column(String(5000))
|
|
fecha_venc_cer_cfdi = mapped_column(Date)
|
|
fecha_venc_key_cfdi = mapped_column(Date)
|
|
contrasena_cfdi = mapped_column(String(200))
|
|
ruta_guardar_xml = mapped_column(String(5000))
|
|
ruta_app_cfdi = mapped_column(String(5000))
|
|
ruta_app_pac = mapped_column(String(5000))
|
|
ruta_archivocancelacion = mapped_column(String(5000))
|
|
contrasena_cancelacion = mapped_column(String(200))
|
|
usuario_anam = mapped_column(String(100))
|
|
contrasena_anam = mapped_column(String(200))
|
|
fecha_creacion = mapped_column(DateTime, server_default=text('now()'))
|
|
fecha_actualizacion = mapped_column(DateTime)
|
|
|
|
|
|
class Gempresa(Base):
|
|
__tablename__ = 'gempresa'
|
|
__table_args__ = (
|
|
PrimaryKeyConstraint('id_emp', name='gempresa_pkey'),
|
|
UniqueConstraint('consecutivo', name='gempresa_consecutivo_key')
|
|
)
|
|
|
|
id_emp = mapped_column(String(3), server_default=text("'EMP'::character varying"))
|
|
consecutivo = mapped_column(Boolean, server_default=text('true'))
|
|
nombre = mapped_column(String(255))
|
|
rfc = mapped_column(String(30))
|
|
actpreponderante = mapped_column(String(255))
|
|
programa = mapped_column(String(10))
|
|
numeroprograma = mapped_column(String(40))
|
|
prosec = mapped_column(SmallInteger)
|
|
autorizacionprosec = mapped_column(String(20))
|
|
manufacterid = mapped_column(String(25))
|
|
broker_emp = mapped_column(String(10))
|
|
responsable = mapped_column(String(80))
|
|
respnombre = mapped_column(String(20))
|
|
resppaterno = mapped_column(String(20))
|
|
respmaterno = mapped_column(String(20))
|
|
rfcresponsable = mapped_column(String(30))
|
|
puesto = mapped_column(String(30))
|
|
logo = mapped_column(String(255))
|
|
tienelineaexpress = mapped_column(Boolean)
|
|
tipoformatoped = mapped_column(String(19))
|
|
codigoanterior = mapped_column(SmallInteger)
|
|
esempresaservicio = mapped_column(Boolean)
|
|
nombrecliente = mapped_column(String(300))
|
|
modosubmaquila = mapped_column(String(7))
|
|
curp = mapped_column(String(19))
|
|
nombrebdinter = mapped_column(String(100))
|
|
ctpat_svi = mapped_column(String(100))
|
|
numdeexportadorconfiable = mapped_column(String(50))
|
|
claveprevalidador = mapped_column(String(20))
|
|
septimaenmienda = mapped_column(Boolean)
|
|
fecha_creacion = mapped_column(DateTime, server_default=text('now()'))
|
|
fecha_actualizacion = mapped_column(DateTime)
|
|
|
|
gempresa_sucursales: Mapped[List['GempresaSucursales']] = relationship('GempresaSucursales', uselist=True, back_populates='gempresa')
|
|
|
|
class Gtiposfactura(Base):
|
|
__tablename__ = 'gtiposfactura'
|
|
__table_args__ = (
|
|
PrimaryKeyConstraint('clave', name='gtf_pkclave'),
|
|
)
|
|
|
|
clave = mapped_column(String(5))
|
|
descripcion = mapped_column(String(50))
|
|
observacion = mapped_column(String(500))
|
|
tipo_origen = mapped_column(String(15))
|
|
|
|
|
|
class Gtiposmoneda(Base):
|
|
__tablename__ = 'gtiposmoneda'
|
|
__table_args__ = (
|
|
PrimaryKeyConstraint('clave', name='tipmon_pkclave'),
|
|
)
|
|
|
|
clave = mapped_column(String(3))
|
|
moneda = mapped_column(String(15))
|
|
descpais = mapped_column(String(50))
|
|
|
|
|
|
class Gtipotransportes(Base):
|
|
__tablename__ = 'gtipotransportes'
|
|
__table_args__ = (
|
|
PrimaryKeyConstraint('clavetransporte', name='gtipotransportes_pkey'),
|
|
)
|
|
|
|
clavetransporte = mapped_column(String(2))
|
|
descripcion = mapped_column(String(100), nullable=False)
|
|
|
|
t_gempresa_certificacion = Table(
|
|
'gempresa_certificacion', metadata,
|
|
Column('id_empresa', String(3), nullable=False),
|
|
Column('esempresacertificada', Boolean),
|
|
Column('registroempcert', String(40)),
|
|
Column('fechainicialempcert', Date),
|
|
Column('fechafinalempcert', Date),
|
|
Column('fechacertificacionanexo31', Date),
|
|
Column('numerocertificacionanexo31', String(50)),
|
|
Column('modalidadanexo31', String(50)),
|
|
Column('tipoempresaanexo31', String(50)),
|
|
Column('empresaneec', Boolean),
|
|
Column('empresaoea', Boolean),
|
|
Column('empresarfe', Boolean),
|
|
Column('fecharenovacioncertificaciona31', Date),
|
|
Column('fechafinalcertificaciona31', Date),
|
|
Column('fecha_creacion', DateTime, server_default=text('now()')),
|
|
Column('fecha_actualizacion', DateTime),
|
|
ForeignKeyConstraint(['id_empresa'], ['gempresa.id_emp'], name='gempresa_certificacion_id_empresa_fkey')
|
|
)
|
|
|
|
|
|
class GempresaSucursales(Base):
|
|
__tablename__ = 'gempresa_sucursales'
|
|
__table_args__ = (
|
|
ForeignKeyConstraint(['id_empresa'], ['gempresa.id_emp'], name='gempresa_sucursales_id_empresa_fkey'),
|
|
PrimaryKeyConstraint('id_sucursal', name='gempresa_sucursales_pkey')
|
|
)
|
|
|
|
id_empresa = mapped_column(String(3), nullable=False)
|
|
id_sucursal = mapped_column(Integer)
|
|
indicador = mapped_column(String(25))
|
|
calle = mapped_column(String(255))
|
|
num_ext = mapped_column(String(70))
|
|
num_int = mapped_column(String(70))
|
|
codigo_postal = mapped_column(String(15))
|
|
colonia = mapped_column(String(50))
|
|
ciudad = mapped_column(String(50))
|
|
municipio = mapped_column(String(50))
|
|
estado = mapped_column(String(40))
|
|
pais = mapped_column(String(5))
|
|
telefono = mapped_column(String(30))
|
|
email = mapped_column(String(100))
|
|
fecha_creacion = mapped_column(DateTime, server_default=text('now()'))
|
|
fecha_actualizacion = mapped_column(DateTime)
|
|
|
|
gempresa: Mapped['Gempresa'] = relationship('Gempresa', back_populates='gempresa_sucursales')
|