diff --git a/models/enums/PendingReceivedDocumentType.yaml b/models/enums/PendingReceivedDocumentType.yaml new file mode 100644 index 00000000..78e46555 --- /dev/null +++ b/models/enums/PendingReceivedDocumentType.yaml @@ -0,0 +1,6 @@ +title: PendingReceivedDocumentType +type: string +default: agyo +enum: + - agyo +description: Pending received document type diff --git a/models/responses/GetPendingReceivedDocumentResponse.yaml b/models/responses/GetPendingReceivedDocumentResponse.yaml new file mode 100644 index 00000000..4b5eea8b --- /dev/null +++ b/models/responses/GetPendingReceivedDocumentResponse.yaml @@ -0,0 +1,7 @@ +title: GetReceivedDocumentResponse +type: object +properties: + data: + $ref: ../schemas/PendingReceivedDocument.yaml + nullable: true +description: '' diff --git a/models/responses/ListPendingReceivedDocumentsResponse.yaml b/models/responses/ListPendingReceivedDocumentsResponse.yaml new file mode 100644 index 00000000..7b67ad7b --- /dev/null +++ b/models/responses/ListPendingReceivedDocumentsResponse.yaml @@ -0,0 +1,5 @@ +title: ListPendingReceivedDocumentsResponse +allOf: + - $ref: ./pagination/Pagination.yaml + - $ref: ./pagination/ListPendingReceivedDocumentsResponsePage.yaml +description: '' diff --git a/models/responses/pagination/ListPendingReceivedDocumentsResponsePage.yaml b/models/responses/pagination/ListPendingReceivedDocumentsResponsePage.yaml new file mode 100644 index 00000000..ae569788 --- /dev/null +++ b/models/responses/pagination/ListPendingReceivedDocumentsResponsePage.yaml @@ -0,0 +1,8 @@ +title: ListPendingReceivedDocumentsResponsePage +type: object +properties: + data: + type: array + items: + $ref: ../../schemas/PendingReceivedDocument.yaml + nullable: true diff --git a/models/schemas/PendingReceivedDocument.yaml b/models/schemas/PendingReceivedDocument.yaml new file mode 100644 index 00000000..8659fe4c --- /dev/null +++ b/models/schemas/PendingReceivedDocument.yaml @@ -0,0 +1,88 @@ +type: object +title: PendingReceivedDocument +properties: + id: + type: integer + nullable: true + description: Pending received document id + date: + type: string + description: Pending received document date [defaults to today's date] + format: date + nullable: true + subject: + type: string + description: Pending received document subject + nullable: true + filename: + type: string + description: Pending received document filename + nullable: true + type: + $ref: ../enums/PendingReceivedDocumentType.yaml + attachment_url: + type: string + description: |- + [Temporary] + [Read Only] + Pending received document url of the attached file + nullable: true + readOnly: true + amount_gross: + type: number + description: |- + [Read Only] + Pending received document total gross amount + currency: + $ref: ./Currency.yaml + document_type: + $ref: ../enums/ReceivedDocumentType.yaml + supplier_name: + type: string + description: Pending received document supplier name + nullable: true + cost_center: + type: string + description: Pending received document cost center + nullable: true + category: + type: string + nullable: true + description: Pending received document category + other_attachments: + type: array + nullable: true + description: Pending received document other attachments + items: + $ref: ./Attachment.yaml + emssion_date: + type: string + description: Pending received document emission date + format: date + nullable: true + payments_list: + type: array + nullable: true + items: + $ref: ./PendingReceivedDocumentPaymentsListItem.yaml + amount_net: + type: number + description: Pending received document total net amount + nullable: true + amount_vat: + type: number + description: Pending received document total vat amount + nullable: true + import_error: + type: string + description: Pending received document import error + nullable: true + extracted_data: + type: object + nullable: true + properties: + mining: + type: object + properties: + save_entity: + type: boolean \ No newline at end of file diff --git a/models/schemas/PendingReceivedDocumentPaymentsListItem.yaml b/models/schemas/PendingReceivedDocumentPaymentsListItem.yaml new file mode 100644 index 00000000..723263e8 --- /dev/null +++ b/models/schemas/PendingReceivedDocumentPaymentsListItem.yaml @@ -0,0 +1,39 @@ +title: PendingReceivedDocumentPaymentsListItem +type: object +properties: + id: + type: integer + description: Pending received document payment id + nullable: true + amount: + type: number + description: Pending received document payment total amount + nullable: true + due_date: + type: string + description: Due date + format: date + nullable: true + paid_date: + type: string + description: Pending received document payment paid date + format: date + nullable: true + payment_terms: + type: object + nullable: true + properties: + days: + type: integer + description: >- + Pending received document payment number of days by which the payment must be + made + nullable: true + type: + $ref: ../enums/PaymentTermsType.yaml + status: + type: string + description: Pending received document payment status + nullable: true + payment_account: + $ref: ./PaymentAccount.yaml diff --git a/openapi.yaml b/openapi.yaml index 59efa056..8fd50a5d 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1340,6 +1340,33 @@ paths: virtual: false attachment_token: bnopjao8gvydtgnewgiovs74yrfqwefEF description: Document to create + /c/{company_id}/received_documents/pending: + parameters: + - $ref: '#/components/parameters/company_id' + get: + summary: List Pending Received Documents + tags: + - Pending Received Documents + - Received Documents + responses: + '200': + $ref: '#/components/responses/ListPendingReceivedDocumentsResponse' + '401': + description: Unauthorized + operationId: listPendingReceivedDocuments + description: Lists the pending received documents. + security: + - OAuth2AuthenticationCodeFlow: + - received_documents:r + - stock:r + parameters: + - $ref: '#/components/parameters/pending_received_document_type' + - $ref: '#/components/parameters/fields' + - $ref: '#/components/parameters/fieldset' + - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/page' + - $ref: '#/components/parameters/per_page' + - $ref: '#/components/parameters/q' /c/{company_id}/received_documents/{document_id}: parameters: - $ref: '#/components/parameters/company_id' @@ -1447,6 +1474,31 @@ paths: - received_documents:a - stock:a parameters: [] + /c/{company_id}/received_documents/pending/{document_id}: + parameters: + - $ref: '#/components/parameters/company_id' + - $ref: '#/components/parameters/document_id' + get: + summary: Get Pending Received Document + tags: + - Pending Received Documents + - Received Documents + responses: + '200': + $ref: '#/components/responses/GetPendingReceivedDocumentResponse' + '401': + description: Unauthorized + '404': + description: Not Found + operationId: getPendingReceivedDocument + description: Gets the specified pending received document. + security: + - OAuth2AuthenticationCodeFlow: + - received_documents:r + - stock:r + parameters: + - $ref: '#/components/parameters/fields' + - $ref: '#/components/parameters/fieldset' /c/{company_id}/received_documents/totals: parameters: - $ref: '#/components/parameters/company_id' @@ -3538,6 +3590,15 @@ components: - passive_delivery_note - self_invoice description: The type of the received document. + pending_received_document_type: + name: type + in: query + required: true + schema: + type: string + enum: + - agyo + description: The type of the pending received document. q: name: q in: query @@ -6740,6 +6801,116 @@ components: prev_page_url: null to: 50 total: 123 + ListPendingReceivedDocumentsResponse: + description: Results list. + content: + application/json: + schema: + $ref: ./models/responses/ListPendingReceivedDocumentsResponse.yaml + examples: + example-1: + value: + current_page: 1 + data: + - id: 12345 + type: agyo + document_type: expense + description: Soggiorno di lavoro + amortization: 1 + rc_center: '' + invoice_number: '' + is_marked: false + is_detailed: false + e_invoice: false + created_at: '2021-08-15 14:02:02' + updated_at: '2021-08-15 14:02:02' + entity: + id: 111 + name: Hotel Rubino Palace + date: '2021-08-15' + next_due_date: '2021-08-15' + currency: + id: EUR + exchange_rate: '1.00000' + symbol: € + amount_net: 592 + amount_vat: 0 + amount_gross: 592 + amount_withholding_tax: 0 + amount_other_withholding_tax: 0 + tax_deductibility: 50 + vat_deductibility: 100 + items_list: null + payments_list: + - amount: 592 + due_date: '2021-08-15' + paid_date: '2021-08-15' + id: 777 + payment_terms: + days: 0 + type: standard + status: paid + payment_account: + id: 222 + name: Contanti + virtual: false + attachment_url: spesa_ger5i783t45hu6ti.pdf + attachment_preview_url: null + extra_data: null + - id: 12346 + type: expense + description: Assicurazione RCA + iamortization: 1 + rc_center: '' + invoice_number: '' + is_marked: false + is_detailed: false + e_invoice: false + created_at: '2021-08-09 14:02:02' + updated_at: '2021-08-09 14:02:02' + entity: + id: 89 + name: Indesa Assicurazioni S.P.A. + date: '2021-08-08' + next_due_date: '2021-08-08' + currency: + id: EUR + exchange_rate: '1.00000' + symbol: € + amount_net: 645.69 + amount_vat: 0 + amount_gross: 645.69 + amount_withholding_tax: 0 + amount_other_withholding_tax: 0 + tax_deductibility: 50 + vat_deductibility: 100 + items_list: null + payments_list: + - amount: 645.69 + due_date: '2021-08-08' + paid_date: '2021-08-08' + id: 999 + payment_terms: + days: 0 + type: standard + status: paid + payment_account: + id: 333 + name: Carta conto + virtual: false + attachment_url: spesa_gjsd567e5hu6ti.pdf + attachment_preview_url: null + extra_data: null + first_page_url: page=1 + from: 1 + last_page: 2 + last_page_url: page=2 + next_page_url: page=2 + path: received_documents + per_page: 50 + prev_page_url: null + to: 50 + total: 123 CreateReceivedDocumentResponse: description: Document created. content: @@ -6848,6 +7019,62 @@ components: attachment_url: spesa_ger5i783t45hu6ti.pdf attachment_preview_url: null extra_data: null + GetPendingReceivedDocumentResponse: + description: Document details. + content: + application/json: + schema: + $ref: ./models/responses/GetPendingReceivedDocumentResponse.yaml + examples: + example-1: + value: + data: + id: 12345 + date: '2021-08-15' + type: agyo + subject: Soggiorno di lavoro + filename: fatturaHotel.xml + amortization: 1 + rc_center: '' + invoice_number: '' + is_marked: false + is_detailed: false + e_invoice: false + document_type: expense + created_at: '2021-08-15 14:02:02' + updated_at: '2021-08-15 14:02:02' + entity: + id: 111 + name: Hotel Rubino Palace + next_due_date: '2021-08-15' + currency: + id: EUR + exchange_rate: '1.00000' + symbol: € + amount_net: 592 + amount_vat: 0 + amount_gross: 592 + amount_withholding_tax: 0 + amount_other_withholding_tax: 0 + tax_deductibility: 50 + vat_deductibility: 100 + items_list: null + payments_list: + - amount: 592 + due_date: '2021-08-15' + paid_date: '2021-08-15' + id: 777 + payment_terms: + days: 0 + type: standard + status: paid + payment_account: + id: 222 + name: Contanti + virtual: false + attachment_url: spesa_ger5i783t45hu6ti.pdf + attachment_preview_url: null + extra_data: null ModifyReceivedDocumentResponse: description: Modified document. content: