diff --git a/models/enums/PriceListPricesType.yaml b/models/enums/PriceListPricesType.yaml new file mode 100644 index 00000000..b6d7b40f --- /dev/null +++ b/models/enums/PriceListPricesType.yaml @@ -0,0 +1,6 @@ +title: PriceListPricesType +type: string +enum: + - net + - gross +description: Price list prices type diff --git a/models/enums/PriceListType.yaml b/models/enums/PriceListType.yaml new file mode 100644 index 00000000..05b7cca8 --- /dev/null +++ b/models/enums/PriceListType.yaml @@ -0,0 +1,6 @@ +title: PriceListType +type: string +enum: + - sell + - purchase +description: Price list types diff --git a/models/responses/GetEntityClientPreCreateInfoResponse.yaml b/models/responses/GetEntityClientPreCreateInfoResponse.yaml new file mode 100644 index 00000000..f47b0565 --- /dev/null +++ b/models/responses/GetEntityClientPreCreateInfoResponse.yaml @@ -0,0 +1,5 @@ +title: GetEntityClientPreCreateInfoResponse +type: object +properties: + data: + $ref: ../schemas/EntityClientPreCreateInfo.yaml diff --git a/models/responses/GetIssuedDocumentResponse.yaml b/models/responses/GetIssuedDocumentResponse.yaml index 4d56391f..7024b2c2 100644 --- a/models/responses/GetIssuedDocumentResponse.yaml +++ b/models/responses/GetIssuedDocumentResponse.yaml @@ -3,4 +3,3 @@ type: object properties: data: $ref: ../schemas/IssuedDocument.yaml - nullable: true diff --git a/models/responses/GetPriceListItemsResponse.yaml b/models/responses/GetPriceListItemsResponse.yaml new file mode 100644 index 00000000..ea47cc4a --- /dev/null +++ b/models/responses/GetPriceListItemsResponse.yaml @@ -0,0 +1,5 @@ +title: GetPriceListItemsResponse +type: object +properties: + data: + $ref: ../schemas/PriceListItemsList.yaml diff --git a/models/responses/ListPriceListsResponse.yaml b/models/responses/ListPriceListsResponse.yaml new file mode 100644 index 00000000..458e99e0 --- /dev/null +++ b/models/responses/ListPriceListsResponse.yaml @@ -0,0 +1,7 @@ +title: ListPriceListsResponse +type: object +properties: + data: + type: array + items: + $ref: ../schemas/PriceList.yaml diff --git a/models/schemas/Client.yaml b/models/schemas/Client.yaml index 395fd376..876fb410 100644 --- a/models/schemas/Client.yaml +++ b/models/schemas/Client.yaml @@ -126,15 +126,15 @@ properties: type: boolean description: Use e-invoices for this entity nullable: true + discount_highlight: + type: boolean + description: Highlight Discount + nullable: true ei_code: type: string description: | Client e-invoice code nullable: true - discount_highlight: - type: boolean - description: Highlight Discount - nullable: true default_discount: type: number description: Client default discount @@ -152,6 +152,10 @@ properties: format: date description: Client intent declaration protocol date nullable: true + price_list_id: + type: string + description: Price list id + nullable: true created_at: type: string nullable: true diff --git a/models/schemas/EntityClientPreCreateInfo.yaml b/models/schemas/EntityClientPreCreateInfo.yaml new file mode 100644 index 00000000..28ad26d6 --- /dev/null +++ b/models/schemas/EntityClientPreCreateInfo.yaml @@ -0,0 +1,41 @@ +type: object +title: EntityClientPreCreateInfo +properties: + countries_list: + type: array + description: Countries list + nullable: true + items: + type: string + payment_methods_list: + type: array + description: Entity payment methods list + nullable: true + items: + $ref: ./PaymentMethod.yaml + payment_accounts_list: + type: array + description: Entity payment accounts list + nullable: true + items: + $ref: ./PaymentAccount.yaml + vat_types_list: + type: array + description: Vat types list + nullable: true + items: + $ref: ./VatType.yaml + price_lists: + type: array + description: Entity price lists + nullable: true + items: + $ref: ./PriceList.yaml + limit: + type: number + description: Entity limit + nullable: true + usage: + type: number + description: Entity usage + nullable: true diff --git a/models/schemas/IssuedDocument.yaml b/models/schemas/IssuedDocument.yaml index 13fac2b6..81b61866 100644 --- a/models/schemas/IssuedDocument.yaml +++ b/models/schemas/IssuedDocument.yaml @@ -502,6 +502,10 @@ properties: - manual_accepted - manual_rejected nullable: true + price_list_id: + type: string + description: Price list id + nullable: true locked: type: boolean nullable: true diff --git a/models/schemas/IssuedDocumentPreCreateInfo.yaml b/models/schemas/IssuedDocumentPreCreateInfo.yaml index e2ee6822..b51ee502 100644 --- a/models/schemas/IssuedDocumentPreCreateInfo.yaml +++ b/models/schemas/IssuedDocumentPreCreateInfo.yaml @@ -126,3 +126,8 @@ properties: nullable: true items: $ref: ./Language.yaml + price_lists: + type: array + description: Price lists + items: + $ref: ./PriceList.yaml diff --git a/models/schemas/PaymentMethod.yaml b/models/schemas/PaymentMethod.yaml index 9aebbed2..9d9ef995 100644 --- a/models/schemas/PaymentMethod.yaml +++ b/models/schemas/PaymentMethod.yaml @@ -40,3 +40,4 @@ properties: type: string description: E-invoice payment method nullable: true +description: '' diff --git a/models/schemas/PriceList.yaml b/models/schemas/PriceList.yaml new file mode 100644 index 00000000..35692b91 --- /dev/null +++ b/models/schemas/PriceList.yaml @@ -0,0 +1,28 @@ +type: object +title: PriceList +properties: + id: + type: string + description: Price list id + nullable: true + name: + type: string + example: '123' + description: Price list name + nullable: true + prices_type: + $ref: ../enums/PriceListPricesType.yaml + is_default: + type: boolean + description: This entity is default + nullable: true + valid_from: + type: string + description: Price list validity start date + nullable: true + valid_to: + type: string + nullable: true + description: Price list validity end date + type: + $ref: ../enums/PriceListType.yaml diff --git a/models/schemas/PriceListItem.yaml b/models/schemas/PriceListItem.yaml new file mode 100644 index 00000000..6bd53b36 --- /dev/null +++ b/models/schemas/PriceListItem.yaml @@ -0,0 +1,5 @@ +title: PriceListItem +type: object +properties: + price: + type: number diff --git a/models/schemas/PriceListItemsList.yaml b/models/schemas/PriceListItemsList.yaml new file mode 100644 index 00000000..08e90987 --- /dev/null +++ b/models/schemas/PriceListItemsList.yaml @@ -0,0 +1,5 @@ +title: PriceListItemsList +type: object +additionalProperties: + type: object + $ref: ./PriceListItem.yaml diff --git a/openapi.yaml b/openapi.yaml index c71fd78d..add00cd5 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -28,6 +28,7 @@ tags: - name: Issued Documents - name: Issued e-invoices - name: Products + - name: PriceLists - name: Receipts - name: Received Documents - name: Suppliers @@ -184,6 +185,7 @@ paths: value: 45 description: '' is_disabled: false + price_list_id: '10' description: The client to create tags: - Clients @@ -266,6 +268,7 @@ paths: value: 45 description: '' is_disabled: false + price_list_id: '10' description: The modified Client. First level parameters are managed in delta mode. tags: - Clients @@ -286,6 +289,26 @@ paths: - entity.clients:a tags: - Clients + /c/{company_id}/entities/clients/info: + parameters: + - $ref: '#/components/parameters/company_id' + get: + summary: Get Client info + tags: + - Clients + responses: + '200': + $ref: '#/components/responses/GetEntityClientsInfoResponse' + '401': + description: Unauthorized + '404': + description: Not Found + operationId: getClientInfo + security: + - OAuth2AuthenticationCodeFlow: + - entity.clients:r + description: Retrieves the information useful while creating a new Client. + parameters: [] /c/{company_id}/entities/suppliers: parameters: - $ref: '#/components/parameters/company_id' @@ -710,6 +733,7 @@ paths: status: not_paid payment_method: id: 4 + price_list_id: '10' description: The Issued Document /c/{company_id}/issued_documents/{document_id}: parameters: @@ -3111,6 +3135,49 @@ paths: description: Delete a webhooks subscription. security: - OAuth2AuthenticationCodeFlow: [] + /c/{company_id}/price_lists: + parameters: + - $ref: '#/components/parameters/company_id' + get: + summary: Get PriceLists + tags: + - PriceLists + responses: + '200': + $ref: '#/components/responses/ListPriceList' + '401': + description: Unauthorized + '404': + description: Not Found + operationId: getPriceLists + security: + - OAuth2AuthenticationCodeFlow: [] + description: Retrieves all price lists of the company + parameters: [] + /c/{company_id}/price_lists/{price_list_id}/items: + parameters: + - $ref: '#/components/parameters/company_id' + - schema: + type: string + name: price_list_id + in: path + required: true + get: + summary: Get PriceList Items List + tags: + - PriceLists + responses: + '200': + $ref: '#/components/responses/GetPriceListItems' + '401': + description: Unauthorized + '404': + description: Not Found + operationId: getPriceListItems + security: + - OAuth2AuthenticationCodeFlow: [] + description: Retrieves all the Items of a PriceList + parameters: [] components: schemas: {} securitySchemes: @@ -3786,6 +3853,7 @@ components: value: 45 description: '' is_disabled: false + price_list_id: '10' ModifyClientResponse: description: Client modified. content: @@ -3828,6 +3896,7 @@ components: value: 45 description: '' is_disabled: false + price_list_id: '10' GetSupplierResponse: description: Example response content: @@ -4355,6 +4424,7 @@ components: locked: false has_ts_pay_pending_payment: false show_tspay_button: false + price_list_id: '10' ModifyIssuedDocumentResponse: description: Document edited content: @@ -6299,6 +6369,15 @@ components: RT05: Contributo ENPAM RT06: Altro contributo previdenziale use_e_invoice: true + price_lists: + - id: '10' + name: Listino 1 + prices_type: net + is_default: true + is_archived: false + valid_from: '2021-08-01' + valid_to: '2025-09-10' + type: sell GetEmailDataResponse: description: EmailData content: @@ -9021,5 +9100,93 @@ components: editable: false is_disabled: false default: true + GetEntityClientsInfoResponse: + description: Example response + content: + application/json: + schema: + $ref: ./models/responses/GetEntityClientPreCreateInfoResponse.yaml + examples: + example-1: + value: + data: + countries_list: + - Italy + payment_methods_list: + - id: 555 + name: Rimessa diretta + is_default: false + details: [] + bank_iban: null + bank_name: null + bank_beneficiary: null + ei_payment_method: null + payment_accounts_list: + - id: 0 + name: Conto Banca Intesa + type: standard + iban: string + sia: string + cuc: string + virtual: true + vat_types_list: + - 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 + price_lists: + - id: string + name: '123' + prices_type: net + is_default: true + valid_from: string + valid_to: string + type: sell + limit: 0 + usage: 0 + ListPriceList: + description: Example response + content: + application/json: + schema: + $ref: ./models/responses/ListPriceListsResponse.yaml + examples: + example-1: + value: + data: + - id: '10' + name: listino + prices_type: net + is_default: true + valid_from: '2025-01-01' + valid_to: '2025-12-01' + type: sell + - id: '11' + name: listino-test + prices_type: gross + is_default: true + valid_from: '2025-01-01' + valid_to: '2025-01-01' + type: purchase + GetPriceListItems: + description: Example response + content: + application/json: + schema: + $ref: ./models/responses/GetPriceListItemsResponse.yaml + examples: + example-1: + value: + data: + '1': + price: 3.5 + '2': + price: 5 security: - OAuth2AuthenticationCodeFlow: []