From 0d723f284ce41331d7ca5adb2be7beff6120532e Mon Sep 17 00:00:00 2001 From: Mauro Valota Date: Fri, 2 Aug 2024 17:15:44 +0200 Subject: [PATCH 1/4] added get tax profile method --- models/responses/GetTaxProfileResponse.yaml | 5 ++ models/schemas/TaxProfile.yaml | 43 +++++++++++++++ models/schemas/VatType.yaml | 2 + openapi.yaml | 58 +++++++++++++++++++++ 4 files changed, 108 insertions(+) create mode 100644 models/responses/GetTaxProfileResponse.yaml create mode 100644 models/schemas/TaxProfile.yaml diff --git a/models/responses/GetTaxProfileResponse.yaml b/models/responses/GetTaxProfileResponse.yaml new file mode 100644 index 00000000..a192170e --- /dev/null +++ b/models/responses/GetTaxProfileResponse.yaml @@ -0,0 +1,5 @@ +title: GetVatTypeResponse +type: object +properties: + data: + $ref: ../schemas/TaxProfile.yaml diff --git a/models/schemas/TaxProfile.yaml b/models/schemas/TaxProfile.yaml new file mode 100644 index 00000000..f0ecb08d --- /dev/null +++ b/models/schemas/TaxProfile.yaml @@ -0,0 +1,43 @@ +title: TaxProfile +type: object +properties: + company_type: + type: string + company_subtype: + type: string + profession: + type: string + regime: + type: string + rivalsa_name: + type: string + default_rivalsa: + type: integer + cassa_name: + type: string + default_cassa: + type: integer + default_cassa_taxable: + type: integer + cassa2_name: + type: string + default_cassa2: + type: integer + default_cassa2_taxable: + type: integer + default_withholding_tax: + type: integer + default_withholding_tax_taxable: + type: integer + default_other_withholding_tax: + type: integer + enasarco: + type: boolean + enasarco_type: + type: string + contributions_percentage: + type: integer + med: + type: boolean + default_vat: + $ref: ./VatType.yaml diff --git a/models/schemas/VatType.yaml b/models/schemas/VatType.yaml index bcda078e..63f07f8e 100644 --- a/models/schemas/VatType.yaml +++ b/models/schemas/VatType.yaml @@ -45,3 +45,5 @@ properties: type: boolean description: Is the vat type disabled nullable: true + default: + type: boolean diff --git a/openapi.yaml b/openapi.yaml index d4641531..04c25cef 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -2753,6 +2753,24 @@ paths: iban: IT17Q0051343200000003497636 sia: T1234 virtual: false + /c/{company_id}/settings/tax_profile: + parameters: + - $ref: '#/components/parameters/company_id' + get: + summary: Get Tax Profile + operationId: getTaxProfile + tags: + - Settings + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/responses/GetTaxProfileResponse' + description: Gets the Tax Profile + security: + - OAuth2AuthenticationCodeFlow: + - 'settings:r' /c/{company_id}/settings/payment_accounts/{payment_account_id}: parameters: - $ref: '#/components/parameters/company_id' @@ -8953,5 +8971,45 @@ components: data: limit: 3000 usage: 100 + GetTaxProfileResponse: + description: Example response + content: + application/json: + schema: + $ref: ./models/responses/GetTaxProfileResponse.yaml + examples: + example-1: + value: + data: + company_type: independent_contractor + company_subtype: string + profession: string + regime: ordinario + rivalsa_name: string + default_rivalsa: 0 + cassa_name: string + default_cassa: 0 + default_cassa_taxable: 100 + cassa2_name: string + default_cassa2: 0 + default_cassa2_taxable: 0 + default_withholding_tax: 0 + default_withholding_tax_taxable: 100 + default_other_withholding_tax: 0 + enasarco: false + enasarco_type: string + contributions_percentage: 0 + med: false + default_vat: + id: 0 + value: 22 + description: Non imponibile art. 123 + notes: 'IVA non imponibile ai sensi dell''articolo 123, comma 2' + e_invoice: true + ei_type: 2 + ei_description: string + editable: true + is_disabled: true + default: true security: - OAuth2AuthenticationCodeFlow: [] From 6b7843a4977ae6802aa5d41022f32e63fdabc7c0 Mon Sep 17 00:00:00 2001 From: Mauro Valota Date: Fri, 2 Aug 2024 17:30:34 +0200 Subject: [PATCH 2/4] fixed validation issue --- openapi.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 04c25cef..289b700c 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -2763,10 +2763,7 @@ paths: - Settings responses: '200': - content: - application/json: - schema: - $ref: '#/components/responses/GetTaxProfileResponse' + $ref: '#/components/responses/GetTaxProfileResponse' description: Gets the Tax Profile security: - OAuth2AuthenticationCodeFlow: From a85df062ca10253c7af2f91122a67506faebcd4e Mon Sep 17 00:00:00 2001 From: Mauro Valota Date: Thu, 8 Aug 2024 12:38:32 +0200 Subject: [PATCH 3/4] added descriptions and small changes --- models/responses/GetTaxProfileResponse.yaml | 2 +- models/schemas/TaxProfile.yaml | 42 +++++++++++++++++++++ models/schemas/VatType.yaml | 2 + openapi.yaml | 32 ++++++++-------- 4 files changed, 61 insertions(+), 17 deletions(-) diff --git a/models/responses/GetTaxProfileResponse.yaml b/models/responses/GetTaxProfileResponse.yaml index a192170e..9de99c85 100644 --- a/models/responses/GetTaxProfileResponse.yaml +++ b/models/responses/GetTaxProfileResponse.yaml @@ -1,4 +1,4 @@ -title: GetVatTypeResponse +title: GetTaxProfileResponse type: object properties: data: diff --git a/models/schemas/TaxProfile.yaml b/models/schemas/TaxProfile.yaml index f0ecb08d..7a2772d7 100644 --- a/models/schemas/TaxProfile.yaml +++ b/models/schemas/TaxProfile.yaml @@ -3,41 +3,83 @@ type: object properties: company_type: type: string + description: The company type + nullable: true company_subtype: type: string + description: The company subtype + nullable: true profession: type: string + description: The profession + nullable: true regime: type: string + description: The applied regime + nullable: true rivalsa_name: type: string + description: The name of the rivalsa + nullable: true default_rivalsa: type: integer + description: The default rivalsa + nullable: true cassa_name: type: string + description: The name of the cassa + nullable: true default_cassa: type: integer + description: The default cassa + nullable: true default_cassa_taxable: type: integer + description: The default taxable for the cassa + nullable: true cassa2_name: type: string + description: The name of the second cassa + nullable: true default_cassa2: type: integer + description: The default second cassa + nullable: true default_cassa2_taxable: type: integer + description: The default taxable for the second cassa + nullable: true default_withholding_tax: type: integer + description: The default withholding tax + nullable: true default_withholding_tax_taxable: type: integer + description: The default taxable for the withholding tax + nullable: true default_other_withholding_tax: type: integer + description: The default other withholding tax + nullable: true enasarco: type: boolean + description: if it is enasarco + nullable: true enasarco_type: type: string + description: The enasarco type + nullable: true contributions_percentage: type: integer + description: The contributions percentage + nullable: true + profit_coefficient: + type: integer + description: The profit coefficient + nullable: true med: type: boolean + description: If the health card system is active + nullable: true default_vat: $ref: ./VatType.yaml diff --git a/models/schemas/VatType.yaml b/models/schemas/VatType.yaml index 63f07f8e..a0c44d00 100644 --- a/models/schemas/VatType.yaml +++ b/models/schemas/VatType.yaml @@ -46,4 +46,6 @@ properties: description: Is the vat type disabled nullable: true default: + description: If the vat type is default type: boolean + nullable: true diff --git a/openapi.yaml b/openapi.yaml index 289b700c..e2cbf8fe 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -8978,35 +8978,35 @@ components: example-1: value: data: - company_type: independent_contractor - company_subtype: string - profession: string - regime: ordinario - rivalsa_name: string + company_type: individual + company_subtype: artigiani + profession: null + regime: forfettario_5 + rivalsa_name: '' default_rivalsa: 0 - cassa_name: string + cassa_name: '' default_cassa: 0 default_cassa_taxable: 100 - cassa2_name: string + cassa2_name: '' default_cassa2: 0 default_cassa2_taxable: 0 default_withholding_tax: 0 default_withholding_tax_taxable: 100 default_other_withholding_tax: 0 enasarco: false - enasarco_type: string + enasarco_type: null contributions_percentage: 0 med: false default_vat: - id: 0 - value: 22 - description: Non imponibile art. 123 - notes: 'IVA non imponibile ai sensi dell''articolo 123, comma 2' + id: 66 + value: 0 + description: Contribuenti forfettari + notes: 'Operazione non soggetta a IVA ai sensi dell''art. 1, commi 54-89, Legge n. 190\/2014 e succ. modifiche\/integrazioni' e_invoice: true - ei_type: 2 - ei_description: string - editable: true - is_disabled: true + ei_type: 2.2 + ei_description: 'Non soggetta art. 1\/54-89 L. 190\/2014 e succ. modifiche\/integrazioni' + editable: false + is_disabled: false default: true security: - OAuth2AuthenticationCodeFlow: [] From d585b1320cda9f92b561bac0f721a46e6677995a Mon Sep 17 00:00:00 2001 From: Emanuele Saccomandi Date: Thu, 8 Aug 2024 12:48:59 +0200 Subject: [PATCH 4/4] model: minor tax profile types fixes --- models/schemas/TaxProfile.yaml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/models/schemas/TaxProfile.yaml b/models/schemas/TaxProfile.yaml index 7a2772d7..52707142 100644 --- a/models/schemas/TaxProfile.yaml +++ b/models/schemas/TaxProfile.yaml @@ -22,59 +22,59 @@ properties: description: The name of the rivalsa nullable: true default_rivalsa: - type: integer - description: The default rivalsa + type: number + description: The default rivalsa amount nullable: true cassa_name: type: string description: The name of the cassa nullable: true default_cassa: - type: integer - description: The default cassa + type: number + description: The default cassa amount nullable: true default_cassa_taxable: - type: integer - description: The default taxable for the cassa + type: number + description: The default taxable amount for the cassa nullable: true cassa2_name: type: string description: The name of the second cassa nullable: true default_cassa2: - type: integer - description: The default second cassa + type: number + description: The default second cassa amount nullable: true default_cassa2_taxable: - type: integer - description: The default taxable for the second cassa + type: number + description: The default taxable amount for the second cassa nullable: true default_withholding_tax: - type: integer + type: number description: The default withholding tax nullable: true default_withholding_tax_taxable: - type: integer - description: The default taxable for the withholding tax + type: number + description: The default taxable amount for the withholding tax nullable: true default_other_withholding_tax: - type: integer + type: number description: The default other withholding tax nullable: true enasarco: type: boolean - description: if it is enasarco + description: If it has enasarco nullable: true enasarco_type: type: string description: The enasarco type nullable: true contributions_percentage: - type: integer + type: number description: The contributions percentage nullable: true profit_coefficient: - type: integer + type: number description: The profit coefficient nullable: true med: