from odoo import models, fields


class FastAPIEndpoint(models.Model):
    _inherit = 'fastapi.endpoint'

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

    def _get_fastapi_routers(self):
        routers = super()._get_fastapi_routers()
        if self.app == 'partners':
            from ..routers.partners_api import router
            routers.append(router)
        return routers
