diff --git a/models/LifeInsuranceAdjudicationItem.v1.json b/models/LifeInsuranceAdjudicationItem.v1.json new file mode 100755 index 0000000..9e019a9 --- /dev/null +++ b/models/LifeInsuranceAdjudicationItem.v1.json @@ -0,0 +1,34 @@ +{ + "title": "LifeInsuranceAdjudicationItem", + "x-stoplight": { + "id": "l2blqkdfsa5zq" + }, + "description": "Représente une opération d'arbitrage sur un contrat d'assurance vie, depuis ou vers le fonds euros.", + "type": "object", + "properties": { + "type": { + "default": "FROM_EURO_FUNDS", + "description": "Type d'arbitrage.", + "type": "string", + "enum": [ + "FROM_EURO_FUNDS", + "TO_EURO_FUNDS" + ] + }, + "amount": { + "description": "Montant de l'arbitrage.", + "minimum": 0, + "type": "number" + }, + "date": { + "description": "Date de l'arbitrage.", + "format": "date-time", + "type": "string" + } + }, + "required": [ + "type", + "amount", + "date" + ] +} \ No newline at end of file diff --git a/models/LifeInsuranceAdvanceItem.v1.json b/models/LifeInsuranceAdvanceItem.v1.json new file mode 100755 index 0000000..9291bac --- /dev/null +++ b/models/LifeInsuranceAdvanceItem.v1.json @@ -0,0 +1,37 @@ +{ + "title": "LifeInsuranceAdvanceItem", + "x-stoplight": { + "id": "0b9xa584a6b3a" + }, + "description": "Représente une avance sur un contrat d'assurance vie", + "type": "object", + "properties": { + "amount": { + "description": "Montant de l'avance.", + "minimum": 0, + "type": "number" + }, + "percentage_in_euro_fund": { + "type": "number", + "description": "Pourcentage du rachat sur le fond euro.", + "minimum": 0, + "default": 100, + "maximum": 100 + }, + "date_out": { + "description": "Date du déblocage de l'avance.", + "format": "date-time", + "type": "string" + }, + "date_in": { + "description": "Date du remboursement de l'avance.", + "format": "date-time", + "type": "string" + } + }, + "required": [ + "amount", + "date_out", + "date_in" + ] +} \ No newline at end of file diff --git a/models/LifeInsuranceFees.v1.json b/models/LifeInsuranceFees.v1.json new file mode 100755 index 0000000..9df69f8 --- /dev/null +++ b/models/LifeInsuranceFees.v1.json @@ -0,0 +1,35 @@ +{ + "title": "LifeInsuranceFees", + "x-stoplight": { + "id": "se1018hcgiqm1" + }, + "oneOf": [ + { + "properties": { + "percentage": { + "type": "number", + "minimum": 0, + "maximum": 100, + "default": 0 + } + }, + "required": [ + "percentage" + ] + }, + { + "properties": { + "flat": { + "type": "number", + "default": 0, + "minimum": 0 + } + }, + "required": [ + "flat" + ] + } + ], + "type": "object", + "description": "Frais appliqués à une opération sur un contrat d'assurance vie: valeur fixe + pourcentage du montant de l'opération (versement, rachat, avance)." +} \ No newline at end of file diff --git a/models/LifeInsuranceInstallmentItem.v1.json b/models/LifeInsuranceInstallmentItem.v1.json new file mode 100755 index 0000000..8481e35 --- /dev/null +++ b/models/LifeInsuranceInstallmentItem.v1.json @@ -0,0 +1,55 @@ +{ + "title": "LifeInsuranceInstallmentItem", + "description": "Représente le versement d'une prime sur un contrat d'assurance vie", + "type": "object", + "properties": { + "type": { + "default": "ONE_TIME", + "description": "Type de versement.", + "type": "string", + "enum": [ + "INITIAL", + "ONE_TIME", + "RECURRING" + ] + }, + "amount": { + "description": "Montant du versement.", + "minimum": 0, + "type": "number" + }, + "percentage_in_euro_fund": { + "type": "number", + "description": "Pourcentage du versement alloué au fond euro.", + "minimum": 0, + "default": 100, + "maximum": 100 + }, + "date_or_periodicity": { + "oneOf": [ + { + "properties": { + "date": { + "description": "Date du versement.", + "format": "date-time", + "type": "string" + } + } + }, + { + "properties": { + "periodicity": { + "$ref": "./LifeInsurancePeriodicity.v1.json" + } + } + } + ], + "type": "object" + } + }, + "required": [ + "type", + "amount", + "date_or_periodicity" + ] +} \ No newline at end of file diff --git a/models/LifeInsuranceParameters.v1.json b/models/LifeInsuranceParameters.v1.json new file mode 100755 index 0000000..09d7f7b --- /dev/null +++ b/models/LifeInsuranceParameters.v1.json @@ -0,0 +1,163 @@ +{ + "title": "LifeInsuranceParameters", + "type": "object", + "description": "Paramètres de simulation d'un projet d'assurance vie", + "properties": { + "mode": { + "type": "string", + "description": "Mode de simulation: grandeur recherchée", + "enum": [ + "FINAL_CAPITAL", + "INITIAL_CAPITAL", + "MONTHLY_PAYMENT", + "YEARLY_AVERAGE_PERFORMANCE" + ] + }, + "contract_parameters": { + "type": "object", + "required": [ + "subscription_date", + "valuation_date", + "horizon_date" + ], + "properties": { + "subscription_date": { + "description": "Date de la première souscription.", + "format": "date-time", + "type": "string" + }, + "valuation_date": { + "description": "Date de valorisation du contrat.", + "format": "date-time", + "type": "string" + }, + "horizon_date": { + "description": "Horizon du contrat: date de fin.", + "format": "date-time", + "type": "string" + }, + "percentage_in_non_euro_fund": { + "description": "Pourcentage du capital investis hors du fond euros.", + "type": "number", + "minimum": 0, + "maximum": 100, + "default": 0 + } + } + }, + "installments": { + "type": "array", + "description": "Liste des versements, incluant le versement initial", + "items": { + "$ref": "./LifeInsuranceInstallmentItem.v1.json" + } + }, + "purchases": { + "type": "array", + "description": "Liste des rachats", + "items": { + "$ref": "./LifeInsurancePurchaseItem.v1.json" + } + }, + "advances": { + "type": "array", + "description": "Liste des avances", + "items": { + "$ref": "./LifeInsuranceAdvanceItem.v1.json" + } + }, + "adjudications": { + "type": "array", + "description": "Liste des arbitrages", + "items": { + "$ref": "./LifeInsuranceAdjudicationItem.v1.json" + } + }, + "fees": { + "type": "object", + "description": "Frais sur les opérations du contrat d'assurance vie: versement initial, persement ponctuel, versement régulier, rachat, avance, arbitrage et gestion (du fond euro et UC).", + "properties": { + "initial_installment": { + "$ref": "./LifeInsuranceFees.v1.json" + }, + "installment": { + "$ref": "./LifeInsuranceFees.v1.json" + }, + "regular_installment": { + "$ref": "./LifeInsuranceFees.v1.json" + }, + "purchase": { + "$ref": "./LifeInsuranceFees.v1.json" + }, + "advance": { + "$ref": "./LifeInsuranceFees.v1.json" + }, + "adjudication": { + "$ref": "./LifeInsuranceFees.v1.json" + }, + "management_euro_fund": { + "$ref": "./LifeInsuranceFees.v1.json" + }, + "management_non_euro_fund": { + "$ref": "./LifeInsuranceFees.v1.json" + } + } + }, + "funds_yearly_performances": { + "type": "object", + "description": "Performance annuelle brute de frais de gestion des fonds euro et non euro. Le nombre d'élèments doit correspondre à la durée du contrat, soit le nombre d'années entre les paramètres subscription_date et horizon_date.", + "properties": { + "euro": { + "type": "array", + "description": "Performances annuelles du fond euros", + "items": { + "type": "number", + "minimum": 0 + } + }, + "non_euro": { + "type": "array", + "description": "Performances annuelles du ou des fonds non euros", + "items": { + "type": "number" + } + } + } + }, + "taxes": { + "type": "object", + "description": "Impositions des plus-values", + "properties": { + "tax_mode": { + "type": "string", + "description": "Fiscalité choisie: prélèvement forfaitaire libératoire ou intégration à l'impôt sur le revenu.", + "enum": [ + "ONE_SHOT_PAYING", + "INTEGRATION_TO_INCOME_TAX" + ], + "default": "ONE_SHOT_PAYING" + }, + "marginal_tax_rate": { + "type": "number", + "description": "Taux marginal d'imposition", + "minimum": 0, + "maximum": 100 + }, + "allowance": { + "type": "number", + "minimum": 0, + "default": 0, + "description": "Abbatement éventuels" + } + }, + "required": [ + "tax_mode" + ] + } + }, + "required": [ + "mode", + "contract_parameters", + "installments" + ] +} \ No newline at end of file diff --git a/models/LifeInsurancePeriodicity.v1.json b/models/LifeInsurancePeriodicity.v1.json new file mode 100755 index 0000000..d12bdf1 --- /dev/null +++ b/models/LifeInsurancePeriodicity.v1.json @@ -0,0 +1,12 @@ +{ + "type": "string", + "title": "LifeInsurancePeriodicity", + "enum": [ + "MONTHLY", + "QUARTERLY", + "HALF_YEARLY", + "YEARLY" + ], + "description": "Périodicité des évènements d'un contrat d'assurance vie.", + "default": "MONTHLY" +} \ No newline at end of file diff --git a/models/LifeInsurancePurchaseItem.v1.json b/models/LifeInsurancePurchaseItem.v1.json new file mode 100755 index 0000000..317f072 --- /dev/null +++ b/models/LifeInsurancePurchaseItem.v1.json @@ -0,0 +1,64 @@ +{ + "title": "LifeInsurancePurchaseItem", + "x-stoplight": { + "id": "rn6qdhcylzis7" + }, + "description": "Représente le rachat, partiel ou total, d'un contrat d'assurance vie", + "type": "object", + "properties": { + "type": { + "default": "ONE_TIME", + "description": "Type de rachat.", + "type": "string", + "enum": [ + "ONE_TIME", + "RECURRING", + "COMPLETE" + ] + }, + "amount": { + "description": "Montant du rachat.", + "minimum": 0, + "type": "number" + }, + "percentage_in_euro_fund": { + "type": "number", + "description": "Pourcentage du rachat sur le fond euro.", + "minimum": 0, + "default": 100, + "maximum": 100 + }, + "date_or_periodicity": { + "oneOf": [ + { + "properties": { + "date": { + "description": "Date du rachat.", + "format": "date-time", + "type": "string" + } + }, + "required": [ + "date" + ] + }, + { + "properties": { + "periodicity": { + "$ref": "./LifeInsurancePeriodicity.v1.json" + } + }, + "required": [ + "periodicity" + ] + } + ], + "type": "object" + } + }, + "required": [ + "type", + "amount", + "date_or_periodicity" + ] +} \ No newline at end of file diff --git a/models/LifeInsuranceResults.v1.json b/models/LifeInsuranceResults.v1.json new file mode 100755 index 0000000..1ca91e2 --- /dev/null +++ b/models/LifeInsuranceResults.v1.json @@ -0,0 +1,28 @@ +{ + "type": "object", + "x-stoplight": { + "id": "gxadcfz10kqv9" + }, + "title": "LifeInsuranceResults", + "description": "Résultats de la simulation d'un contrat d'assurance vie", + "properties": { + "table_euro_fund": { + "$ref": "./LifeInsuranceTableResults.v1.json" + }, + "table_non_euro_fund": { + "$ref": "./LifeInsuranceTableResults.v1.json" + }, + "summary_euro_fund": { + "$ref": "./LifeInsuranceSummaryResults.v1.json" + }, + "summary_non_euro_fund": { + "$ref": "./LifeInsuranceSummaryResults.v1.json" + }, + "logs": { + "type": "array", + "items": { + "$ref": "./Log.v1.json" + } + } + } +} \ No newline at end of file diff --git a/models/LifeInsuranceSimulation.v1.json b/models/LifeInsuranceSimulation.v1.json new file mode 100755 index 0000000..f55345c --- /dev/null +++ b/models/LifeInsuranceSimulation.v1.json @@ -0,0 +1,28 @@ +{ + "title": "LifeInsuranceSimulation", + "x-stoplight": { + "id": "0df8467fdf4f9" + }, + "description": "Réponse de la simulation d'un projet d'assurance vie.", + "type": "object", + "properties": { + "type": { + "type": "string", + "default": "LIFE_INSURANCE", + "description": "Type de simulation.", + "enum": [ + "LIFE_INSURANCE" + ] + }, + "parameters": { + "$ref": "./LifeInsuranceParameters.v1.json" + }, + "results": { + "$ref": "./LifeInsuranceResults.v1.json" + } + }, + "required": [ + "type", + "parameters" + ] +} \ No newline at end of file diff --git a/models/LifeInsuranceSummaryResults.v1.json b/models/LifeInsuranceSummaryResults.v1.json new file mode 100755 index 0000000..214d6e7 --- /dev/null +++ b/models/LifeInsuranceSummaryResults.v1.json @@ -0,0 +1,47 @@ +{ + "type": "object", + "x-stoplight": { + "id": "i6looooy50x2l" + }, + "title": "LifeInsuranceSummaryResults", + "description": "Résumé des résultats de la simulation d'un contrat d'assurance vie", + "properties": { + "capital": { + "type": "number", + "description": "Capital" + }, + "installment": { + "type": "number", + "description": "Versements" + }, + "gains": { + "type": "number", + "description": "Intérêts" + }, + "purshase": { + "type": "number", + "description": "Rachats" + }, + "fees": { + "type": "number", + "description": "Frais" + }, + "advance": { + "type": "number", + "description": "Avances" + }, + "adjudication": { + "type": "number", + "description": "Arbitrages" + } + }, + "required": [ + "capital", + "installment", + "gains", + "purshase", + "fees", + "advance", + "adjudication" + ] +} \ No newline at end of file diff --git a/models/LifeInsuranceTableResults.v1.json b/models/LifeInsuranceTableResults.v1.json new file mode 100755 index 0000000..6fbf373 --- /dev/null +++ b/models/LifeInsuranceTableResults.v1.json @@ -0,0 +1,65 @@ +{ + "type": "object", + "title": "LifeInsuranceTableResults", + "description": "Tableau de résultat de la simulation d'un contrat d'assurance vie", + "properties": { + "capital": { + "type": "array", + "description": "Capital", + "items": { + "type": "number" + } + }, + "installments": { + "type": "array", + "description": "Versements", + "items": { + "type": "number" + } + }, + "gains": { + "type": "array", + "description": "Intérêts", + "items": { + "type": "number" + } + }, + "purshases": { + "type": "array", + "description": "Rachats", + "items": { + "type": "number" + } + }, + "fees": { + "type": "array", + "description": "Frais", + "items": { + "type": "number" + } + }, + "advances": { + "type": "array", + "description": "Avances", + "items": { + "type": "number" + } + }, + "adjudications": { + "type": "array", + "description": "Arbitrages", + "items": { + "type": "number" + } + } + }, + "required": [ + "capital", + "installments", + "gains", + "purshases", + "fees", + "advances", + "adjudications" + ] +} \ No newline at end of file diff --git a/reference/toaztr.v1.yaml b/reference/toaztr.v1.yaml index 2b412c4..c2ade53 100755 --- a/reference/toaztr.v1.yaml +++ b/reference/toaztr.v1.yaml @@ -9,6 +9,12 @@ tags: - name: case x-displayName: dossier description: Gestion de dossiers clients + - name: invite + x-displayName: invitations + description: Gestion des invitation conseillers dans une licence interface de type Teams + - name: standalone_life_insurance + x-displayName: Assurance vie + description: Simulation d'un contrat d'assurance vie - name: plan_parameters x-displayName: financement description: Gestion des plans de financement dans un dossier client @@ -58,6 +64,7 @@ x-tagGroups: - standalone_score - notary - income_tax + - standalone_life_insurance - name: Gestion des souscriptions tags: - subscription @@ -100,6 +107,7 @@ components: transfers/write: Accès en écriture aux transferts transfers/*: Accès complet aux transferts scores/*: Accès au scoring + wealth/*: Accès à la simulation d'un contrat d'assurance vie subscriptions/read: Accès en lecture aux souscriptions subscriptions/write: Accès en écriture aux souscriptions subscriptions/*: Accès complet aux souscriptions @@ -502,6 +510,13 @@ components: properties: data: $ref: ../models/NotaryFees.v1.json + LifeInsuranceResponse: + title: LifeInsuranceResponse + type: object + properties: + data: + $ref: ../models/LifeInsuranceResults.v1.json + description: Résultat d'une simulation de contrat d'assurance vie IncomeTaxResponse: title: IncomeTaxResponse type: object @@ -1735,6 +1750,35 @@ paths: security: - toaztr_auth: - simulations/lmnp + /v1/life_insurance: + parameters: [] + post: + operationId: postLifeInsurance + description: Simule un contrat d'assurance vie + requestBody: + content: + application/json: + schema: + $ref: ../models/LifeInsuranceParameters.v1.json + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/LifeInsuranceResponse' + '400': + $ref: '#/components/responses/400' + '403': + $ref: '#/components/responses/403' + '500': + $ref: '#/components/responses/500' + summary: Simule un contrat d'assurance vie + security: + - toaztr_auth: + - wealth/* + tags: + - standalone_life_insurance /v1/scores: parameters: [] post: