from odoo import models, fields
from fastapi import APIRouter
from typing import List


class FastapiEndpoint(models.Model):
    _inherit = "fastapi.endpoint"

    app = fields.Selection(
        selection_add=[("kyc", "KYC API")],
        ondelete={"kyc": "cascade"}
    )

    def _get_fastapi_routers(self) -> List[APIRouter]:
        if self.app == "kyc":
            from ..routers.kyc_api import router
            return [router]
        return super()._get_fastapi_routers()