- 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.
18 lines
780 B
Python
18 lines
780 B
Python
from sqlalchemy import String, SmallInteger, PrimaryKeyConstraint
|
|
from sqlalchemy.orm import mapped_column, Mapped
|
|
from core.database import Base
|
|
|
|
class Sector(Base):
|
|
__tablename__ = "sectors" #GSectores
|
|
__table_args__ = (
|
|
PrimaryKeyConstraint("key", name="sectors_pkey"),
|
|
{"schema": "public"} # opcional
|
|
)
|
|
|
|
key: Mapped[str] = mapped_column(String(8), nullable=False) # clave del sector
|
|
description: Mapped[str] = mapped_column(String(150), nullable=False) # descripción oficial (en español)
|
|
authorized: Mapped[SmallInteger] = mapped_column(SmallInteger) # 1 = autorizado, 0 = no autorizado
|
|
|
|
def __repr__(self):
|
|
return f"<Sector(key={self.key}, description={self.description}, authorized={self.authorized})>"
|