feat(api-gateway): add Odoo config model and endpoints

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Claude AI
2026-01-29 22:19:17 +00:00
parent c50459755a
commit d2ce86bd41
5 changed files with 118 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ from app.models.queue import Queue, QueueAgent, AssignmentMethod
from app.models.quick_reply import QuickReply
from app.models.global_variable import GlobalVariable
from app.models.flow_template import FlowTemplate
from app.models.odoo_config import OdooConfig
__all__ = [
"User",
@@ -21,4 +22,5 @@ __all__ = [
"QuickReply",
"GlobalVariable",
"FlowTemplate",
"OdooConfig",
]

View File

@@ -0,0 +1,19 @@
import uuid
from datetime import datetime
from sqlalchemy import Column, String, Boolean, DateTime, Text
from sqlalchemy.dialects.postgresql import UUID
from app.core.database import Base
class OdooConfig(Base):
__tablename__ = "odoo_config"
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
url = Column(String(255), nullable=False, default="")
database = Column(String(100), nullable=False, default="")
username = Column(String(255), nullable=False, default="")
api_key_encrypted = Column(Text, nullable=True)
is_active = Column(Boolean, default=True)
last_sync_at = Column(DateTime, nullable=True)
created_at = Column(DateTime, default=datetime.utcnow)
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)