From b1d11c0bbe54585aa68a99c91cec03f612f3ac24 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 23 Nov 2023 12:08:50 +1100 Subject: [PATCH] Updates for upload route --- openapi/api-docs.yaml | 203 +++++++++++++++++++------- openapi/paths.yaml | 76 +++++++++- openapi/paths/clients.yaml | 2 +- openapi/paths/credits.yaml | 19 ++- openapi/paths/payments.yaml | 19 ++- openapi/paths/products.yaml | 2 +- openapi/paths/projects.yaml | 19 ++- openapi/paths/purchase_orders.yaml | 19 ++- openapi/paths/quotes.yaml | 19 ++- openapi/paths/recurring_invoices.yaml | 19 ++- openapi/paths/tasks.yaml | 19 ++- openapi/paths/vendors.yaml | 19 ++- 12 files changed, 370 insertions(+), 65 deletions(-) diff --git a/openapi/api-docs.yaml b/openapi/api-docs.yaml index 850fd6485b0f..46f90976d1dc 100644 --- a/openapi/api-docs.yaml +++ b/openapi/api-docs.yaml @@ -9092,7 +9092,7 @@ paths: default: $ref: "#/components/responses/default" "/api/v1/tasks/{id}/upload": - put: + post: tags: - tasks summary: "Uploads a task document" @@ -9110,6 +9110,23 @@ paths: type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the Task object" @@ -9511,7 +9528,7 @@ paths: default: $ref: "#/components/responses/default" "/api/v1/projects/{id}/upload": - put: + post: tags: - projects summary: "Uploads a project document" @@ -9529,6 +9546,23 @@ paths: type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the Project object" @@ -9995,7 +10029,7 @@ paths: default: $ref: '#/components/responses/default' '/api/v1/clients/{id}/upload': - put: + post: tags: - clients summary: 'Add client document' @@ -10685,7 +10719,7 @@ paths: default: $ref: "#/components/responses/default" "/api/v1/credits/{id}/upload": - put: + post: tags: - credits summary: "Upload a credit document" @@ -10703,6 +10737,23 @@ paths: type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the Credit object" @@ -11213,7 +11264,7 @@ paths: $ref: "#/components/responses/default" "/api/v1/payments/{id}/upload": - put: + post: tags: - payments summary: "Upload a payment document" @@ -11231,6 +11282,23 @@ paths: type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the Payment object" @@ -12471,7 +12539,7 @@ paths: default: $ref: "#/components/responses/default" "/api/v1/recurring_invoices/{id}/upload": - put: + post: tags: - Recurring Invoices summary: "Add recurring invoice document" @@ -12489,6 +12557,23 @@ paths: type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the RecurringInvoice object" @@ -13000,7 +13085,7 @@ paths: default: $ref: "#/components/responses/default" "/api/v1/quotes/{id}/upload": - put: + post: tags: - quotes summary: "Upload a quote document" @@ -13018,6 +13103,23 @@ paths: type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the Quote object" @@ -13438,7 +13540,7 @@ paths: default: $ref: "#/components/responses/default" "/api/v1/purchase_orders/{id}/upload": - put: + post: tags: - Purchase Orders summary: "Uploads a purchase order document" @@ -13456,6 +13558,23 @@ paths: type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the Purchase Order object" @@ -13865,7 +13984,7 @@ paths: default: $ref: "#/components/responses/default" "/api/v1/vendors/{id}/upload": - put: + post: tags: - vendors summary: "Uploads a vendor document" @@ -13883,6 +14002,23 @@ paths: type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the Vendor object" @@ -17926,22 +18062,18 @@ components: description: 'The hashed if of the contact' type: string example: Opnel5aKBz - readOnly: true user_id: description: 'The hashed id of the user who created the contact' type: string example: Opnel5aKBz - readOnly: true company_id: description: 'The hashed id of the company' type: string example: Opnel5aKBz - readOnly: true client_id: description: 'The hashed id of the client' type: string example: Opnel5aKBz - readOnly: true first_name: description: 'The first name of the contact' type: string @@ -17978,26 +18110,18 @@ components: description: 'The terms of service which the contact has accpeted' type: string example: 'A long set of ToS' - readOnly: true password: description: 'The hashed password of the contact' type: string example: '*****' - confirmation_code: + confirmation-code: description: 'The confirmation code used to authenticate the contacts email address' type: string example: 333-sdjkh34gbasd - readOnly: true token: description: 'A uuid based token.' type: string example: 333-sdjkh34gbasd - readOnly: true - contact_key: - description: 'A unique identifier for the contact' - type: string - example: JD0X52bkfZlJRiroCJ0tcSiAjsJTntZ5uqKdiZ0a - readOnly: true is_primary: description: 'Defines is this contact is the primary contact for the client' type: boolean @@ -18019,37 +18143,31 @@ components: type: number format: integer example: '3' - readOnly: true email_verified_at: description: 'The date which the contact confirmed their email' type: number format: integer example: '134341234234' - readOnly: true last_login: description: Timestamp type: number format: integer example: '134341234234' - readOnly: true created_at: description: Timestamp type: number format: integer example: '134341234234' - readOnly: true updated_at: description: Timestamp type: number format: integer example: '134341234234' - readOnly: true deleted_at: description: Timestamp type: number format: integer example: '134341234234' - readOnly: true type: object ClientContactRequest: properties: @@ -18110,17 +18228,14 @@ components: description: 'The hashed id of the user id' type: string example: Opnel5aKBz - readOnly: true company_id: description: 'The hashed id of the company' type: string example: Opnel5aKBz - readOnly: true vendor_id: description: 'The hashed id of the vendor' type: string example: Opnel5aKBz - readOnly: true first_name: description: 'The first name of the contact' type: string @@ -18129,16 +18244,6 @@ components: description: 'The last name of the contact' type: string example: Windsor - contact_key: - description: 'A unique identifier for the contact' - type: string - example: JD0X52bkfZlJRiroCJ0tcSiAjsJTntZ5uqKdiZ0a - readOnly: true - confirmation_code: - description: 'The confirmation code used to authenticate the contacts email address' - type: string - example: 333-sdjkh34gbasd - readOnly: true phone: description: 'The contacts phone number' type: string @@ -18163,16 +18268,6 @@ components: description: 'The contact email address' type: string example: harry@windsor.com - email_verified_at: - description: 'The date which the contact confirmed their email' - type: number - format: integer - example: '134341234234' - readOnly: true - password: - description: 'The hashed password of the contact' - type: string - example: '*****' is_primary: description: 'Boolean flag determining if the contact is the primary contact for the vendor' type: boolean @@ -19504,6 +19599,10 @@ components: description: 'The hashed id of the company. This is a unique identifier for the company.' type: string example: Opnel5aKBz + client_id: + description: 'The hashed id of the client. This is a unique identifier for the client.' + type: string + example: Opnel5aKBz contacts: type: array items: @@ -19633,6 +19732,8 @@ components: type: string example: 'Bob the vendor' readOnly: true + settings: + $ref: '#/components/schemas/CompanySettings' type: object ClientSettings: required: diff --git a/openapi/paths.yaml b/openapi/paths.yaml index fe046713790d..2ac54bf343c2 100644 --- a/openapi/paths.yaml +++ b/openapi/paths.yaml @@ -1865,7 +1865,7 @@ paths: default: $ref: "#/components/responses/default" "/api/v1/companies/{id}/upload": - put: + post: tags: - companies summary: "Uploads a document to a company" @@ -1883,6 +1883,23 @@ paths: type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the client object" @@ -3405,7 +3422,7 @@ paths: default: $ref: "#/components/responses/default" "/api/v1/expenses/{id}/upload": - put: + post: tags: - expense summary: "Uploads a document to a expense" @@ -3423,6 +3440,23 @@ paths: type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the Expense object" @@ -3777,7 +3811,7 @@ paths: default: $ref: "#/components/responses/default" "/api/v1/group_settings/{id}/upload": - put: + post: tags: - group_settings summary: "Uploads a document to a group setting" @@ -3795,6 +3829,23 @@ paths: type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the Group Setting object" @@ -4902,7 +4953,7 @@ paths: default: $ref: "#/components/responses/default" "/api/v1/recurring_expenses/{id}/upload": - put: + post: tags: - recurring_expense summary: "Uploads a document to a recurring_expense" @@ -4920,6 +4971,23 @@ paths: type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the RecurringExpense object" diff --git a/openapi/paths/clients.yaml b/openapi/paths/clients.yaml index b89c8517f68c..c9e79860d4c1 100644 --- a/openapi/paths/clients.yaml +++ b/openapi/paths/clients.yaml @@ -438,7 +438,7 @@ default: $ref: '#/components/responses/default' '/api/v1/clients/{id}/upload': - put: + post: tags: - clients summary: 'Add client document' diff --git a/openapi/paths/credits.yaml b/openapi/paths/credits.yaml index d98dea8555fa..e4cb8a882271 100644 --- a/openapi/paths/credits.yaml +++ b/openapi/paths/credits.yaml @@ -385,7 +385,7 @@ default: $ref: "#/components/responses/default" "/api/v1/credits/{id}/upload": - put: + post: tags: - credits summary: "Upload a credit document" @@ -403,6 +403,23 @@ type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the Credit object" diff --git a/openapi/paths/payments.yaml b/openapi/paths/payments.yaml index cb4a4bf87ab7..87b43a47e13d 100644 --- a/openapi/paths/payments.yaml +++ b/openapi/paths/payments.yaml @@ -482,7 +482,7 @@ $ref: "#/components/responses/default" "/api/v1/payments/{id}/upload": - put: + post: tags: - payments summary: "Upload a payment document" @@ -500,6 +500,23 @@ type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the Payment object" diff --git a/openapi/paths/products.yaml b/openapi/paths/products.yaml index dfcc3ad6db63..0cafccb787ec 100644 --- a/openapi/paths/products.yaml +++ b/openapi/paths/products.yaml @@ -382,7 +382,7 @@ $ref: '#/components/responses/default' "/api/v1/products/{id}/upload": - put: + post: tags: - products summary: "Add product document" diff --git a/openapi/paths/projects.yaml b/openapi/paths/projects.yaml index 104e66c088ce..b736daa834d0 100644 --- a/openapi/paths/projects.yaml +++ b/openapi/paths/projects.yaml @@ -340,7 +340,7 @@ default: $ref: "#/components/responses/default" "/api/v1/projects/{id}/upload": - put: + post: tags: - projects summary: "Uploads a project document" @@ -358,6 +358,23 @@ type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the Project object" diff --git a/openapi/paths/purchase_orders.yaml b/openapi/paths/purchase_orders.yaml index dcdd3173c7c7..0dbf99a55d3b 100644 --- a/openapi/paths/purchase_orders.yaml +++ b/openapi/paths/purchase_orders.yaml @@ -392,7 +392,7 @@ default: $ref: "#/components/responses/default" "/api/v1/purchase_orders/{id}/upload": - put: + post: tags: - Purchase Orders summary: "Uploads a purchase order document" @@ -410,6 +410,23 @@ type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the Purchase Order object" diff --git a/openapi/paths/quotes.yaml b/openapi/paths/quotes.yaml index dfabf6442dfe..6d26a65217f5 100644 --- a/openapi/paths/quotes.yaml +++ b/openapi/paths/quotes.yaml @@ -483,7 +483,7 @@ default: $ref: "#/components/responses/default" "/api/v1/quotes/{id}/upload": - put: + post: tags: - quotes summary: "Upload a quote document" @@ -501,6 +501,23 @@ type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the Quote object" diff --git a/openapi/paths/recurring_invoices.yaml b/openapi/paths/recurring_invoices.yaml index 47560656b0ac..6ddef40f6e9a 100644 --- a/openapi/paths/recurring_invoices.yaml +++ b/openapi/paths/recurring_invoices.yaml @@ -499,7 +499,7 @@ default: $ref: "#/components/responses/default" "/api/v1/recurring_invoices/{id}/upload": - put: + post: tags: - Recurring Invoices summary: "Add recurring invoice document" @@ -517,6 +517,23 @@ type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the RecurringInvoice object" diff --git a/openapi/paths/tasks.yaml b/openapi/paths/tasks.yaml index b392d84f9eb0..f85eab59eed2 100644 --- a/openapi/paths/tasks.yaml +++ b/openapi/paths/tasks.yaml @@ -340,7 +340,7 @@ default: $ref: "#/components/responses/default" "/api/v1/tasks/{id}/upload": - put: + post: tags: - tasks summary: "Uploads a task document" @@ -358,6 +358,23 @@ type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the Task object" diff --git a/openapi/paths/vendors.yaml b/openapi/paths/vendors.yaml index 267221cf5200..d75a66763cca 100644 --- a/openapi/paths/vendors.yaml +++ b/openapi/paths/vendors.yaml @@ -340,7 +340,7 @@ default: $ref: "#/components/responses/default" "/api/v1/vendors/{id}/upload": - put: + post: tags: - vendors summary: "Uploads a vendor document" @@ -358,6 +358,23 @@ type: string format: string example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary responses: 200: description: "Returns the Vendor object"