diff --git a/resources/js/packages/api/src/index.ts b/resources/js/packages/api/src/index.ts index 888c4046..9f3b1a92 100644 --- a/resources/js/packages/api/src/index.ts +++ b/resources/js/packages/api/src/index.ts @@ -114,6 +114,8 @@ export type ApiToken = ApiTokenIndexResponse['data'][0]; export type DetailedInvoiceResponse = ZodiosResponseByAlias; +export type DetailedInvoice = DetailedInvoiceResponse['data']; + export type InvoiceIndexEntry = ZodiosResponseByAlias['data'][0]; export type UpdateInvoiceSettings = ZodiosBodyByAlias; diff --git a/resources/js/packages/api/src/openapi.json.client.ts b/resources/js/packages/api/src/openapi.json.client.ts index 74a7ed21..d270f98b 100644 --- a/resources/js/packages/api/src/openapi.json.client.ts +++ b/resources/js/packages/api/src/openapi.json.client.ts @@ -1886,6 +1886,54 @@ const endpoints = makeApi([ }, ], }, + { + method: 'post', + path: '/v1/organizations/:organization/invoices/:invoice/copy', + alias: 'copyInvoice', + requestFormat: 'json', + parameters: [ + { + name: 'body', + type: 'Body', + schema: z.object({ reference: z.string() }).passthrough(), + }, + { + name: 'organization', + type: 'Path', + schema: z.string(), + }, + { + name: 'invoice', + type: 'Path', + schema: z.string(), + }, + ], + response: z.object({ data: DetailedInvoiceResource }).passthrough(), + errors: [ + { + status: 401, + description: `Unauthenticated`, + schema: z.object({ message: z.string() }).passthrough(), + }, + { + status: 403, + description: `Authorization error`, + schema: z.object({ message: z.string() }).passthrough(), + }, + { + status: 404, + description: `Not found`, + schema: z.object({ message: z.string() }).passthrough(), + }, + { + status: 422, + description: `Validation error`, + schema: z + .object({ message: z.string(), errors: z.record(z.array(z.string())) }) + .passthrough(), + }, + ], + }, { method: 'get', path: '/v1/organizations/:organization/invoices/:invoice',