- Rearranged imports in multiple files for consistency and clarity. - Updated logging middleware to exclude specific paths from logging. - Enhanced security module by cleaning up token handling and improving tenant validation. - Added tenant and company scoped mixins for better database model management. - Implemented generic CRUD routes for tenant-scoped resources. - Improved error handling and response management in API routes. - Cleaned up login and logout processes to ensure proper session management. - Introduced mechanisms to clear local storage and cookies on tenant change. - Enhanced company store to detect tenant changes and clear data accordingly. - Added new DTO mixins for currency and value affect flags.
37 lines
1.5 KiB
Python
37 lines
1.5 KiB
Python
from api.v1.common.base_models import TenantScopedMixin
|
|
from core.database import Base
|
|
from sqlalchemy import Column, ForeignKeyConstraint, String
|
|
|
|
|
|
class Transporter(Base, TenantScopedMixin):
|
|
__tablename__ = "transporter"
|
|
__table_args__ = (
|
|
ForeignKeyConstraint(
|
|
["tenant_id"], ["a76.tenants.id"], name="fk_transporter_tenants"
|
|
),
|
|
ForeignKeyConstraint(
|
|
["company_id"], ["a76.company.id"], name="fk_transporter_company"
|
|
),
|
|
{"schema": "a76"},
|
|
)
|
|
|
|
transporter_key = Column(String(5), primary_key=True, nullable=False)
|
|
name = Column(String(256), nullable=True)
|
|
short_name = Column(String(10), nullable=True)
|
|
responsible = Column(String(100), nullable=True)
|
|
rfc = Column(String(30), nullable=True)
|
|
streets = Column(String(100), nullable=True)
|
|
postal_code = Column(String(15), nullable=True)
|
|
city = Column(String(30), nullable=True)
|
|
state = Column(String(30), nullable=True)
|
|
country = Column(String(3), nullable=True)
|
|
loader_code = Column(String(9), nullable=True)
|
|
caat_code = Column(String(49), nullable=True)
|
|
transport_code = Column(String(8), nullable=True)
|
|
transport_interface_type = Column(String(20), nullable=True)
|
|
ftp_server = Column(String(200), nullable=True)
|
|
ftp_user = Column(String(200), nullable=True)
|
|
ftp_password = Column(String(100), nullable=True)
|
|
ftp_directory = Column(String(1000), nullable=True)
|
|
filler_code = Column(String(4), nullable=True)
|