klg-asutk-app/backend/app/db/seed_legal.py
Yuriy 0150aba4f5 Consolidation: KLG ASUTK + PAPA integration
- Unify API: lib/api.ts uses /api/v1, inbox uses /api/inbox (rewrites)
- Remove localhost refs: openapi, inbox page
- Add rewrites: /api/inbox|tmc -> inbox-server, /api/v1 -> FastAPI
- Add stub routes: knowledge/insights, recommendations, search, log-error
- Transfer from PAPA: prompts (inspection, tmc), scripts, supabase, data/tmc-requests
- Fix inbox-server: ORDER BY created_at, package.json
- Remove redundant app/api/inbox/files route (rewrites handle it)
- knowledge/ in gitignore (large PDFs)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 17:18:31 +03:00

37 lines
1.9 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""
Начальное заполнение справочников для модуля юридических документов:
юрисдикции (страны/регионы). Запуск: python -m app.db.seed_legal
"""
from app.db.session import SessionLocal
from app.models import Jurisdiction
JURISDICTIONS = [
{"code": "RU", "name": "Russian Federation", "name_ru": "Российская Федерация", "description": "Законодательство РФ"},
{"code": "KZ", "name": "Republic of Kazakhstan", "name_ru": "Республика Казахстан", "description": "Законодательство РК"},
{"code": "BY", "name": "Republic of Belarus", "name_ru": "Республика Беларусь", "description": "Законодательство РБ"},
{"code": "EU", "name": "European Union", "name_ru": "Европейский союз", "description": "Право ЕС (директивы, регламенты)"},
{"code": "US", "name": "United States", "name_ru": "США", "description": "Федеральное и штатное право США"},
{"code": "US-CA", "name": "California (US)", "name_ru": "Калифорния (США)", "description": "Право штата Калифорния"},
{"code": "ICAO", "name": "ICAO", "name_ru": "ИКАО", "description": "Стандарты и рекомендуемая практика ИКАО"},
{"code": "EASA", "name": "EASA", "name_ru": "ЕАСА", "description": "Европейское агентство авиационной безопасности"},
]
def seed_jurisdictions():
db = SessionLocal()
try:
for j in JURISDICTIONS:
if db.query(Jurisdiction).filter(Jurisdiction.code == j["code"]).first():
continue
db.add(Jurisdiction(**j))
db.commit()
finally:
db.close()
if __name__ == "__main__":
seed_jurisdictions()
print("Legal jurisdictions seeded.")