@pimia/sdk 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.d.ts CHANGED
@@ -10,7 +10,18 @@ export interface paths {
10
10
  path?: never;
11
11
  cookie?: never;
12
12
  };
13
- /** Get accounting summary by quarter for a fiscal year */
13
+ /**
14
+ * Accounting summary. Two modes:
15
+ * @description - `year` (solo): array de 4 trimestres con revenue/expenses/vat/irpf/result.
16
+ * Lo consume AccountingSummaryReport.vue — su shape es contrato estable.
17
+ * - `from_date`+`to_date` (o `quarter`+`year`): objeto agregado del rango con
18
+ * total_sales, total_received, total_expenses, net_profit, vat_collected,
19
+ * vat_paid, vat_balance, irpf, counts y tax_breakdown. Con
20
+ * `group_by=customer` añade by_customer; con `group_by=category`, by_category.
21
+ * Lo consumen las tools MCP de informes (invoice-shelf-mcp).
22
+ *
23
+ * Importes en céntimos, como el resto de la API.
24
+ */
14
25
  get: operations["accountingSummary.index"];
15
26
  put?: never;
16
27
  post?: never;
@@ -69,6 +80,47 @@ export interface paths {
69
80
  patch?: never;
70
81
  trace?: never;
71
82
  };
83
+ "/approvals": {
84
+ parameters: {
85
+ query?: never;
86
+ header?: never;
87
+ path?: never;
88
+ cookie?: never;
89
+ };
90
+ get?: never;
91
+ put?: never;
92
+ /**
93
+ * POST /api/v1/approvals — el partner crea una propuesta (nace 'proposed'
94
+ * en modo preview, pendiente de la decisión del owner)
95
+ */
96
+ post: operations["approvals.store"];
97
+ delete?: never;
98
+ options?: never;
99
+ head?: never;
100
+ patch?: never;
101
+ trace?: never;
102
+ };
103
+ "/approvals/{id}": {
104
+ parameters: {
105
+ query?: never;
106
+ header?: never;
107
+ path?: never;
108
+ cookie?: never;
109
+ };
110
+ /**
111
+ * GET /api/v1/approvals/{id} — estado de una propuesta DEL client del
112
+ * token. Escopeado por origin_client_id + tenant: cualquier otra cosa es
113
+ * 404 (no se filtra ni la existencia)
114
+ */
115
+ get: operations["approvals.show"];
116
+ put?: never;
117
+ post?: never;
118
+ delete?: never;
119
+ options?: never;
120
+ head?: never;
121
+ patch?: never;
122
+ trace?: never;
123
+ };
72
124
  "/auth/login": {
73
125
  parameters: {
74
126
  query?: never;
@@ -436,6 +488,43 @@ export interface paths {
436
488
  patch?: never;
437
489
  trace?: never;
438
490
  };
491
+ "/custom-fields": {
492
+ parameters: {
493
+ query?: never;
494
+ header?: never;
495
+ path?: never;
496
+ cookie?: never;
497
+ };
498
+ /** Display a listing of the resource */
499
+ get: operations["custom-fields.index"];
500
+ put?: never;
501
+ /** Store a newly created resource in storage */
502
+ post: operations["custom-fields.store"];
503
+ delete?: never;
504
+ options?: never;
505
+ head?: never;
506
+ patch?: never;
507
+ trace?: never;
508
+ };
509
+ "/custom-fields/{customField}": {
510
+ parameters: {
511
+ query?: never;
512
+ header?: never;
513
+ path?: never;
514
+ cookie?: never;
515
+ };
516
+ /** Display the specified resource */
517
+ get: operations["custom-fields.show"];
518
+ /** Update the specified resource in storage */
519
+ put: operations["custom-fields.update"];
520
+ post?: never;
521
+ /** Remove the specified resource from storage */
522
+ delete: operations["custom-fields.destroy"];
523
+ options?: never;
524
+ head?: never;
525
+ patch?: never;
526
+ trace?: never;
527
+ };
439
528
  "/customers/{customer}/stats": {
440
529
  parameters: {
441
530
  query?: never;
@@ -842,7 +931,14 @@ export interface paths {
842
931
  };
843
932
  get?: never;
844
933
  put?: never;
845
- /** Send a reset link to the given user */
934
+ /**
935
+ * Igual que el `sendResetLinkEmail()` del trait, pero con la validación en
936
+ * un FormRequest en vez de en su `validateEmail()` privado: ahí dentro el
937
+ * generador del OpenAPI no la ve y este endpoint se publicaba sin cuerpo.
938
+ * Mismas reglas (`required|email`)
939
+ * @description La RESPUESTA, en cambio, ya no es la del trait: es SIEMPRE la misma,
940
+ * exista el correo o no. Ver `respuestaNeutra()`.
941
+ */
846
942
  post: operations["forgotPassword.sendResetLinkEmail"];
847
943
  delete?: never;
848
944
  options?: never;
@@ -2242,7 +2338,15 @@ export interface paths {
2242
2338
  path?: never;
2243
2339
  cookie?: never;
2244
2340
  };
2245
- /** Handle the incoming request */
2341
+ /**
2342
+ * Handle the incoming request
2343
+ * @description Recibía un `Request` pelado y **no validaba nada**, al revés que las
2344
+ * vistas previas de presupuesto y factura. La consecuencia no era un error
2345
+ * sino algo peor: sin `body` la previsualización se renderizaba igual, con
2346
+ * el cuerpo vacío, así que enseñaba un correo que no era el que se iba a
2347
+ * mandar — y el envío de después sí valida, con lo que la vista previa
2348
+ * mentía justo en el caso en que había algo que corregir.
2349
+ */
2246
2350
  get: operations["payment.sendPaymentPreview"];
2247
2351
  put?: never;
2248
2352
  post?: never;
@@ -2757,6 +2861,26 @@ export interface components {
2757
2861
  };
2758
2862
  /** Appointment */
2759
2863
  Appointment: string[];
2864
+ /**
2865
+ * AppointmentRequest
2866
+ * @description Cita de agenda. Reglas movidas literalmente desde el método privado
2867
+ * `AppointmentController::validated()`, que el generador del OpenAPI no podía
2868
+ * ver: solo recorre el AST de la propia acción, no los ayudantes a los que
2869
+ * llama. Ver docs/guia-integradores.md.
2870
+ */
2871
+ AppointmentRequest: {
2872
+ customer_id?: number | null;
2873
+ item_id?: number | null;
2874
+ staff_user_id?: number | null;
2875
+ /** Format: date-time */
2876
+ starts_at: string;
2877
+ /** Format: date-time */
2878
+ ends_at?: string | null;
2879
+ /** @enum {string|null} */
2880
+ status?: "booked" | "confirmed" | "attended" | "no_show" | "cancelled" | null;
2881
+ source?: string | null;
2882
+ notes?: string | null;
2883
+ };
2760
2884
  /** BankAccount */
2761
2885
  BankAccount: {
2762
2886
  id: number;
@@ -2822,18 +2946,51 @@ export interface components {
2822
2946
  exchange_rate: string;
2823
2947
  }[];
2824
2948
  };
2949
+ /**
2950
+ * ChangeInvoiceStatusRequest
2951
+ * @description Cambio de estado de una factura (`POST /invoices/{invoice}/status`).
2952
+ *
2953
+ * El juego de valores es CERRADO y son exactamente las tres transiciones que
2954
+ * el controlador implementa. Antes se aceptaba cualquier string: `DRAFT`,
2955
+ * `VIEWED` y `OVERDUE` —que el servidor MCP llegó a anunciar— respondían
2956
+ * `200 {"success": true}` sin tocar la factura, así que ni el panel ni un
2957
+ * agente podían distinguir un cambio real de uno que no ocurrió. Mismo patrón
2958
+ * que ChangeEstimateStatusController, que ya validaba así.
2959
+ *
2960
+ * Los tres que NO están, y por qué:
2961
+ * - `DRAFT`: volver a borrador no existe. Publicar asigna número oficial y
2962
+ * registra en VeriFactu; deshacerlo se hace con una rectificativa.
2963
+ * - `VIEWED`: lo pone el servidor cuando el cliente abre el PDF
2964
+ * (InvoicePdfController), no es una transición que se pida.
2965
+ * - `OVERDUE`: no es un estado almacenado sino un filtro derivado de
2966
+ * `due_date` + `paid_status` (ver el scope de Invoice).
2967
+ */
2968
+ ChangeInvoiceStatusRequest: {
2969
+ /**
2970
+ * @description PUBLISHED asigna el número oficial y lanza el registro en
2971
+ * VeriFactu; SENT publica antes si aún era borrador; COMPLETED
2972
+ * exige que ya esté publicada o enviada.
2973
+ * @enum {string}
2974
+ */
2975
+ status: "PUBLISHED" | "SENT" | "COMPLETED";
2976
+ /**
2977
+ * @description Slug de la plantilla a fijar al publicar. Si no existe en la
2978
+ * compañía, se ignora en silencio y la factura conserva la suya.
2979
+ */
2980
+ template_name?: string | null;
2981
+ };
2825
2982
  /** CompanyResource */
2826
2983
  CompanyResource: {
2827
- id: string;
2984
+ id: number;
2828
2985
  name: string;
2829
2986
  trade_name: string;
2830
- vat_id: string;
2987
+ vat_id: string | null;
2831
2988
  tax_id: string;
2832
- logo: string;
2989
+ logo: string | null;
2833
2990
  logo_path: string;
2834
- unique_hash: string;
2991
+ unique_hash: string | null;
2835
2992
  owner_id: string;
2836
- slug: string;
2993
+ slug: string | null;
2837
2994
  address?: components["schemas"]["AddressResource"];
2838
2995
  roles: components["schemas"]["RoleResource"][];
2839
2996
  };
@@ -2869,35 +3026,60 @@ export interface components {
2869
3026
  };
2870
3027
  /** CountryResource */
2871
3028
  CountryResource: {
2872
- id: string;
3029
+ id: number;
2873
3030
  code: string;
2874
3031
  name: string;
2875
3032
  phone_code: string;
2876
3033
  };
2877
3034
  /** Currency */
2878
- Currency: string[];
3035
+ Currency: {
3036
+ id: number;
3037
+ name: string;
3038
+ code: string;
3039
+ symbol: string | null;
3040
+ precision: number;
3041
+ exchange_rate: string | null;
3042
+ swap_currency_symbol: string;
3043
+ thousand_separator: string;
3044
+ decimal_separator: string;
3045
+ /** Format: date-time */
3046
+ created_at: string | null;
3047
+ /** Format: date-time */
3048
+ updated_at: string | null;
3049
+ };
2879
3050
  /** CurrencyResource */
2880
3051
  CurrencyResource: {
2881
- id: string;
3052
+ id: number;
2882
3053
  name: string;
2883
3054
  code: string;
2884
- symbol: string;
2885
- precision: string;
3055
+ symbol: string | null;
3056
+ precision: number;
2886
3057
  thousand_separator: string;
2887
3058
  decimal_separator: string;
2888
3059
  swap_currency_symbol: string;
2889
- exchange_rate: string;
3060
+ exchange_rate: string | null;
3061
+ };
3062
+ /** CustomFieldRequest */
3063
+ CustomFieldRequest: {
3064
+ name: string;
3065
+ label: string;
3066
+ model_type: string;
3067
+ order: string;
3068
+ type: string;
3069
+ is_required: boolean;
3070
+ options?: string[];
3071
+ placeholder?: string | null;
2890
3072
  };
2891
3073
  /** CustomFieldResource */
2892
3074
  CustomFieldResource: {
2893
- id: string;
3075
+ id: number;
2894
3076
  name: string;
2895
3077
  slug: string;
2896
3078
  label: string;
2897
3079
  model_type: string;
2898
3080
  type: string;
2899
- placeholder: string;
2900
- options: string;
3081
+ placeholder: string | null;
3082
+ options: string | null;
2901
3083
  boolean_answer: string;
2902
3084
  date_answer: string;
2903
3085
  time_answer: string;
@@ -2906,29 +3088,29 @@ export interface components {
2906
3088
  date_time_answer: string;
2907
3089
  is_required: string;
2908
3090
  in_use: string;
2909
- order: string;
2910
- company_id: string;
3091
+ order: number;
3092
+ company_id: number | null;
2911
3093
  default_answer: string;
2912
- company?: components["schemas"]["CompanyResource"];
3094
+ company?: components["schemas"]["CompanyResource"] | null;
2913
3095
  };
2914
3096
  /** CustomFieldValueResource */
2915
3097
  CustomFieldValueResource: {
2916
- id: string;
3098
+ id: number;
2917
3099
  custom_field_valuable_type: string;
2918
- custom_field_valuable_id: string;
3100
+ custom_field_valuable_id: number;
2919
3101
  type: string;
2920
- boolean_answer: string;
2921
- date_answer: string;
2922
- time_answer: string;
2923
- string_answer: string;
2924
- number_answer: string;
2925
- date_time_answer: string;
2926
- custom_field_id: string;
2927
- company_id: string;
3102
+ boolean_answer: string | null;
3103
+ date_answer: string | null;
3104
+ time_answer: string | null;
3105
+ string_answer: string | null;
3106
+ number_answer: string | null;
3107
+ date_time_answer: string | null;
3108
+ custom_field_id: number;
3109
+ company_id: number | null;
2928
3110
  default_answer: string;
2929
3111
  default_formatted_answer: string | null;
2930
3112
  custom_field?: components["schemas"]["CustomFieldResource"];
2931
- company?: components["schemas"]["CompanyResource"];
3113
+ company?: components["schemas"]["CompanyResource"] | null;
2932
3114
  };
2933
3115
  /** Customer */
2934
3116
  Customer: {
@@ -3037,6 +3219,20 @@ export interface components {
3037
3219
  DeleteReceivedInvoicesRequest: {
3038
3220
  ids: string;
3039
3221
  };
3222
+ /**
3223
+ * DeleteRecurringInvoicesRequest
3224
+ * @description Borrado múltiple de facturas recurrentes (`POST /recurring-invoices/delete`).
3225
+ * Mismo patrón que DeleteEstimatesRequest / DeleteInvoiceRequest, que es como
3226
+ * se declara el resto de borrados múltiples del panel.
3227
+ *
3228
+ * El endpoint leía `$request->ids` sin validar y
3229
+ * `RecurringInvoice::deleteRecurringInvoice()` itera sin comprobar el `find()`,
3230
+ * así que un id inexistente reventaba con un 500. Con el `exists` pasa a ser un
3231
+ * 422 que dice cuál falla.
3232
+ */
3233
+ DeleteRecurringInvoicesRequest: {
3234
+ ids: number[];
3235
+ };
3040
3236
  /** DeleteSuppliersRequest */
3041
3237
  DeleteSuppliersRequest: {
3042
3238
  ids: number[];
@@ -3152,6 +3348,74 @@ export interface components {
3152
3348
  company?: components["schemas"]["CompanyResource"];
3153
3349
  currency?: components["schemas"]["CurrencyResource"];
3154
3350
  };
3351
+ /** EstimatesRequest */
3352
+ EstimatesRequest: {
3353
+ estimate_date: string;
3354
+ expiry_date?: string | null;
3355
+ customer_id?: number | null;
3356
+ lead_id?: number | null;
3357
+ /**
3358
+ * @description Opcional en el alta: si no llega, lo genera el servidor con el mismo
3359
+ * SerialNumberFormatter que alimenta a GET /next-number, que es de donde
3360
+ * lo saca el panel. Exigirlo obligaba a un cliente de la API a replicar el
3361
+ * formato de numeración de la empresa para poder crear un presupuesto.
3362
+ * En PUT sigue siendo obligatorio (más abajo): el documento ya tiene uno.
3363
+ */
3364
+ estimate_number?: string | null;
3365
+ exchange_rate?: string | null;
3366
+ /**
3367
+ * @description Descuento global: opcional en el contrato y rellenado a 0 en
3368
+ * prepareForValidation (el panel lo manda siempre, un cliente de la API
3369
+ * no tiene por qué). Ver DocumentHeaderPayload.
3370
+ */
3371
+ discount?: number | null;
3372
+ discount_val?: number | null;
3373
+ /**
3374
+ * @description Agregados: el servidor es su oráculo —DocumentTotals los recompone desde
3375
+ * las líneas y getEstimatePayload los sobrescribe—, así que exigirlos era
3376
+ * pedirle al cliente un cálculo que se iba a descartar. Si llegan, siguen
3377
+ * comprobándose contra las líneas (ValidatesDocumentTotals).
3378
+ */
3379
+ sub_total?: number | null;
3380
+ total?: number | null;
3381
+ tax?: string | null;
3382
+ template_name?: string | null;
3383
+ items: {
3384
+ description?: string | null;
3385
+ name: string;
3386
+ quantity: number;
3387
+ price: number;
3388
+ /**
3389
+ * @description Derivables: opcionales en el contrato y rellenados en prepareForValidation
3390
+ * (el panel los manda siempre; un cliente de la API no tiene por qué).
3391
+ */
3392
+ discount_val?: number | null;
3393
+ tax?: number | null;
3394
+ total?: number | null;
3395
+ /**
3396
+ * @description Impuestos. El importe es derivable a partir del porcentaje
3397
+ * (DocumentTaxPayload), así que un cliente de la API puede declarar
3398
+ * «IVA 21 %» sin calcular nada; el panel sigue mandándolo ya hecho.
3399
+ */
3400
+ taxes?: {
3401
+ tax_type_id?: number | null;
3402
+ percent?: number | null;
3403
+ amount?: number | null;
3404
+ }[] | null;
3405
+ }[];
3406
+ taxes?: {
3407
+ tax_type_id?: number | null;
3408
+ percent?: number | null;
3409
+ amount?: number | null;
3410
+ }[] | null;
3411
+ /**
3412
+ * @description Sin `in:YES,NO`: hay documentos antiguos persistidos con 'NO ' (el
3413
+ * espacio de más que arrastraba el payload de aquí), y el panel reenvía
3414
+ * al editar lo que leyó. Se normaliza al leerlo, no se rechaza.
3415
+ */
3416
+ tax_per_item?: string | null;
3417
+ tax_included?: boolean | null;
3418
+ };
3155
3419
  /** ExpenseCategoryRequest */
3156
3420
  ExpenseCategoryRequest: {
3157
3421
  name: string;
@@ -3167,6 +3431,24 @@ export interface components {
3167
3431
  formatted_created_at: string;
3168
3432
  company?: components["schemas"]["CompanyResource"];
3169
3433
  };
3434
+ /** ExpenseRequest */
3435
+ ExpenseRequest: {
3436
+ expense_date: string;
3437
+ expense_number?: string | null;
3438
+ expense_category_id: string;
3439
+ exchange_rate?: string | null;
3440
+ payment_method_id?: string | null;
3441
+ amount: string;
3442
+ customer_id?: string | null;
3443
+ supplier_id?: string | null;
3444
+ notes?: string | null;
3445
+ currency_id: string;
3446
+ /**
3447
+ * Format: binary
3448
+ * @description Maximum file size: 20000 kilobytes.
3449
+ */
3450
+ attachment_receipt?: string | null;
3451
+ };
3170
3452
  /** ExpenseResource */
3171
3453
  ExpenseResource: {
3172
3454
  id: string;
@@ -3197,6 +3479,23 @@ export interface components {
3197
3479
  currency?: components["schemas"]["CurrencyResource"];
3198
3480
  payment_method?: components["schemas"]["PaymentMethodResource"];
3199
3481
  };
3482
+ /**
3483
+ * ForgotPasswordRequest
3484
+ * @description Envío del enlace de restablecimiento (`POST /auth/password/email`).
3485
+ *
3486
+ * Mismas reglas que el `validateEmail()` del trait
3487
+ * `Illuminate\Foundation\Auth\SendsPasswordResetEmails` (laravel/ui), palabra
3488
+ * por palabra. Estaban ahí dentro y por eso el OpenAPI publicaba este endpoint
3489
+ * sin cuerpo: el generador solo mira la acción del controlador, y la acción
3490
+ * venía entera del trait.
3491
+ */
3492
+ ForgotPasswordRequest: {
3493
+ /**
3494
+ * Format: email
3495
+ * @description Correo de la cuenta. La respuesta no distingue si existe o no.
3496
+ */
3497
+ email: string;
3498
+ };
3200
3499
  /** InvestmentAssetResource */
3201
3500
  InvestmentAssetResource: {
3202
3501
  id: string;
@@ -3331,6 +3630,22 @@ export interface components {
3331
3630
  company?: components["schemas"]["CompanyResource"];
3332
3631
  currency?: components["schemas"]["CurrencyResource"];
3333
3632
  };
3633
+ /**
3634
+ * InvoiceSeriesRequest
3635
+ * @description Serie de numeración de facturas. Reglas movidas literalmente desde el método
3636
+ * privado `InvoiceSeriesController::validatedData()`, que el generador del
3637
+ * OpenAPI no podía ver: solo recorre el AST de la propia acción, no los
3638
+ * ayudantes a los que llama. Ver docs/guia-integradores.md.
3639
+ */
3640
+ InvoiceSeriesRequest: {
3641
+ code: string;
3642
+ name: string;
3643
+ number_format?: string | null;
3644
+ default_template_id?: number | null;
3645
+ next_sequence?: number;
3646
+ is_default?: boolean;
3647
+ is_active?: boolean;
3648
+ };
3334
3649
  /** InvoiceSeriesResource */
3335
3650
  InvoiceSeriesResource: {
3336
3651
  id: string;
@@ -3349,6 +3664,46 @@ export interface components {
3349
3664
  created_at: string;
3350
3665
  updated_at: string;
3351
3666
  };
3667
+ /**
3668
+ * InvoiceTemplatePreviewRequest
3669
+ * @description Previsualización en PDF de una plantilla YA GUARDADA
3670
+ * (`POST /invoice-templates/{invoiceTemplate}/preview`).
3671
+ *
3672
+ * Ojo, el cuerpo aquí NO es el del previsualizador genérico
3673
+ * `POST /templates/preview` (ese sí recibe `config` y `base_template` sueltos y
3674
+ * los valida en línea, así que el OpenAPI ya los publicaba). En esta ruta
3675
+ * `InvoiceTemplateController::preview()` hace `merge()` de `config`,
3676
+ * `base_template` y `template_id` **desde la plantilla de la ruta**, pisando lo
3677
+ * que mande el cliente. Lo único que el cliente controla de verdad es lo de
3678
+ * abajo, y eso es lo que el contrato debe decir.
3679
+ */
3680
+ InvoiceTemplatePreviewRequest: {
3681
+ /**
3682
+ * @description Factura de la que sacar los datos de muestra. Sin ella se coge
3683
+ * una cualquiera de la compañía que tenga líneas y cliente.
3684
+ */
3685
+ invoice_id?: number | null;
3686
+ /**
3687
+ * @description Membrete aún no guardado (editor): data-URI para verlo al
3688
+ * instante. 5 MB de imagen ≈ 7 M de caracteres en base64.
3689
+ */
3690
+ letterhead?: string | null;
3691
+ };
3692
+ /**
3693
+ * InvoiceTemplateRequest
3694
+ * @description Plantilla de factura. Reglas movidas literalmente desde el método privado
3695
+ * `InvoiceTemplateController::validatedData()`, que el generador del OpenAPI no
3696
+ * podía ver: solo recorre el AST de la propia acción, no los ayudantes a los
3697
+ * que llama. Ver docs/guia-integradores.md.
3698
+ */
3699
+ InvoiceTemplateRequest: {
3700
+ name: string;
3701
+ slug?: string;
3702
+ /** @enum {string} */
3703
+ base_template?: "invoice1" | "invoice2" | "invoice3" | "invoice4" | "invoice5" | "invoice6" | "invoice7" | "invoice8" | "invoice9";
3704
+ config?: string[];
3705
+ is_default?: boolean;
3706
+ };
3352
3707
  /** InvoiceTemplateResource */
3353
3708
  InvoiceTemplateResource: {
3354
3709
  id: string;
@@ -3364,7 +3719,72 @@ export interface components {
3364
3719
  updated_at: string;
3365
3720
  };
3366
3721
  /** InvoicesRequest */
3367
- InvoicesRequest: Record<string, never>;
3722
+ InvoicesRequest: {
3723
+ invoice_date: string;
3724
+ due_date?: string | null;
3725
+ customer_id: number;
3726
+ invoice_number?: string | null;
3727
+ exchange_rate?: string | null;
3728
+ /**
3729
+ * @description Descuento global: opcional en el contrato y rellenado a 0 en
3730
+ * prepareForValidation (el panel lo manda siempre, un cliente de la API
3731
+ * no tiene por qué). Ver DocumentHeaderPayload.
3732
+ */
3733
+ discount?: number | null;
3734
+ discount_val?: number | null;
3735
+ /**
3736
+ * @description Agregados: el servidor es su oráculo —DocumentTotals los recompone desde
3737
+ * las líneas y getInvoicePayload los sobrescribe—, así que exigirlos era
3738
+ * pedirle al cliente un cálculo que se iba a descartar. Si llegan, siguen
3739
+ * comprobándose contra las líneas (ValidatesDocumentTotals).
3740
+ */
3741
+ sub_total?: number | null;
3742
+ total?: number | null;
3743
+ tax?: string | null;
3744
+ /**
3745
+ * @description Opcional como en EstimatesRequest: getInvoicePayload cae a 'invoice1'.
3746
+ * Exigirlo obligaba a un cliente de la API a conocer el nombre interno de
3747
+ * una plantilla para poder emitir una factura.
3748
+ */
3749
+ template_name?: string | null;
3750
+ invoice_series_id?: number | null;
3751
+ payment_method_id?: number | null;
3752
+ items: {
3753
+ description?: string | null;
3754
+ name: string;
3755
+ quantity: number;
3756
+ price: number;
3757
+ /**
3758
+ * @description Derivables: opcionales en el contrato y rellenados en prepareForValidation
3759
+ * (el panel los manda siempre; un cliente de la API no tiene por qué).
3760
+ */
3761
+ discount_val?: number | null;
3762
+ tax?: number | null;
3763
+ total?: number | null;
3764
+ /**
3765
+ * @description Impuestos. El importe es derivable a partir del porcentaje
3766
+ * (DocumentTaxPayload), así que un cliente de la API puede declarar
3767
+ * «IVA 21 %» sin calcular nada; el panel sigue mandándolo ya hecho.
3768
+ */
3769
+ taxes?: {
3770
+ tax_type_id?: number | null;
3771
+ percent?: number | null;
3772
+ amount?: number | null;
3773
+ }[] | null;
3774
+ }[];
3775
+ taxes?: {
3776
+ tax_type_id?: number | null;
3777
+ percent?: number | null;
3778
+ amount?: number | null;
3779
+ }[] | null;
3780
+ /**
3781
+ * @description Sin `in:YES,NO`: hay documentos antiguos persistidos con 'NO ' (el
3782
+ * espacio de más que arrastra EstimatesRequest), y el panel reenvía al
3783
+ * editar lo que leyó. Se normaliza al leerlo, no se rechaza.
3784
+ */
3785
+ tax_per_item?: string | null;
3786
+ tax_included?: boolean | null;
3787
+ };
3368
3788
  /** ItemCategory */
3369
3789
  ItemCategory: string[];
3370
3790
  /** ItemResource */
@@ -3507,7 +3927,19 @@ export interface components {
3507
3927
  device_name: string;
3508
3928
  };
3509
3929
  /** Note */
3510
- Note: string[];
3930
+ Note: {
3931
+ id: number;
3932
+ type: string;
3933
+ name: string | null;
3934
+ notes: string | null;
3935
+ noteable_type: string;
3936
+ noteable_id: number;
3937
+ company_id: number | null;
3938
+ /** Format: date-time */
3939
+ created_at: string | null;
3940
+ /** Format: date-time */
3941
+ updated_at: string | null;
3942
+ };
3511
3943
  /** PaymentMethodRequest */
3512
3944
  PaymentMethodRequest: {
3513
3945
  name: string;
@@ -3520,6 +3952,17 @@ export interface components {
3520
3952
  type: string;
3521
3953
  company?: components["schemas"]["CompanyResource"];
3522
3954
  };
3955
+ /** PaymentRequest */
3956
+ PaymentRequest: {
3957
+ payment_date: string;
3958
+ customer_id: string;
3959
+ exchange_rate?: string | null;
3960
+ amount: number;
3961
+ payment_number: string;
3962
+ invoice_id?: string | null;
3963
+ payment_method_id?: string | null;
3964
+ notes?: string | null;
3965
+ };
3523
3966
  /** PaymentResource */
3524
3967
  PaymentResource: {
3525
3968
  id: string;
@@ -3625,6 +4068,32 @@ export interface components {
3625
4068
  base_total: string;
3626
4069
  taxes?: components["schemas"]["TaxResource"][];
3627
4070
  };
4071
+ /** ReceivedInvoiceRequest */
4072
+ ReceivedInvoiceRequest: {
4073
+ received_invoice_date: string;
4074
+ due_date?: string | null;
4075
+ supplier_id: string;
4076
+ received_invoice_number: string;
4077
+ exchange_rate?: string | null;
4078
+ discount: number;
4079
+ discount_val: number;
4080
+ sub_total: number;
4081
+ total: number;
4082
+ tax: string;
4083
+ items: {
4084
+ name: string;
4085
+ quantity: number;
4086
+ price: number;
4087
+ description?: string | null;
4088
+ /**
4089
+ * @description Derivables: opcionales en el contrato y rellenados en prepareForValidation
4090
+ * (el panel los manda siempre; un cliente de la API no tiene por qué).
4091
+ */
4092
+ discount_val?: number | null;
4093
+ tax?: number | null;
4094
+ total?: number | null;
4095
+ }[];
4096
+ };
3628
4097
  /** ReceivedInvoiceResource */
3629
4098
  ReceivedInvoiceResource: {
3630
4099
  id: string;
@@ -3670,6 +4139,84 @@ export interface components {
3670
4139
  company?: components["schemas"]["CompanyResource"];
3671
4140
  currency?: components["schemas"]["CurrencyResource"];
3672
4141
  };
4142
+ /** RecurringInvoiceRequest */
4143
+ RecurringInvoiceRequest: {
4144
+ starts_at: string;
4145
+ /**
4146
+ * @description Los tres de abajo el panel los manda siempre porque su formulario los
4147
+ * tiene a mano (stub/recurring-invoice.js: send_automatically true, status
4148
+ * ACTIVE, limit_by NONE). Exigirlos obligaba a un cliente de la API a
4149
+ * declarar decisiones que tienen un valor por defecto obvio; los pone
4150
+ * getRecurringInvoicePayload con ese mismo valor.
4151
+ */
4152
+ send_automatically?: boolean | null;
4153
+ status?: string | null;
4154
+ limit_by?: string | null;
4155
+ customer_id: number;
4156
+ exchange_rate?: string | null;
4157
+ /**
4158
+ * @description Descuento global: opcional en el contrato y rellenado a 0 en
4159
+ * prepareForValidation (el panel lo manda siempre, un cliente de la API
4160
+ * no tiene por qué). Ver DocumentHeaderPayload.
4161
+ */
4162
+ discount?: number | null;
4163
+ discount_val?: number | null;
4164
+ /**
4165
+ * @description Agregados: desde este cambio el servidor es su oráculo también aquí
4166
+ * —DocumentTotals los recompone desde las líneas y
4167
+ * getRecurringInvoicePayload los sobrescribe—, así que exigirlos era
4168
+ * pedirle al cliente un cálculo que se va a descartar. Si llegan, se
4169
+ * comprueban contra las líneas (ValidatesDocumentTotals).
4170
+ */
4171
+ sub_total?: number | null;
4172
+ total?: number | null;
4173
+ tax?: string | null;
4174
+ /**
4175
+ * @description Igual que en facturas y presupuestos desde el #296: si no llega, la pone
4176
+ * el payload. Un cliente de la API no tiene por qué conocer el nombre
4177
+ * interno de una plantilla.
4178
+ */
4179
+ template_name?: string | null;
4180
+ frequency: string;
4181
+ limit_count?: string;
4182
+ limit_date?: string;
4183
+ items: {
4184
+ name: string;
4185
+ quantity: number;
4186
+ price: number;
4187
+ description?: string | null;
4188
+ /**
4189
+ * @description Derivables: opcionales en el contrato y rellenados en prepareForValidation
4190
+ * (el panel los manda siempre; un cliente de la API no tiene por qué).
4191
+ */
4192
+ discount_val?: number | null;
4193
+ tax?: number | null;
4194
+ total?: number | null;
4195
+ /**
4196
+ * @description Impuestos, por línea o de documento. El `amount` es opcional: si no
4197
+ * llega, lo deriva el servidor del porcentaje (DocumentTaxPayload), así
4198
+ * que un cliente de la API puede declarar «IVA 21 %» sin calcular nada;
4199
+ * el panel sigue mandándolo ya hecho.
4200
+ */
4201
+ taxes?: {
4202
+ tax_type_id?: number | null;
4203
+ percent?: number | null;
4204
+ amount?: number | null;
4205
+ }[] | null;
4206
+ }[];
4207
+ taxes?: {
4208
+ tax_type_id?: number | null;
4209
+ percent?: number | null;
4210
+ amount?: number | null;
4211
+ }[] | null;
4212
+ /**
4213
+ * @description Sin `in:YES,NO`: hay documentos antiguos persistidos con 'NO ' (el
4214
+ * espacio de más que arrastraba este mismo request), y el panel reenvía
4215
+ * al editar lo que leyó. Se normaliza al leerlo, no se rechaza.
4216
+ */
4217
+ tax_per_item?: string | null;
4218
+ tax_included?: boolean | null;
4219
+ };
3673
4220
  /** RecurringInvoiceResource */
3674
4221
  RecurringInvoiceResource: {
3675
4222
  id: string;
@@ -3713,7 +4260,16 @@ export interface components {
3713
4260
  currency?: components["schemas"]["CurrencyResource"];
3714
4261
  };
3715
4262
  /** Role */
3716
- Role: string[];
4263
+ Role: {
4264
+ id: number;
4265
+ name: string;
4266
+ title: string | null;
4267
+ scope: number | null;
4268
+ /** Format: date-time */
4269
+ created_at: string | null;
4270
+ /** Format: date-time */
4271
+ updated_at: string | null;
4272
+ };
3717
4273
  /** RoleResource */
3718
4274
  RoleResource: {
3719
4275
  id: string;
@@ -3723,7 +4279,12 @@ export interface components {
3723
4279
  formatted_created_at: string | null;
3724
4280
  abilities: string | string[];
3725
4281
  };
3726
- /** SendEstimatesRequest */
4282
+ /**
4283
+ * SendEstimatesRequest
4284
+ * @description Mandar un presupuesto por correo (`POST /estimates/{id}/send`) y su vista
4285
+ * previa. Todo el cuerpo —y el remitente que pone la instancia— está en
4286
+ * {@see SendDocumentMailRequest}.
4287
+ */
3727
4288
  SendEstimatesRequest: {
3728
4289
  subject: string;
3729
4290
  body: string;
@@ -3732,16 +4293,26 @@ export interface components {
3732
4293
  cc?: string | null;
3733
4294
  bcc?: string | null;
3734
4295
  };
3735
- /** SendInvoiceRequest */
4296
+ /**
4297
+ * SendInvoiceRequest
4298
+ * @description Mandar una factura por correo (`POST /invoices/{id}/send`) y su vista previa.
4299
+ * Todo el cuerpo —y el remitente que pone la instancia— está en
4300
+ * {@see SendDocumentMailRequest}.
4301
+ */
3736
4302
  SendInvoiceRequest: {
3737
- body: string;
3738
4303
  subject: string;
4304
+ body: string;
3739
4305
  from: string;
3740
4306
  to: string;
3741
4307
  cc?: string | null;
3742
4308
  bcc?: string | null;
3743
4309
  };
3744
- /** SendPaymentRequest */
4310
+ /**
4311
+ * SendPaymentRequest
4312
+ * @description Mandar un recibo de pago por correo (`POST /payments/{id}/send`) y su vista
4313
+ * previa. Todo el cuerpo —y el remitente que pone la instancia— está en
4314
+ * {@see SendDocumentMailRequest}.
4315
+ */
3745
4316
  SendPaymentRequest: {
3746
4317
  subject: string;
3747
4318
  body: string;
@@ -3756,6 +4327,54 @@ export interface components {
3756
4327
  formatted_execution_date: string;
3757
4328
  formatted_total: string;
3758
4329
  };
4330
+ /**
4331
+ * StoreApprovalRequest
4332
+ * @description POST /api/v1/approvals (paso 2, plataforma de integradores) — una app de
4333
+ * partner propone un write-effect sobre el tenant. La forma de `proposal` es
4334
+ * EXACTAMENTE la del contrato estructurado del flujo de delegación
4335
+ * (summary + changes[] + evals[], ver
4336
+ * {@see \App\Http\Controllers\Api\TenantDelegationCallbackController::structuredResultRules}):
4337
+ * misma primitiva, mismo panel, misma decisión del owner.
4338
+ *
4339
+ * La autorización NO va aquí: es scope (api.scopes, dominio `approvals`) +
4340
+ * credencial de partner (token OAuth con ability `approvals:write`), que el
4341
+ * controller comprueba explícitamente — el partner no es owner del tenant y no
4342
+ * pasa gate de Bouncer.
4343
+ */
4344
+ StoreApprovalRequest: {
4345
+ title: string;
4346
+ task_type?: string | null;
4347
+ context?: string | null;
4348
+ /** @description Propuesta estructurada — réplica del contrato del flujo actual. */
4349
+ proposal: {
4350
+ schema_version?: number | null;
4351
+ /** @enum {string|null} */
4352
+ mode?: "applied" | "preview" | null;
4353
+ agent_trace_id?: string | null;
4354
+ summary: string;
4355
+ changes?: {
4356
+ label: string;
4357
+ type?: string | null;
4358
+ action?: string | null;
4359
+ link?: string | null;
4360
+ record_id?: string | null;
4361
+ apply?: string[] | null;
4362
+ }[] | null;
4363
+ evals?: {
4364
+ label: string;
4365
+ pass: boolean;
4366
+ detail?: string | null;
4367
+ nivel?: number | null;
4368
+ cuenta_para_sello?: boolean | null;
4369
+ }[] | null;
4370
+ verifiability?: {
4371
+ nivel?: number | null;
4372
+ cuenta_para_sello?: boolean | null;
4373
+ /** @enum {string|null} */
4374
+ sello?: "pass" | "fail" | "n/a" | null;
4375
+ } | null;
4376
+ };
4377
+ };
3759
4378
  /** SupplierRequest */
3760
4379
  SupplierRequest: {
3761
4380
  name: string;
@@ -3870,6 +4489,13 @@ export interface components {
3870
4489
  agent_skill: string | null;
3871
4490
  status: string;
3872
4491
  hermes_kanban_id: string | null;
4492
+ /**
4493
+ * @description Paso 2 (integradores): el panel pinta «propuesto por X» cuando la
4494
+ * propuesta viene de una app de partner y no del agente Pim.
4495
+ */
4496
+ plane: string;
4497
+ origin_client_id: string | null;
4498
+ origin_client_name: string | null;
3873
4499
  /** @description Lazo de verificar (Fase 2): lo que el panel pinta del callback. */
3874
4500
  result: string | null;
3875
4501
  result_data: unknown[] | null;
@@ -4065,16 +4691,16 @@ export interface components {
4065
4691
  formatted_created_at: string;
4066
4692
  currency?: components["schemas"]["CurrencyResource"];
4067
4693
  companies?: {
4068
- id: string;
4694
+ id: number;
4069
4695
  name: string;
4070
4696
  trade_name: string;
4071
- vat_id: string;
4697
+ vat_id: string | null;
4072
4698
  tax_id: string;
4073
- logo: string;
4699
+ logo: string | null;
4074
4700
  logo_path: string;
4075
- unique_hash: string;
4701
+ unique_hash: string | null;
4076
4702
  owner_id: string;
4077
- slug: string;
4703
+ slug: string | null;
4078
4704
  address?: components["schemas"]["AddressResource"];
4079
4705
  roles: components["schemas"]["RoleResource"][];
4080
4706
  role: string | null;
@@ -4133,7 +4759,11 @@ export interface operations {
4133
4759
  "accountingSummary.index": {
4134
4760
  parameters: {
4135
4761
  query?: {
4136
- year?: string;
4762
+ from_date?: string | null;
4763
+ to_date?: string | null;
4764
+ quarter?: number | null;
4765
+ year?: number | null;
4766
+ group_by?: "customer" | "category" | null;
4137
4767
  };
4138
4768
  header?: never;
4139
4769
  path?: never;
@@ -4158,9 +4788,38 @@ export interface operations {
4158
4788
  irpf: number;
4159
4789
  result: string;
4160
4790
  }[];
4791
+ } | {
4792
+ data: {
4793
+ from_date: unknown;
4794
+ to_date: unknown;
4795
+ total_sales: number;
4796
+ total_received: number;
4797
+ total_expenses: string;
4798
+ net_profit: string;
4799
+ vat_collected: number;
4800
+ vat_paid: number;
4801
+ vat_balance: string;
4802
+ irpf: number;
4803
+ invoices_count: number;
4804
+ received_invoices_count: number;
4805
+ expenses_count: number;
4806
+ tax_breakdown: {
4807
+ name: string;
4808
+ percent: number;
4809
+ base: number;
4810
+ tax_amount: number;
4811
+ }[];
4812
+ by_customer: {
4813
+ customer_name: string | "Sin cliente";
4814
+ total: number;
4815
+ count: number;
4816
+ }[];
4817
+ by_category: unknown[];
4818
+ };
4161
4819
  };
4162
4820
  };
4163
4821
  };
4822
+ 422: components["responses"]["ValidationException"];
4164
4823
  };
4165
4824
  };
4166
4825
  appVersion: {
@@ -4214,7 +4873,11 @@ export interface operations {
4214
4873
  path?: never;
4215
4874
  cookie?: never;
4216
4875
  };
4217
- requestBody?: never;
4876
+ requestBody: {
4877
+ content: {
4878
+ "application/json": components["schemas"]["AppointmentRequest"];
4879
+ };
4880
+ };
4218
4881
  responses: {
4219
4882
  200: {
4220
4883
  headers: {
@@ -4237,6 +4900,7 @@ export interface operations {
4237
4900
  };
4238
4901
  };
4239
4902
  };
4903
+ 422: components["responses"]["ValidationException"];
4240
4904
  };
4241
4905
  };
4242
4906
  "appointment.show": {
@@ -4274,7 +4938,11 @@ export interface operations {
4274
4938
  };
4275
4939
  cookie?: never;
4276
4940
  };
4277
- requestBody?: never;
4941
+ requestBody: {
4942
+ content: {
4943
+ "application/json": components["schemas"]["AppointmentRequest"];
4944
+ };
4945
+ };
4278
4946
  responses: {
4279
4947
  200: {
4280
4948
  headers: {
@@ -4287,6 +4955,7 @@ export interface operations {
4287
4955
  };
4288
4956
  };
4289
4957
  404: components["responses"]["ModelNotFoundException"];
4958
+ 422: components["responses"]["ValidationException"];
4290
4959
  };
4291
4960
  };
4292
4961
  "appointment.destroy": {
@@ -4314,6 +4983,145 @@ export interface operations {
4314
4983
  404: components["responses"]["ModelNotFoundException"];
4315
4984
  };
4316
4985
  };
4986
+ "approvals.store": {
4987
+ parameters: {
4988
+ query?: never;
4989
+ header?: never;
4990
+ path?: never;
4991
+ cookie?: never;
4992
+ };
4993
+ requestBody: {
4994
+ content: {
4995
+ "application/json": components["schemas"]["StoreApprovalRequest"];
4996
+ };
4997
+ };
4998
+ responses: {
4999
+ 201: {
5000
+ headers: {
5001
+ [name: string]: unknown;
5002
+ };
5003
+ content: {
5004
+ "application/json": {
5005
+ approval: {
5006
+ id: number;
5007
+ plane: string;
5008
+ title: string;
5009
+ task_type: string | null;
5010
+ context: unknown[] | null;
5011
+ /**
5012
+ * @description pending|in_progress|completed|failed — para el partner:
5013
+ * in_progress = pendiente de decisión; completed = aprobada;
5014
+ * failed = rechazada.
5015
+ */
5016
+ status: string;
5017
+ proposal: unknown[] | null;
5018
+ /**
5019
+ * @description proposed|needs_changes|approved|rejected. `needs_changes` NO es
5020
+ * terminal: el owner pidió una revisión — en v1 el partner remite
5021
+ * una propuesta nueva (no hay PATCH) o espera la decisión.
5022
+ */
5023
+ proposal_status: string | null;
5024
+ result: string | null;
5025
+ proposed_at: string;
5026
+ created_at: string;
5027
+ updated_at: string;
5028
+ };
5029
+ };
5030
+ };
5031
+ };
5032
+ 403: {
5033
+ headers: {
5034
+ [name: string]: unknown;
5035
+ };
5036
+ content: {
5037
+ "application/json": {
5038
+ /** @constant */
5039
+ message: "Este endpoint exige un token OAuth de app de partner con el scope approvals:write.";
5040
+ };
5041
+ };
5042
+ };
5043
+ 409: {
5044
+ headers: {
5045
+ [name: string]: unknown;
5046
+ };
5047
+ content: {
5048
+ "application/json": {
5049
+ /** @constant */
5050
+ message: "No hay un tenant en contexto para esta propuesta.";
5051
+ };
5052
+ };
5053
+ };
5054
+ 422: components["responses"]["ValidationException"];
5055
+ };
5056
+ };
5057
+ "approvals.show": {
5058
+ parameters: {
5059
+ query?: never;
5060
+ header?: never;
5061
+ path: {
5062
+ id: number;
5063
+ };
5064
+ cookie?: never;
5065
+ };
5066
+ requestBody?: never;
5067
+ responses: {
5068
+ 200: {
5069
+ headers: {
5070
+ [name: string]: unknown;
5071
+ };
5072
+ content: {
5073
+ "application/json": {
5074
+ approval: {
5075
+ id: number;
5076
+ plane: string;
5077
+ title: string;
5078
+ task_type: string | null;
5079
+ context: unknown[] | null;
5080
+ /**
5081
+ * @description pending|in_progress|completed|failed — para el partner:
5082
+ * in_progress = pendiente de decisión; completed = aprobada;
5083
+ * failed = rechazada.
5084
+ */
5085
+ status: string;
5086
+ proposal: unknown[] | null;
5087
+ /**
5088
+ * @description proposed|needs_changes|approved|rejected. `needs_changes` NO es
5089
+ * terminal: el owner pidió una revisión — en v1 el partner remite
5090
+ * una propuesta nueva (no hay PATCH) o espera la decisión.
5091
+ */
5092
+ proposal_status: string | null;
5093
+ result: string | null;
5094
+ proposed_at: string;
5095
+ created_at: string;
5096
+ updated_at: string;
5097
+ };
5098
+ };
5099
+ };
5100
+ };
5101
+ 403: {
5102
+ headers: {
5103
+ [name: string]: unknown;
5104
+ };
5105
+ content: {
5106
+ "application/json": {
5107
+ /** @constant */
5108
+ message: "Este endpoint exige un token OAuth de app de partner con el scope approvals:write.";
5109
+ };
5110
+ };
5111
+ };
5112
+ 409: {
5113
+ headers: {
5114
+ [name: string]: unknown;
5115
+ };
5116
+ content: {
5117
+ "application/json": {
5118
+ /** @constant */
5119
+ message: "No hay un tenant en contexto para esta propuesta.";
5120
+ };
5121
+ };
5122
+ };
5123
+ };
5124
+ };
4317
5125
  "auth.login": {
4318
5126
  parameters: {
4319
5127
  query?: never;
@@ -4730,7 +5538,11 @@ export interface operations {
4730
5538
  };
4731
5539
  cookie?: never;
4732
5540
  };
4733
- requestBody?: never;
5541
+ requestBody: {
5542
+ content: {
5543
+ "application/json": components["schemas"]["ChangeInvoiceStatusRequest"];
5544
+ };
5545
+ };
4734
5546
  responses: {
4735
5547
  200: {
4736
5548
  headers: {
@@ -4740,40 +5552,21 @@ export interface operations {
4740
5552
  "application/json": {
4741
5553
  success: boolean;
4742
5554
  invoice: {
4743
- id: string;
4744
- /** @constant */
4745
- status: "COMPLETED";
4746
- invoice_number: string;
4747
- sequence_number: string;
4748
- unique_hash: string;
4749
- template_name: string;
4750
- /** @constant */
4751
- paid_status: "PAID";
4752
- };
4753
- };
4754
- };
4755
- };
4756
- 403: components["responses"]["AuthorizationException"];
4757
- 422: {
4758
- headers: {
4759
- [name: string]: unknown;
4760
- };
4761
- content: {
4762
- "application/json": {
4763
- success: boolean;
4764
- /** @constant */
4765
- message: "Solo se pueden completar facturas ya publicadas o enviadas.";
4766
- } | {
4767
- success: boolean;
4768
- /** @constant */
4769
- message: "Solo se pueden enviar facturas en estado borrador o publicada.";
4770
- } | {
4771
- success: boolean;
4772
- /** @constant */
4773
- message: "Solo se pueden publicar facturas en estado borrador.";
5555
+ id: string;
5556
+ /** @constant */
5557
+ status: "COMPLETED";
5558
+ invoice_number: string;
5559
+ sequence_number: string;
5560
+ unique_hash: string;
5561
+ template_name: string;
5562
+ /** @constant */
5563
+ paid_status: "PAID";
5564
+ };
4774
5565
  };
4775
5566
  };
4776
5567
  };
5568
+ 403: components["responses"]["AuthorizationException"];
5569
+ 422: components["responses"]["ValidationException"];
4777
5570
  };
4778
5571
  };
4779
5572
  "estimate.cloneEstimate": {
@@ -5102,6 +5895,142 @@ export interface operations {
5102
5895
  };
5103
5896
  };
5104
5897
  };
5898
+ "custom-fields.index": {
5899
+ parameters: {
5900
+ query?: never;
5901
+ header?: never;
5902
+ path?: never;
5903
+ cookie?: never;
5904
+ };
5905
+ requestBody?: never;
5906
+ responses: {
5907
+ /** @description Array of `CustomFieldResource` */
5908
+ 200: {
5909
+ headers: {
5910
+ [name: string]: unknown;
5911
+ };
5912
+ content: {
5913
+ "application/json": {
5914
+ data: components["schemas"]["CustomFieldResource"][];
5915
+ };
5916
+ };
5917
+ };
5918
+ 403: components["responses"]["AuthorizationException"];
5919
+ };
5920
+ };
5921
+ "custom-fields.store": {
5922
+ parameters: {
5923
+ query?: never;
5924
+ header?: never;
5925
+ path?: never;
5926
+ cookie?: never;
5927
+ };
5928
+ requestBody: {
5929
+ content: {
5930
+ "application/json": components["schemas"]["CustomFieldRequest"];
5931
+ };
5932
+ };
5933
+ responses: {
5934
+ /** @description `CustomFieldResource` */
5935
+ 200: {
5936
+ headers: {
5937
+ [name: string]: unknown;
5938
+ };
5939
+ content: {
5940
+ "application/json": {
5941
+ data: components["schemas"]["CustomFieldResource"];
5942
+ };
5943
+ };
5944
+ };
5945
+ 403: components["responses"]["AuthorizationException"];
5946
+ 422: components["responses"]["ValidationException"];
5947
+ };
5948
+ };
5949
+ "custom-fields.show": {
5950
+ parameters: {
5951
+ query?: never;
5952
+ header?: never;
5953
+ path: {
5954
+ /** @description The custom field ID */
5955
+ customField: number;
5956
+ };
5957
+ cookie?: never;
5958
+ };
5959
+ requestBody?: never;
5960
+ responses: {
5961
+ /** @description `CustomFieldResource` */
5962
+ 200: {
5963
+ headers: {
5964
+ [name: string]: unknown;
5965
+ };
5966
+ content: {
5967
+ "application/json": {
5968
+ data: components["schemas"]["CustomFieldResource"];
5969
+ };
5970
+ };
5971
+ };
5972
+ 403: components["responses"]["AuthorizationException"];
5973
+ 404: components["responses"]["ModelNotFoundException"];
5974
+ };
5975
+ };
5976
+ "custom-fields.update": {
5977
+ parameters: {
5978
+ query?: never;
5979
+ header?: never;
5980
+ path: {
5981
+ /** @description The custom field ID */
5982
+ customField: number;
5983
+ };
5984
+ cookie?: never;
5985
+ };
5986
+ requestBody: {
5987
+ content: {
5988
+ "application/json": components["schemas"]["CustomFieldRequest"];
5989
+ };
5990
+ };
5991
+ responses: {
5992
+ /** @description `CustomFieldResource` */
5993
+ 200: {
5994
+ headers: {
5995
+ [name: string]: unknown;
5996
+ };
5997
+ content: {
5998
+ "application/json": {
5999
+ data: components["schemas"]["CustomFieldResource"];
6000
+ };
6001
+ };
6002
+ };
6003
+ 403: components["responses"]["AuthorizationException"];
6004
+ 404: components["responses"]["ModelNotFoundException"];
6005
+ 422: components["responses"]["ValidationException"];
6006
+ };
6007
+ };
6008
+ "custom-fields.destroy": {
6009
+ parameters: {
6010
+ query?: never;
6011
+ header?: never;
6012
+ path: {
6013
+ /** @description The custom field ID */
6014
+ customField: number;
6015
+ };
6016
+ cookie?: never;
6017
+ };
6018
+ requestBody?: never;
6019
+ responses: {
6020
+ 200: {
6021
+ headers: {
6022
+ [name: string]: unknown;
6023
+ };
6024
+ content: {
6025
+ "application/json": {
6026
+ success: boolean;
6027
+ };
6028
+ };
6029
+ };
6030
+ 403: components["responses"]["AuthorizationException"];
6031
+ 404: components["responses"]["ModelNotFoundException"];
6032
+ };
6033
+ };
5105
6034
  "customer.customerStats": {
5106
6035
  parameters: {
5107
6036
  query?: never;
@@ -5790,7 +6719,11 @@ export interface operations {
5790
6719
  path?: never;
5791
6720
  cookie?: never;
5792
6721
  };
5793
- requestBody?: never;
6722
+ requestBody: {
6723
+ content: {
6724
+ "application/json": components["schemas"]["EstimatesRequest"];
6725
+ };
6726
+ };
5794
6727
  responses: {
5795
6728
  /** @description `EstimateResource` */
5796
6729
  200: {
@@ -5844,7 +6777,11 @@ export interface operations {
5844
6777
  };
5845
6778
  cookie?: never;
5846
6779
  };
5847
- requestBody?: never;
6780
+ requestBody: {
6781
+ content: {
6782
+ "application/json": components["schemas"]["EstimatesRequest"];
6783
+ };
6784
+ };
5848
6785
  responses: {
5849
6786
  /** @description `EstimateResource` */
5850
6787
  200: {
@@ -6056,7 +6993,11 @@ export interface operations {
6056
6993
  path?: never;
6057
6994
  cookie?: never;
6058
6995
  };
6059
- requestBody?: never;
6996
+ requestBody: {
6997
+ content: {
6998
+ "multipart/form-data": components["schemas"]["ExpenseRequest"];
6999
+ };
7000
+ };
6060
7001
  responses: {
6061
7002
  /** @description `ExpenseResource` */
6062
7003
  200: {
@@ -6110,7 +7051,11 @@ export interface operations {
6110
7051
  };
6111
7052
  cookie?: never;
6112
7053
  };
6113
- requestBody?: never;
7054
+ requestBody: {
7055
+ content: {
7056
+ "multipart/form-data": components["schemas"]["ExpenseRequest"];
7057
+ };
7058
+ };
6114
7059
  responses: {
6115
7060
  /** @description `ExpenseResource` */
6116
7061
  200: {
@@ -6236,7 +7181,11 @@ export interface operations {
6236
7181
  path?: never;
6237
7182
  cookie?: never;
6238
7183
  };
6239
- requestBody?: never;
7184
+ requestBody: {
7185
+ content: {
7186
+ "application/json": components["schemas"]["ForgotPasswordRequest"];
7187
+ };
7188
+ };
6240
7189
  responses: {
6241
7190
  200: {
6242
7191
  headers: {
@@ -6246,21 +7195,12 @@ export interface operations {
6246
7195
  "application/json": {
6247
7196
  /** @constant */
6248
7197
  message: "Password reset email sent.";
6249
- data: string;
6250
- };
6251
- };
6252
- };
6253
- 403: {
6254
- headers: {
6255
- [name: string]: unknown;
6256
- };
6257
- content: {
6258
- "application/json": {
6259
7198
  /** @constant */
6260
- error: "Email could not be sent to this email address.";
7199
+ data: "passwords.sent";
6261
7200
  };
6262
7201
  };
6263
7202
  };
7203
+ 422: components["responses"]["ValidationException"];
6264
7204
  };
6265
7205
  };
6266
7206
  "exchangeRate.getActiveProvider": {
@@ -6651,7 +7591,11 @@ export interface operations {
6651
7591
  path?: never;
6652
7592
  cookie?: never;
6653
7593
  };
6654
- requestBody?: never;
7594
+ requestBody: {
7595
+ content: {
7596
+ "application/json": components["schemas"]["InvoiceSeriesRequest"];
7597
+ };
7598
+ };
6655
7599
  responses: {
6656
7600
  /** @description `InvoiceSeriesResource` */
6657
7601
  200: {
@@ -6665,6 +7609,7 @@ export interface operations {
6665
7609
  };
6666
7610
  };
6667
7611
  403: components["responses"]["AuthorizationException"];
7612
+ 422: components["responses"]["ValidationException"];
6668
7613
  };
6669
7614
  };
6670
7615
  "invoice-series.show": {
@@ -6704,7 +7649,11 @@ export interface operations {
6704
7649
  };
6705
7650
  cookie?: never;
6706
7651
  };
6707
- requestBody?: never;
7652
+ requestBody: {
7653
+ content: {
7654
+ "application/json": components["schemas"]["InvoiceSeriesRequest"];
7655
+ };
7656
+ };
6708
7657
  responses: {
6709
7658
  /** @description `InvoiceSeriesResource` */
6710
7659
  200: {
@@ -6719,6 +7668,7 @@ export interface operations {
6719
7668
  };
6720
7669
  403: components["responses"]["AuthorizationException"];
6721
7670
  404: components["responses"]["ModelNotFoundException"];
7671
+ 422: components["responses"]["ValidationException"];
6722
7672
  };
6723
7673
  };
6724
7674
  "invoice-series.destroy": {
@@ -6804,7 +7754,11 @@ export interface operations {
6804
7754
  };
6805
7755
  cookie?: never;
6806
7756
  };
6807
- requestBody?: never;
7757
+ requestBody?: {
7758
+ content: {
7759
+ "application/json": components["schemas"]["InvoiceTemplatePreviewRequest"];
7760
+ };
7761
+ };
6808
7762
  responses: {
6809
7763
  200: {
6810
7764
  headers: {
@@ -6816,6 +7770,7 @@ export interface operations {
6816
7770
  };
6817
7771
  403: components["responses"]["AuthorizationException"];
6818
7772
  404: components["responses"]["ModelNotFoundException"];
7773
+ 422: components["responses"]["ValidationException"];
6819
7774
  };
6820
7775
  };
6821
7776
  "invoiceTemplate.showLetterhead": {
@@ -6936,7 +7891,11 @@ export interface operations {
6936
7891
  path?: never;
6937
7892
  cookie?: never;
6938
7893
  };
6939
- requestBody?: never;
7894
+ requestBody: {
7895
+ content: {
7896
+ "application/json": components["schemas"]["InvoiceTemplateRequest"];
7897
+ };
7898
+ };
6940
7899
  responses: {
6941
7900
  /** @description `InvoiceTemplateResource` */
6942
7901
  200: {
@@ -6950,6 +7909,7 @@ export interface operations {
6950
7909
  };
6951
7910
  };
6952
7911
  403: components["responses"]["AuthorizationException"];
7912
+ 422: components["responses"]["ValidationException"];
6953
7913
  };
6954
7914
  };
6955
7915
  "invoice-templates.show": {
@@ -6989,7 +7949,11 @@ export interface operations {
6989
7949
  };
6990
7950
  cookie?: never;
6991
7951
  };
6992
- requestBody?: never;
7952
+ requestBody: {
7953
+ content: {
7954
+ "application/json": components["schemas"]["InvoiceTemplateRequest"];
7955
+ };
7956
+ };
6993
7957
  responses: {
6994
7958
  /** @description `InvoiceTemplateResource` */
6995
7959
  200: {
@@ -7004,17 +7968,7 @@ export interface operations {
7004
7968
  };
7005
7969
  403: components["responses"]["AuthorizationException"];
7006
7970
  404: components["responses"]["ModelNotFoundException"];
7007
- 422: {
7008
- headers: {
7009
- [name: string]: unknown;
7010
- };
7011
- content: {
7012
- "application/json": {
7013
- /** @constant */
7014
- message: "Las plantillas del sistema no se pueden modificar. Crea una copia para personalizarla.";
7015
- };
7016
- };
7017
- };
7971
+ 422: components["responses"]["ValidationException"];
7018
7972
  };
7019
7973
  };
7020
7974
  "invoice-templates.destroy": {
@@ -7175,11 +8129,9 @@ export interface operations {
7175
8129
  path?: never;
7176
8130
  cookie?: never;
7177
8131
  };
7178
- requestBody?: {
8132
+ requestBody: {
7179
8133
  content: {
7180
- "application/json": components["schemas"]["InvoicesRequest"] & {
7181
- items?: string;
7182
- };
8134
+ "application/json": components["schemas"]["InvoicesRequest"];
7183
8135
  };
7184
8136
  };
7185
8137
  responses: {
@@ -7232,11 +8184,9 @@ export interface operations {
7232
8184
  };
7233
8185
  cookie?: never;
7234
8186
  };
7235
- requestBody?: {
8187
+ requestBody: {
7236
8188
  content: {
7237
- "application/json": components["schemas"]["InvoicesRequest"] & {
7238
- items?: string;
7239
- };
8189
+ "application/json": components["schemas"]["InvoicesRequest"];
7240
8190
  };
7241
8191
  };
7242
8192
  responses: {
@@ -8317,7 +9267,11 @@ export interface operations {
8317
9267
  path?: never;
8318
9268
  cookie?: never;
8319
9269
  };
8320
- requestBody?: never;
9270
+ requestBody: {
9271
+ content: {
9272
+ "application/json": components["schemas"]["PaymentRequest"];
9273
+ };
9274
+ };
8321
9275
  responses: {
8322
9276
  /** @description `PaymentResource` */
8323
9277
  200: {
@@ -8371,7 +9325,11 @@ export interface operations {
8371
9325
  };
8372
9326
  cookie?: never;
8373
9327
  };
8374
- requestBody?: never;
9328
+ requestBody: {
9329
+ content: {
9330
+ "application/json": components["schemas"]["PaymentRequest"];
9331
+ };
9332
+ };
8375
9333
  responses: {
8376
9334
  /** @description `PaymentResource` */
8377
9335
  200: {
@@ -8829,7 +9787,11 @@ export interface operations {
8829
9787
  path?: never;
8830
9788
  cookie?: never;
8831
9789
  };
8832
- requestBody?: never;
9790
+ requestBody: {
9791
+ content: {
9792
+ "application/json": components["schemas"]["ReceivedInvoiceRequest"];
9793
+ };
9794
+ };
8833
9795
  responses: {
8834
9796
  /** @description `ReceivedInvoiceResource` */
8835
9797
  200: {
@@ -8881,7 +9843,11 @@ export interface operations {
8881
9843
  };
8882
9844
  cookie?: never;
8883
9845
  };
8884
- requestBody?: never;
9846
+ requestBody: {
9847
+ content: {
9848
+ "application/json": components["schemas"]["ReceivedInvoiceRequest"];
9849
+ };
9850
+ };
8885
9851
  responses: {
8886
9852
  /** @description `ReceivedInvoiceResource` */
8887
9853
  200: {
@@ -9171,7 +10137,11 @@ export interface operations {
9171
10137
  path?: never;
9172
10138
  cookie?: never;
9173
10139
  };
9174
- requestBody?: never;
10140
+ requestBody: {
10141
+ content: {
10142
+ "application/json": components["schemas"]["DeleteRecurringInvoicesRequest"];
10143
+ };
10144
+ };
9175
10145
  responses: {
9176
10146
  200: {
9177
10147
  headers: {
@@ -9184,6 +10154,7 @@ export interface operations {
9184
10154
  };
9185
10155
  };
9186
10156
  403: components["responses"]["AuthorizationException"];
10157
+ 422: components["responses"]["ValidationException"];
9187
10158
  };
9188
10159
  };
9189
10160
  "recurring-invoices.index": {
@@ -9219,7 +10190,11 @@ export interface operations {
9219
10190
  path?: never;
9220
10191
  cookie?: never;
9221
10192
  };
9222
- requestBody?: never;
10193
+ requestBody: {
10194
+ content: {
10195
+ "application/json": components["schemas"]["RecurringInvoiceRequest"];
10196
+ };
10197
+ };
9223
10198
  responses: {
9224
10199
  /** @description `RecurringInvoiceResource` */
9225
10200
  200: {
@@ -9273,7 +10248,11 @@ export interface operations {
9273
10248
  };
9274
10249
  cookie?: never;
9275
10250
  };
9276
- requestBody?: never;
10251
+ requestBody: {
10252
+ content: {
10253
+ "application/json": components["schemas"]["RecurringInvoiceRequest"];
10254
+ };
10255
+ };
9277
10256
  responses: {
9278
10257
  /** @description `RecurringInvoiceResource` */
9279
10258
  200: {
@@ -9535,8 +10514,8 @@ export interface operations {
9535
10514
  "invoice.sendInvoicePreview": {
9536
10515
  parameters: {
9537
10516
  query: {
9538
- body: string;
9539
10517
  subject: string;
10518
+ body: string;
9540
10519
  from: string;
9541
10520
  to: string;
9542
10521
  cc?: string | null;
@@ -9597,7 +10576,14 @@ export interface operations {
9597
10576
  };
9598
10577
  "payment.sendPaymentPreview": {
9599
10578
  parameters: {
9600
- query?: never;
10579
+ query: {
10580
+ subject: string;
10581
+ body: string;
10582
+ from: string;
10583
+ to: string;
10584
+ cc?: string | null;
10585
+ bcc?: string | null;
10586
+ };
9601
10587
  header?: never;
9602
10588
  path: {
9603
10589
  /** @description The payment ID */
@@ -9617,6 +10603,7 @@ export interface operations {
9617
10603
  };
9618
10604
  403: components["responses"]["AuthorizationException"];
9619
10605
  404: components["responses"]["ModelNotFoundException"];
10606
+ 422: components["responses"]["ValidationException"];
9620
10607
  };
9621
10608
  };
9622
10609
  "sepaRemittance.eligibleInvoices": {
@@ -10018,6 +11005,13 @@ export interface operations {
10018
11005
  agent_skill: string | null;
10019
11006
  status: string;
10020
11007
  hermes_kanban_id: string | null;
11008
+ /**
11009
+ * @description Paso 2 (integradores): el panel pinta «propuesto por X» cuando la
11010
+ * propuesta viene de una app de partner y no del agente Pim.
11011
+ */
11012
+ plane: string;
11013
+ origin_client_id: string | null;
11014
+ origin_client_name: string | null;
10021
11015
  /** @description Lazo de verificar (Fase 2): lo que el panel pinta del callback. */
10022
11016
  result: string | null;
10023
11017
  result_data: unknown[] | null;
@@ -10068,6 +11062,13 @@ export interface operations {
10068
11062
  agent_skill: string | null;
10069
11063
  status: string;
10070
11064
  hermes_kanban_id: string | null;
11065
+ /**
11066
+ * @description Paso 2 (integradores): el panel pinta «propuesto por X» cuando la
11067
+ * propuesta viene de una app de partner y no del agente Pim.
11068
+ */
11069
+ plane: string;
11070
+ origin_client_id: string | null;
11071
+ origin_client_name: string | null;
10071
11072
  /** @description Lazo de verificar (Fase 2): lo que el panel pinta del callback. */
10072
11073
  result: string | null;
10073
11074
  result_data: unknown[] | null;
@@ -10100,6 +11101,13 @@ export interface operations {
10100
11101
  agent_skill: string | null;
10101
11102
  status: string;
10102
11103
  hermes_kanban_id: string | null;
11104
+ /**
11105
+ * @description Paso 2 (integradores): el panel pinta «propuesto por X» cuando la
11106
+ * propuesta viene de una app de partner y no del agente Pim.
11107
+ */
11108
+ plane: string;
11109
+ origin_client_id: string | null;
11110
+ origin_client_name: string | null;
10103
11111
  /** @description Lazo de verificar (Fase 2): lo que el panel pinta del callback. */
10104
11112
  result: string | null;
10105
11113
  result_data: unknown[] | null;