@pimia/sdk 0.13.0 → 0.15.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 +438 -17
- package/dist/client.d.ts +99 -0
- package/dist/client.js +48 -0
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -3774,6 +3774,13 @@ export interface paths {
|
|
|
3774
3774
|
* líneas con `item_id`, y un artículo con `opening_stock` NULL («nunca ha
|
|
3775
3775
|
* llevado stock») no se estrena por una compra — se estrena en su ficha o
|
|
3776
3776
|
* con un ajuste, que son los gestos que significan «declaro existencias».
|
|
3777
|
+
*
|
|
3778
|
+
* ⚠️ **El almacén se puede declarar AQUÍ** (`warehouse_id`, opcional, N2) y
|
|
3779
|
+
* no solo en la factura: dónde se guarda la mercancía se sabe al recibirla
|
|
3780
|
+
* —descargando el camión—, no al teclear la factura que el OCR acaba de
|
|
3781
|
+
* crear. Lo que llegue aquí manda sobre lo que declarara el documento, y
|
|
3782
|
+
* se GUARDA en él: si el documento dijera una cosa y el almacén moviera
|
|
3783
|
+
* otra, la ficha estaría mintiendo sobre lo que hizo.
|
|
3777
3784
|
*/
|
|
3778
3785
|
post: operations["receivedInvoices.markGoodsReceived"];
|
|
3779
3786
|
delete?: never;
|
|
@@ -4614,6 +4621,113 @@ export interface paths {
|
|
|
4614
4621
|
patch?: never;
|
|
4615
4622
|
trace?: never;
|
|
4616
4623
|
};
|
|
4624
|
+
"/stock-counts/{id}/confirm": {
|
|
4625
|
+
parameters: {
|
|
4626
|
+
query?: never;
|
|
4627
|
+
header?: never;
|
|
4628
|
+
path?: never;
|
|
4629
|
+
cookie?: never;
|
|
4630
|
+
};
|
|
4631
|
+
get?: never;
|
|
4632
|
+
put?: never;
|
|
4633
|
+
/**
|
|
4634
|
+
* Confirma el recuento: emite los ajustes en bloque contra el libro
|
|
4635
|
+
* @description Una línea por artículo contado y con diferencia, con motivo `count` y el
|
|
4636
|
+
* recuento como documento de origen. Lo que NO emite nada:
|
|
4637
|
+
*
|
|
4638
|
+
* - las líneas **sin contar** (`counted_quantity` NULL) — nadie miró esa
|
|
4639
|
+
* estantería, y suponer que está vacía sería inventarse un dato;
|
|
4640
|
+
* - las que **cuadran** con el saldo del momento — el libro anota lo que
|
|
4641
|
+
* le pasó al contador, no lo que un documento quiso hacerle.
|
|
4642
|
+
*
|
|
4643
|
+
* Todo va en UNA transacción: un recuento a medias dejaría el almacén en
|
|
4644
|
+
* un estado que ni la realidad ni el sistema han tenido nunca.
|
|
4645
|
+
*/
|
|
4646
|
+
post: operations["stockCounts.confirm"];
|
|
4647
|
+
delete?: never;
|
|
4648
|
+
options?: never;
|
|
4649
|
+
head?: never;
|
|
4650
|
+
patch?: never;
|
|
4651
|
+
trace?: never;
|
|
4652
|
+
};
|
|
4653
|
+
"/stock-counts/{id}/cancel": {
|
|
4654
|
+
parameters: {
|
|
4655
|
+
query?: never;
|
|
4656
|
+
header?: never;
|
|
4657
|
+
path?: never;
|
|
4658
|
+
cookie?: never;
|
|
4659
|
+
};
|
|
4660
|
+
get?: never;
|
|
4661
|
+
put?: never;
|
|
4662
|
+
/**
|
|
4663
|
+
* Cancela un borrador: no emite nada y deja constancia de que se abrió y
|
|
4664
|
+
* no se cerró. Un recuento confirmado no se cancela — ya movió el almacén
|
|
4665
|
+
*/
|
|
4666
|
+
post: operations["stockCounts.cancel"];
|
|
4667
|
+
delete?: never;
|
|
4668
|
+
options?: never;
|
|
4669
|
+
head?: never;
|
|
4670
|
+
patch?: never;
|
|
4671
|
+
trace?: never;
|
|
4672
|
+
};
|
|
4673
|
+
"/stock-counts": {
|
|
4674
|
+
parameters: {
|
|
4675
|
+
query?: never;
|
|
4676
|
+
header?: never;
|
|
4677
|
+
path?: never;
|
|
4678
|
+
cookie?: never;
|
|
4679
|
+
};
|
|
4680
|
+
/** Los recuentos de la empresa, del más nuevo al más viejo */
|
|
4681
|
+
get: operations["stock-counts.index"];
|
|
4682
|
+
put?: never;
|
|
4683
|
+
/**
|
|
4684
|
+
* Abre un recuento
|
|
4685
|
+
* @description Nace **sembrado** con lo que el almacén dice tener ahora (`seed`, por
|
|
4686
|
+
* defecto sí): contar es corregir una lista, no escribirla de cero. Se
|
|
4687
|
+
* siembran los artículos con saldo distinto de cero — una lista con las
|
|
4688
|
+
* doscientas referencias que el almacén NO tiene es una lista que nadie
|
|
4689
|
+
* lee. Lo que aparezca de más se añade contando (`PUT` con su `item_id`).
|
|
4690
|
+
*/
|
|
4691
|
+
post: operations["stock-counts.store"];
|
|
4692
|
+
delete?: never;
|
|
4693
|
+
options?: never;
|
|
4694
|
+
head?: never;
|
|
4695
|
+
patch?: never;
|
|
4696
|
+
trace?: never;
|
|
4697
|
+
};
|
|
4698
|
+
"/stock-counts/{stock_count}": {
|
|
4699
|
+
parameters: {
|
|
4700
|
+
query?: never;
|
|
4701
|
+
header?: never;
|
|
4702
|
+
path?: never;
|
|
4703
|
+
cookie?: never;
|
|
4704
|
+
};
|
|
4705
|
+
get: operations["stock-counts.show"];
|
|
4706
|
+
/**
|
|
4707
|
+
* Cuenta: escribe lo contado de cada línea
|
|
4708
|
+
* @description Las líneas se UPSERTAN por artículo y no se borran y recrean, que es lo
|
|
4709
|
+
* que hacen los documentos de venta: aquí `expected_quantity` es la foto
|
|
4710
|
+
* de lo que el sistema creía cuando se dibujó la línea, y recrearla la
|
|
4711
|
+
* refrescaría en silencio — perdiendo justo el dato que permite avisar de
|
|
4712
|
+
* que algo se movió mientras se contaba. Un artículo que no venga en la
|
|
4713
|
+
* petición se queda como estaba.
|
|
4714
|
+
*
|
|
4715
|
+
* Un recuento confirmado o cancelado no se edita: **422**.
|
|
4716
|
+
*/
|
|
4717
|
+
put: operations["stock-counts.update"];
|
|
4718
|
+
post?: never;
|
|
4719
|
+
/**
|
|
4720
|
+
* Borra un recuento que no ha movido nada
|
|
4721
|
+
* @description Un confirmado no se borra: sus asientos explican saldos de hoy, y
|
|
4722
|
+
* borrarlo dejaría el libro nombrando un documento que no existe. Para el
|
|
4723
|
+
* que se abrió y no se cerró está `cancel`.
|
|
4724
|
+
*/
|
|
4725
|
+
delete: operations["stock-counts.destroy"];
|
|
4726
|
+
options?: never;
|
|
4727
|
+
head?: never;
|
|
4728
|
+
patch?: never;
|
|
4729
|
+
trace?: never;
|
|
4730
|
+
};
|
|
4617
4731
|
"/stock-movements": {
|
|
4618
4732
|
parameters: {
|
|
4619
4733
|
query?: never;
|
|
@@ -6847,6 +6961,12 @@ export interface components {
|
|
|
6847
6961
|
* para contar lo que hizo.
|
|
6848
6962
|
*/
|
|
6849
6963
|
stock_deducted_at: string | null;
|
|
6964
|
+
/**
|
|
6965
|
+
* @description DE DÓNDE se entrega (N2). NULL = del almacén por defecto, que se
|
|
6966
|
+
* resuelve al entregar y no al guardar: cambiar el por defecto no
|
|
6967
|
+
* reescribe la intención de un albarán viejo.
|
|
6968
|
+
*/
|
|
6969
|
+
warehouse_id: number | null;
|
|
6850
6970
|
sub_total: number;
|
|
6851
6971
|
total: number;
|
|
6852
6972
|
tax: number;
|
|
@@ -8658,6 +8778,13 @@ export interface components {
|
|
|
8658
8778
|
tax?: number | null;
|
|
8659
8779
|
total?: number | null;
|
|
8660
8780
|
}[];
|
|
8781
|
+
/**
|
|
8782
|
+
* @description DÓNDE entra la mercancía (N2). Opcional: sin él, el almacén por
|
|
8783
|
+
* defecto de la empresa. Se lee al marcar la mercancía como
|
|
8784
|
+
* recibida —no al guardar la factura—, porque el OCR crea
|
|
8785
|
+
* borradores que se corrigen antes de que llegue nada.
|
|
8786
|
+
*/
|
|
8787
|
+
warehouse_id?: number | null;
|
|
8661
8788
|
};
|
|
8662
8789
|
/** ReceivedInvoiceResource */
|
|
8663
8790
|
ReceivedInvoiceResource: {
|
|
@@ -8675,6 +8802,11 @@ export interface components {
|
|
|
8675
8802
|
* cliente pintar el botón «Mercancía recibida» solo cuando toca.
|
|
8676
8803
|
*/
|
|
8677
8804
|
stock_added_at: string | null;
|
|
8805
|
+
/**
|
|
8806
|
+
* @description DÓNDE entra la mercancía (N2). NULL = el almacén por defecto,
|
|
8807
|
+
* resuelto al marcarla recibida.
|
|
8808
|
+
*/
|
|
8809
|
+
warehouse_id: number | null;
|
|
8678
8810
|
paid_status: string;
|
|
8679
8811
|
tax_per_item: string | null;
|
|
8680
8812
|
discount_per_item: string | null;
|
|
@@ -8949,7 +9081,7 @@ export interface components {
|
|
|
8949
9081
|
* ningún permiso es una operación legítima, y `required` la
|
|
8950
9082
|
* prohibiría (un array vacío no pasa `required`).
|
|
8951
9083
|
*/
|
|
8952
|
-
abilities: ("dashboard" | "view-customer" | "create-customer" | "edit-customer" | "delete-customer" | "view-estimate" | "create-estimate" | "edit-estimate" | "delete-estimate" | "send-estimate" | "view-invoice" | "create-invoice" | "edit-invoice" | "delete-invoice" | "send-invoice" | "view-recurring-invoice" | "create-recurring-invoice" | "edit-recurring-invoice" | "delete-recurring-invoice" | "view-payment" | "create-payment" | "edit-payment" | "delete-payment" | "send-payment" | "view-expense" | "create-expense" | "edit-expense" | "delete-expense" | "view-delivery-note" | "create-delivery-note" | "edit-delivery-note" | "delete-delivery-note" | "view-item" | "create-item" | "edit-item" | "delete-item" | "view-lead" | "create-lead" | "edit-lead" | "delete-lead" | "convert-lead" | "view-contact" | "create-contact" | "edit-contact" | "delete-contact" | "view-project" | "create-project" | "edit-project" | "delete-project" | "view-task" | "create-task" | "edit-task" | "delete-task" | "view-own-task" | "edit-own-task" | "view-time-entry" | "create-time-entry" | "edit-time-entry" | "delete-time-entry" | "view-own-time-entry" | "create-own-time-entry" | "edit-own-time-entry" | "delete-own-time-entry" | "view-tax-type" | "create-tax-type" | "edit-tax-type" | "delete-tax-type" | "view-custom-field" | "create-custom-field" | "edit-custom-field" | "delete-custom-field" | "view-role" | "create-role" | "edit-role" | "delete-role" | "view-financial-reports" | "view-all-notes" | "manage-all-notes" | "time_clock.punch" | "time_clock.view_own" | "time_clock.view_team" | "time_clock.correct" | "absence.request" | "absence.approve" | "report.download_legal" | "view-employee" | "create-employee" | "edit-employee" | "delete-employee" | "view-work-schedule" | "manage-work-schedule" | "view-work-calendar" | "manage-work-calendar" | "pos.operate" | "pos.supervise" | "pos.void" | "pos.discount_high" | "pos.cash_movement" | "pos.return" | "pos.admin" | "pos.report" | "view-appointment" | "create-appointment" | "edit-appointment" | "delete-appointment" | "view-contract" | "create-contract" | "edit-contract" | "delete-contract" | "view-warehouse" | "create-warehouse" | "edit-warehouse" | "delete-warehouse")[];
|
|
9084
|
+
abilities: ("dashboard" | "view-customer" | "create-customer" | "edit-customer" | "delete-customer" | "view-estimate" | "create-estimate" | "edit-estimate" | "delete-estimate" | "send-estimate" | "view-invoice" | "create-invoice" | "edit-invoice" | "delete-invoice" | "send-invoice" | "view-recurring-invoice" | "create-recurring-invoice" | "edit-recurring-invoice" | "delete-recurring-invoice" | "view-payment" | "create-payment" | "edit-payment" | "delete-payment" | "send-payment" | "view-expense" | "create-expense" | "edit-expense" | "delete-expense" | "view-delivery-note" | "create-delivery-note" | "edit-delivery-note" | "delete-delivery-note" | "view-item" | "create-item" | "edit-item" | "delete-item" | "view-lead" | "create-lead" | "edit-lead" | "delete-lead" | "convert-lead" | "view-contact" | "create-contact" | "edit-contact" | "delete-contact" | "view-project" | "create-project" | "edit-project" | "delete-project" | "view-task" | "create-task" | "edit-task" | "delete-task" | "view-own-task" | "edit-own-task" | "view-time-entry" | "create-time-entry" | "edit-time-entry" | "delete-time-entry" | "view-own-time-entry" | "create-own-time-entry" | "edit-own-time-entry" | "delete-own-time-entry" | "view-tax-type" | "create-tax-type" | "edit-tax-type" | "delete-tax-type" | "view-custom-field" | "create-custom-field" | "edit-custom-field" | "delete-custom-field" | "view-role" | "create-role" | "edit-role" | "delete-role" | "view-financial-reports" | "view-all-notes" | "manage-all-notes" | "time_clock.punch" | "time_clock.view_own" | "time_clock.view_team" | "time_clock.correct" | "absence.request" | "absence.approve" | "report.download_legal" | "view-employee" | "create-employee" | "edit-employee" | "delete-employee" | "view-work-schedule" | "manage-work-schedule" | "view-work-calendar" | "manage-work-calendar" | "pos.operate" | "pos.supervise" | "pos.void" | "pos.discount_high" | "pos.cash_movement" | "pos.return" | "pos.admin" | "pos.report" | "view-appointment" | "create-appointment" | "edit-appointment" | "delete-appointment" | "view-contract" | "create-contract" | "edit-contract" | "delete-contract" | "view-warehouse" | "create-warehouse" | "edit-warehouse" | "delete-warehouse" | "view-stock-count" | "create-stock-count" | "edit-stock-count" | "delete-stock-count")[];
|
|
8953
9085
|
};
|
|
8954
9086
|
/**
|
|
8955
9087
|
* RoleRequest
|
|
@@ -8974,7 +9106,7 @@ export interface components {
|
|
|
8974
9106
|
name: string;
|
|
8975
9107
|
abilities?: {
|
|
8976
9108
|
/** @enum {string} */
|
|
8977
|
-
ability: "dashboard" | "view-customer" | "create-customer" | "edit-customer" | "delete-customer" | "view-estimate" | "create-estimate" | "edit-estimate" | "delete-estimate" | "send-estimate" | "view-invoice" | "create-invoice" | "edit-invoice" | "delete-invoice" | "send-invoice" | "view-recurring-invoice" | "create-recurring-invoice" | "edit-recurring-invoice" | "delete-recurring-invoice" | "view-payment" | "create-payment" | "edit-payment" | "delete-payment" | "send-payment" | "view-expense" | "create-expense" | "edit-expense" | "delete-expense" | "view-delivery-note" | "create-delivery-note" | "edit-delivery-note" | "delete-delivery-note" | "view-item" | "create-item" | "edit-item" | "delete-item" | "view-lead" | "create-lead" | "edit-lead" | "delete-lead" | "convert-lead" | "view-contact" | "create-contact" | "edit-contact" | "delete-contact" | "view-project" | "create-project" | "edit-project" | "delete-project" | "view-task" | "create-task" | "edit-task" | "delete-task" | "view-own-task" | "edit-own-task" | "view-time-entry" | "create-time-entry" | "edit-time-entry" | "delete-time-entry" | "view-own-time-entry" | "create-own-time-entry" | "edit-own-time-entry" | "delete-own-time-entry" | "view-tax-type" | "create-tax-type" | "edit-tax-type" | "delete-tax-type" | "view-custom-field" | "create-custom-field" | "edit-custom-field" | "delete-custom-field" | "view-role" | "create-role" | "edit-role" | "delete-role" | "view-financial-reports" | "view-all-notes" | "manage-all-notes" | "time_clock.punch" | "time_clock.view_own" | "time_clock.view_team" | "time_clock.correct" | "absence.request" | "absence.approve" | "report.download_legal" | "view-employee" | "create-employee" | "edit-employee" | "delete-employee" | "view-work-schedule" | "manage-work-schedule" | "view-work-calendar" | "manage-work-calendar" | "pos.operate" | "pos.supervise" | "pos.void" | "pos.discount_high" | "pos.cash_movement" | "pos.return" | "pos.admin" | "pos.report" | "view-appointment" | "create-appointment" | "edit-appointment" | "delete-appointment" | "view-contract" | "create-contract" | "edit-contract" | "delete-contract" | "view-warehouse" | "create-warehouse" | "edit-warehouse" | "delete-warehouse";
|
|
9109
|
+
ability: "dashboard" | "view-customer" | "create-customer" | "edit-customer" | "delete-customer" | "view-estimate" | "create-estimate" | "edit-estimate" | "delete-estimate" | "send-estimate" | "view-invoice" | "create-invoice" | "edit-invoice" | "delete-invoice" | "send-invoice" | "view-recurring-invoice" | "create-recurring-invoice" | "edit-recurring-invoice" | "delete-recurring-invoice" | "view-payment" | "create-payment" | "edit-payment" | "delete-payment" | "send-payment" | "view-expense" | "create-expense" | "edit-expense" | "delete-expense" | "view-delivery-note" | "create-delivery-note" | "edit-delivery-note" | "delete-delivery-note" | "view-item" | "create-item" | "edit-item" | "delete-item" | "view-lead" | "create-lead" | "edit-lead" | "delete-lead" | "convert-lead" | "view-contact" | "create-contact" | "edit-contact" | "delete-contact" | "view-project" | "create-project" | "edit-project" | "delete-project" | "view-task" | "create-task" | "edit-task" | "delete-task" | "view-own-task" | "edit-own-task" | "view-time-entry" | "create-time-entry" | "edit-time-entry" | "delete-time-entry" | "view-own-time-entry" | "create-own-time-entry" | "edit-own-time-entry" | "delete-own-time-entry" | "view-tax-type" | "create-tax-type" | "edit-tax-type" | "delete-tax-type" | "view-custom-field" | "create-custom-field" | "edit-custom-field" | "delete-custom-field" | "view-role" | "create-role" | "edit-role" | "delete-role" | "view-financial-reports" | "view-all-notes" | "manage-all-notes" | "time_clock.punch" | "time_clock.view_own" | "time_clock.view_team" | "time_clock.correct" | "absence.request" | "absence.approve" | "report.download_legal" | "view-employee" | "create-employee" | "edit-employee" | "delete-employee" | "view-work-schedule" | "manage-work-schedule" | "view-work-calendar" | "manage-work-calendar" | "pos.operate" | "pos.supervise" | "pos.void" | "pos.discount_high" | "pos.cash_movement" | "pos.return" | "pos.admin" | "pos.report" | "view-appointment" | "create-appointment" | "edit-appointment" | "delete-appointment" | "view-contract" | "create-contract" | "edit-contract" | "delete-contract" | "view-warehouse" | "create-warehouse" | "edit-warehouse" | "delete-warehouse" | "view-stock-count" | "create-stock-count" | "edit-stock-count" | "delete-stock-count";
|
|
8978
9110
|
}[] | null;
|
|
8979
9111
|
};
|
|
8980
9112
|
/** RoleResource */
|
|
@@ -9066,6 +9198,86 @@ export interface components {
|
|
|
9066
9198
|
* pisado de siempre, que es justo lo que el libro viene a retirar.
|
|
9067
9199
|
*/
|
|
9068
9200
|
note: string;
|
|
9201
|
+
/**
|
|
9202
|
+
* @description DÓNDE (N2). Opcional: sin él, el ajuste cae en el almacén por
|
|
9203
|
+
* defecto de la empresa — que es lo que hacía antes de que la
|
|
9204
|
+
* dimensión existiera. Se valida contra los almacenes de ESTA
|
|
9205
|
+
* empresa: un id ajeno no es un error de tipo, es un intento de
|
|
9206
|
+
* escribir en el almacén de otro.
|
|
9207
|
+
*/
|
|
9208
|
+
warehouse_id?: number | null;
|
|
9209
|
+
};
|
|
9210
|
+
/** StockCountLineResource */
|
|
9211
|
+
StockCountLineResource: {
|
|
9212
|
+
id: number;
|
|
9213
|
+
item_id: number;
|
|
9214
|
+
item_name: string;
|
|
9215
|
+
/** @description Lo que el sistema creía CUANDO SE DIBUJÓ la línea. */
|
|
9216
|
+
expected_quantity: number;
|
|
9217
|
+
/**
|
|
9218
|
+
* @description Lo contado. NULL = todavía no se ha contado, que NO es contar
|
|
9219
|
+
* cero: una estantería vacía es un dato y una que nadie ha mirado
|
|
9220
|
+
* no lo es. Las que llegan aquí en NULL no emiten nada al
|
|
9221
|
+
* confirmar.
|
|
9222
|
+
*/
|
|
9223
|
+
counted_quantity: number | null;
|
|
9224
|
+
/**
|
|
9225
|
+
* @description La diferencia que se ENSEÑA mientras se cuenta. ⚠️ No es la que
|
|
9226
|
+
* se aplica al confirmar: esa se calcula contra el saldo de ese
|
|
9227
|
+
* momento, porque contar dice «aquí hay 12», no «quítale 3».
|
|
9228
|
+
*/
|
|
9229
|
+
difference: number | null;
|
|
9230
|
+
/**
|
|
9231
|
+
* @description El asiento que esta línea emitió al confirmar, si emitió alguno
|
|
9232
|
+
* (una línea que cuadra no escribe nada en el libro).
|
|
9233
|
+
*/
|
|
9234
|
+
stock_movement_id: number | null;
|
|
9235
|
+
};
|
|
9236
|
+
/** StockCountRequest */
|
|
9237
|
+
StockCountRequest: {
|
|
9238
|
+
/** Format: date-time */
|
|
9239
|
+
count_date: string;
|
|
9240
|
+
notes?: string | null;
|
|
9241
|
+
warehouse_id?: number | null;
|
|
9242
|
+
/**
|
|
9243
|
+
* @description Sembrar el recuento con lo que el almacén tiene ahora. Solo se
|
|
9244
|
+
* mira en el alta.
|
|
9245
|
+
*/
|
|
9246
|
+
seed?: boolean | null;
|
|
9247
|
+
lines?: {
|
|
9248
|
+
item_id: number;
|
|
9249
|
+
counted_quantity: number | null;
|
|
9250
|
+
}[] | null;
|
|
9251
|
+
};
|
|
9252
|
+
/** StockCountResource */
|
|
9253
|
+
StockCountResource: {
|
|
9254
|
+
id: number;
|
|
9255
|
+
count_number: string;
|
|
9256
|
+
sequence_number: number;
|
|
9257
|
+
/**
|
|
9258
|
+
* @description DRAFT | CONFIRMED | CANCELLED. Un confirmado es historia: ya
|
|
9259
|
+
* emitió sus asientos, y no se edita ni se borra.
|
|
9260
|
+
*/
|
|
9261
|
+
status: string;
|
|
9262
|
+
/** Format: date-time */
|
|
9263
|
+
count_date: string;
|
|
9264
|
+
/**
|
|
9265
|
+
* @description De qué almacén se contó. NULL solo si el almacén se borró
|
|
9266
|
+
* después: el recuento sobrevive a lo que nombra.
|
|
9267
|
+
*/
|
|
9268
|
+
warehouse_id: number | null;
|
|
9269
|
+
warehouse_name: string | null;
|
|
9270
|
+
notes: string | null;
|
|
9271
|
+
/**
|
|
9272
|
+
* Format: date-time
|
|
9273
|
+
* @description Cuándo se confirmó, no solo si: dice además el instante, como
|
|
9274
|
+
* los dos candados del ciclo de stock.
|
|
9275
|
+
*/
|
|
9276
|
+
confirmed_at: string | null;
|
|
9277
|
+
creator_id: number | null;
|
|
9278
|
+
/** Format: date-time */
|
|
9279
|
+
created_at: string | null;
|
|
9280
|
+
lines?: components["schemas"]["StockCountLineResource"][];
|
|
9069
9281
|
};
|
|
9070
9282
|
/** StockMovementResource */
|
|
9071
9283
|
StockMovementResource: {
|
|
@@ -12914,6 +13126,12 @@ export interface operations {
|
|
|
12914
13126
|
quantity: number;
|
|
12915
13127
|
price: number;
|
|
12916
13128
|
}[];
|
|
13129
|
+
/**
|
|
13130
|
+
* @description DE DÓNDE se entrega (N2). Opcional: sin él, el almacén por
|
|
13131
|
+
* defecto. Se valida contra los almacenes de ESTA empresa — un id
|
|
13132
|
+
* ajeno no es un error de tipo, es escribir en el almacén de otro.
|
|
13133
|
+
*/
|
|
13134
|
+
warehouse_id?: number | null;
|
|
12917
13135
|
};
|
|
12918
13136
|
};
|
|
12919
13137
|
};
|
|
@@ -12976,6 +13194,12 @@ export interface operations {
|
|
|
12976
13194
|
quantity: number;
|
|
12977
13195
|
price: number;
|
|
12978
13196
|
}[];
|
|
13197
|
+
/**
|
|
13198
|
+
* @description DE DÓNDE se entrega (N2). Opcional: sin él, el almacén por
|
|
13199
|
+
* defecto. Se valida contra los almacenes de ESTA empresa — un id
|
|
13200
|
+
* ajeno no es un error de tipo, es escribir en el almacén de otro.
|
|
13201
|
+
*/
|
|
13202
|
+
warehouse_id?: number | null;
|
|
12979
13203
|
};
|
|
12980
13204
|
};
|
|
12981
13205
|
};
|
|
@@ -17952,7 +18176,13 @@ export interface operations {
|
|
|
17952
18176
|
};
|
|
17953
18177
|
cookie?: never;
|
|
17954
18178
|
};
|
|
17955
|
-
requestBody?:
|
|
18179
|
+
requestBody?: {
|
|
18180
|
+
content: {
|
|
18181
|
+
"application/json": {
|
|
18182
|
+
warehouse_id?: number | null;
|
|
18183
|
+
};
|
|
18184
|
+
};
|
|
18185
|
+
};
|
|
17956
18186
|
responses: {
|
|
17957
18187
|
/** @description `ReceivedInvoiceResource` */
|
|
17958
18188
|
200: {
|
|
@@ -17965,19 +18195,7 @@ export interface operations {
|
|
|
17965
18195
|
};
|
|
17966
18196
|
};
|
|
17967
18197
|
};
|
|
17968
|
-
422:
|
|
17969
|
-
headers: {
|
|
17970
|
-
[name: string]: unknown;
|
|
17971
|
-
};
|
|
17972
|
-
content: {
|
|
17973
|
-
"application/json": {
|
|
17974
|
-
/** @constant */
|
|
17975
|
-
error: "goods_already_received";
|
|
17976
|
-
/** @constant */
|
|
17977
|
-
message: "La mercancía de esta factura recibida ya se sumó al almacén.";
|
|
17978
|
-
};
|
|
17979
|
-
};
|
|
17980
|
-
};
|
|
18198
|
+
422: components["responses"]["ValidationException"];
|
|
17981
18199
|
};
|
|
17982
18200
|
};
|
|
17983
18201
|
"reconciliation.transactions": {
|
|
@@ -19527,12 +19745,215 @@ export interface operations {
|
|
|
19527
19745
|
422: components["responses"]["ValidationException"];
|
|
19528
19746
|
};
|
|
19529
19747
|
};
|
|
19748
|
+
"stockCounts.confirm": {
|
|
19749
|
+
parameters: {
|
|
19750
|
+
query?: never;
|
|
19751
|
+
header?: never;
|
|
19752
|
+
path: {
|
|
19753
|
+
id: string;
|
|
19754
|
+
};
|
|
19755
|
+
cookie?: never;
|
|
19756
|
+
};
|
|
19757
|
+
requestBody?: never;
|
|
19758
|
+
responses: {
|
|
19759
|
+
200: {
|
|
19760
|
+
headers: {
|
|
19761
|
+
[name: string]: unknown;
|
|
19762
|
+
};
|
|
19763
|
+
content: {
|
|
19764
|
+
"application/json": {
|
|
19765
|
+
data: {
|
|
19766
|
+
id: number;
|
|
19767
|
+
status: string;
|
|
19768
|
+
};
|
|
19769
|
+
meta: {
|
|
19770
|
+
adjusted_lines: number;
|
|
19771
|
+
unchanged_lines: number;
|
|
19772
|
+
uncounted_lines: number;
|
|
19773
|
+
moved_while_counting: number;
|
|
19774
|
+
};
|
|
19775
|
+
};
|
|
19776
|
+
};
|
|
19777
|
+
};
|
|
19778
|
+
403: components["responses"]["AuthorizationException"];
|
|
19779
|
+
};
|
|
19780
|
+
};
|
|
19781
|
+
"stockCounts.cancel": {
|
|
19782
|
+
parameters: {
|
|
19783
|
+
query?: never;
|
|
19784
|
+
header?: never;
|
|
19785
|
+
path: {
|
|
19786
|
+
id: string;
|
|
19787
|
+
};
|
|
19788
|
+
cookie?: never;
|
|
19789
|
+
};
|
|
19790
|
+
requestBody?: never;
|
|
19791
|
+
responses: {
|
|
19792
|
+
/**
|
|
19793
|
+
* @description `StockCountResource`
|
|
19794
|
+
*
|
|
19795
|
+
* Confirmar un recuento en el que nadie contó nada no es «cuadrar
|
|
19796
|
+
* el almacén»: es no haber contado. Decirlo es mejor que sellar un
|
|
19797
|
+
* documento vacío que después parecerá un inventario hecho.
|
|
19798
|
+
*/
|
|
19799
|
+
200: {
|
|
19800
|
+
headers: {
|
|
19801
|
+
[name: string]: unknown;
|
|
19802
|
+
};
|
|
19803
|
+
content: {
|
|
19804
|
+
"application/json": {
|
|
19805
|
+
data: components["schemas"]["StockCountResource"];
|
|
19806
|
+
} | string;
|
|
19807
|
+
};
|
|
19808
|
+
};
|
|
19809
|
+
403: components["responses"]["AuthorizationException"];
|
|
19810
|
+
};
|
|
19811
|
+
};
|
|
19812
|
+
"stock-counts.index": {
|
|
19813
|
+
parameters: {
|
|
19814
|
+
query?: {
|
|
19815
|
+
/** @description Solo los de este estado (`DRAFT`, `CONFIRMED`, `CANCELLED`). */
|
|
19816
|
+
status?: string;
|
|
19817
|
+
/** @description Solo los de este almacén. */
|
|
19818
|
+
warehouse_id?: number;
|
|
19819
|
+
};
|
|
19820
|
+
header?: never;
|
|
19821
|
+
path?: never;
|
|
19822
|
+
cookie?: never;
|
|
19823
|
+
};
|
|
19824
|
+
requestBody?: never;
|
|
19825
|
+
responses: {
|
|
19826
|
+
/** @description Array of `StockCountResource` */
|
|
19827
|
+
200: {
|
|
19828
|
+
headers: {
|
|
19829
|
+
[name: string]: unknown;
|
|
19830
|
+
};
|
|
19831
|
+
content: {
|
|
19832
|
+
"application/json": {
|
|
19833
|
+
data: components["schemas"]["StockCountResource"][];
|
|
19834
|
+
};
|
|
19835
|
+
};
|
|
19836
|
+
};
|
|
19837
|
+
403: components["responses"]["AuthorizationException"];
|
|
19838
|
+
};
|
|
19839
|
+
};
|
|
19840
|
+
"stock-counts.store": {
|
|
19841
|
+
parameters: {
|
|
19842
|
+
query?: never;
|
|
19843
|
+
header?: never;
|
|
19844
|
+
path?: never;
|
|
19845
|
+
cookie?: never;
|
|
19846
|
+
};
|
|
19847
|
+
requestBody: {
|
|
19848
|
+
content: {
|
|
19849
|
+
"application/json": components["schemas"]["StockCountRequest"];
|
|
19850
|
+
};
|
|
19851
|
+
};
|
|
19852
|
+
responses: {
|
|
19853
|
+
/** @description El recurso recién creado. */
|
|
19854
|
+
201: {
|
|
19855
|
+
headers: {
|
|
19856
|
+
[name: string]: unknown;
|
|
19857
|
+
};
|
|
19858
|
+
content: {
|
|
19859
|
+
"application/json": 201;
|
|
19860
|
+
};
|
|
19861
|
+
};
|
|
19862
|
+
403: components["responses"]["AuthorizationException"];
|
|
19863
|
+
422: components["responses"]["ValidationException"];
|
|
19864
|
+
};
|
|
19865
|
+
};
|
|
19866
|
+
"stock-counts.show": {
|
|
19867
|
+
parameters: {
|
|
19868
|
+
query?: never;
|
|
19869
|
+
header?: never;
|
|
19870
|
+
path: {
|
|
19871
|
+
stock_count: string;
|
|
19872
|
+
};
|
|
19873
|
+
cookie?: never;
|
|
19874
|
+
};
|
|
19875
|
+
requestBody?: never;
|
|
19876
|
+
responses: {
|
|
19877
|
+
/** @description `StockCountResource` */
|
|
19878
|
+
200: {
|
|
19879
|
+
headers: {
|
|
19880
|
+
[name: string]: unknown;
|
|
19881
|
+
};
|
|
19882
|
+
content: {
|
|
19883
|
+
"application/json": {
|
|
19884
|
+
data: components["schemas"]["StockCountResource"] & Record<string, never>;
|
|
19885
|
+
};
|
|
19886
|
+
};
|
|
19887
|
+
};
|
|
19888
|
+
403: components["responses"]["AuthorizationException"];
|
|
19889
|
+
};
|
|
19890
|
+
};
|
|
19891
|
+
"stock-counts.update": {
|
|
19892
|
+
parameters: {
|
|
19893
|
+
query?: never;
|
|
19894
|
+
header?: never;
|
|
19895
|
+
path: {
|
|
19896
|
+
stock_count: string;
|
|
19897
|
+
};
|
|
19898
|
+
cookie?: never;
|
|
19899
|
+
};
|
|
19900
|
+
requestBody: {
|
|
19901
|
+
content: {
|
|
19902
|
+
"application/json": components["schemas"]["StockCountRequest"];
|
|
19903
|
+
};
|
|
19904
|
+
};
|
|
19905
|
+
responses: {
|
|
19906
|
+
/**
|
|
19907
|
+
* @description `StockCountResource`
|
|
19908
|
+
*
|
|
19909
|
+
* Confirmar un recuento en el que nadie contó nada no es «cuadrar
|
|
19910
|
+
* el almacén»: es no haber contado. Decirlo es mejor que sellar un
|
|
19911
|
+
* documento vacío que después parecerá un inventario hecho.
|
|
19912
|
+
*/
|
|
19913
|
+
200: {
|
|
19914
|
+
headers: {
|
|
19915
|
+
[name: string]: unknown;
|
|
19916
|
+
};
|
|
19917
|
+
content: {
|
|
19918
|
+
"application/json": {
|
|
19919
|
+
data: components["schemas"]["StockCountResource"] & Record<string, never>;
|
|
19920
|
+
} | string;
|
|
19921
|
+
};
|
|
19922
|
+
};
|
|
19923
|
+
403: components["responses"]["AuthorizationException"];
|
|
19924
|
+
422: components["responses"]["ValidationException"];
|
|
19925
|
+
};
|
|
19926
|
+
};
|
|
19927
|
+
"stock-counts.destroy": {
|
|
19928
|
+
parameters: {
|
|
19929
|
+
query?: never;
|
|
19930
|
+
header?: never;
|
|
19931
|
+
path: {
|
|
19932
|
+
stock_count: string;
|
|
19933
|
+
};
|
|
19934
|
+
cookie?: never;
|
|
19935
|
+
};
|
|
19936
|
+
requestBody?: never;
|
|
19937
|
+
responses: {
|
|
19938
|
+
200: {
|
|
19939
|
+
headers: {
|
|
19940
|
+
[name: string]: unknown;
|
|
19941
|
+
};
|
|
19942
|
+
content: {
|
|
19943
|
+
"application/json": {
|
|
19944
|
+
success: string;
|
|
19945
|
+
};
|
|
19946
|
+
};
|
|
19947
|
+
};
|
|
19948
|
+
403: components["responses"]["AuthorizationException"];
|
|
19949
|
+
};
|
|
19950
|
+
};
|
|
19530
19951
|
"stockMovements.index": {
|
|
19531
19952
|
parameters: {
|
|
19532
19953
|
query?: {
|
|
19533
19954
|
/** @description Solo los asientos de este artículo. */
|
|
19534
19955
|
item_id?: number;
|
|
19535
|
-
/** @description Solo los asientos con este motivo (`initial`, `import`, `manual_edit`, `manual_adjustment`, `purchase`, `sale_invoice`, `delivery_note`, `pos_sale`, `pos_return`). */
|
|
19956
|
+
/** @description Solo los asientos con este motivo (`initial`, `import`, `manual_edit`, `manual_adjustment`, `purchase`, `sale_invoice`, `delivery_note`, `pos_sale`, `pos_return`, `count`). */
|
|
19536
19957
|
reason?: string;
|
|
19537
19958
|
/** @description Solo los asientos de este almacén. */
|
|
19538
19959
|
warehouse_id?: number;
|
package/dist/client.d.ts
CHANGED
|
@@ -29,6 +29,8 @@ export type ContractResource = Schemas['ContractResource'];
|
|
|
29
29
|
export type WarehouseResource = Schemas['WarehouseResource'];
|
|
30
30
|
/** El saldo de un artículo EN un almacén. */
|
|
31
31
|
export type ItemWarehouseStockResource = Schemas['ItemWarehouseStockResource'];
|
|
32
|
+
/** Un recuento de inventario tal y como lo devuelve la API. */
|
|
33
|
+
export type StockCountResource = Schemas['StockCountResource'];
|
|
32
34
|
/** Cuerpo de alta/edición de cliente. Incluye `customFields`. */
|
|
33
35
|
export type CustomerRequest = Schemas['CustomerRequest'];
|
|
34
36
|
/** Cuerpo de alta/edición de factura. Incluye `customFields`. */
|
|
@@ -46,6 +48,12 @@ export type ContractRequest = Schemas['ContractRequest'];
|
|
|
46
48
|
* misma transacción, porque la empresa necesita exactamente uno.
|
|
47
49
|
*/
|
|
48
50
|
export type WarehouseRequest = Schemas['WarehouseRequest'];
|
|
51
|
+
/**
|
|
52
|
+
* Cuerpo del alta y del conteo de un recuento. ⚠️ En `lines`,
|
|
53
|
+
* `counted_quantity: null` es «sin contar» y **no** es cero: las líneas en
|
|
54
|
+
* null no emiten nada al confirmar.
|
|
55
|
+
*/
|
|
56
|
+
export type StockCountRequest = Schemas['StockCountRequest'];
|
|
49
57
|
/**
|
|
50
58
|
* El sobre `{ data: … }` de Laravel para las escrituras que el spec **no
|
|
51
59
|
* tipa**.
|
|
@@ -861,6 +869,97 @@ export declare class PimiaClient {
|
|
|
861
869
|
};
|
|
862
870
|
}>;
|
|
863
871
|
};
|
|
872
|
+
/**
|
|
873
|
+
* Recuentos de inventario: contar un almacén y cuadrarlo de una vez. Exige
|
|
874
|
+
* `items:read` / `items:write` y el módulo `stock` (opt-in), como el resto.
|
|
875
|
+
*
|
|
876
|
+
* El ciclo es **contar → mirar diferencias → confirmar**, y los dos últimos
|
|
877
|
+
* pasos son llamadas distintas a propósito:
|
|
878
|
+
*
|
|
879
|
+
* - `update` escribe lo contado y **no mueve una sola existencia**;
|
|
880
|
+
* - `confirm` emite los ajustes en bloque, uno por línea con diferencia,
|
|
881
|
+
* todos con motivo `count` y en la misma transacción.
|
|
882
|
+
*
|
|
883
|
+
* ⛔ **Dos cosas que hay que tener delante para no programar contra una
|
|
884
|
+
* aritmética que el servidor no garantiza:**
|
|
885
|
+
*
|
|
886
|
+
* 1. **La diferencia se calcula al CONFIRMAR**, contra el saldo de ese
|
|
887
|
+
* momento: un recuento dice «aquí hay 12», no «quítale 3». Si algo se
|
|
888
|
+
* movió entre contar y confirmar, el almacén queda igualmente en lo
|
|
889
|
+
* contado, y el `meta.moved_while_counting` de la respuesta dice cuántas
|
|
890
|
+
* líneas fueron.
|
|
891
|
+
* 2. **`counted_quantity: null` es «sin contar», y no es cero.** Las líneas
|
|
892
|
+
* en null no emiten nada; mandar 0 es declarar que miraste y no había.
|
|
893
|
+
*/
|
|
894
|
+
get stockCounts(): {
|
|
895
|
+
list: (query?: RequestOptions["query"], options?: ReadOptions) => Promise<{
|
|
896
|
+
data: components["schemas"]["StockCountResource"][];
|
|
897
|
+
}>;
|
|
898
|
+
get: (id: number | string, options?: ReadOptions) => Promise<{
|
|
899
|
+
data: components["schemas"]["StockCountResource"] & Record<string, never>;
|
|
900
|
+
}>;
|
|
901
|
+
/**
|
|
902
|
+
* Abre el recuento. Nace **sembrado** con lo que el almacén dice tener
|
|
903
|
+
* (`seed`, por defecto sí): contar es corregir una lista, no escribirla.
|
|
904
|
+
*/
|
|
905
|
+
create: (body: StockCountRequest, options?: WriteOptions) => Promise<ResourceEnvelope<{
|
|
906
|
+
id: number;
|
|
907
|
+
count_number: string;
|
|
908
|
+
sequence_number: number;
|
|
909
|
+
status: string;
|
|
910
|
+
count_date: string;
|
|
911
|
+
warehouse_id: number | null;
|
|
912
|
+
warehouse_name: string | null;
|
|
913
|
+
notes: string | null;
|
|
914
|
+
confirmed_at: string | null;
|
|
915
|
+
creator_id: number | null;
|
|
916
|
+
created_at: string | null;
|
|
917
|
+
lines?: components["schemas"]["StockCountLineResource"][];
|
|
918
|
+
}>>;
|
|
919
|
+
/** Cuenta: escribe lo contado. No mueve el almacén. */
|
|
920
|
+
update: (id: number | string, body: StockCountRequest, options?: WriteOptions) => Promise<ResourceEnvelope<{
|
|
921
|
+
id: number;
|
|
922
|
+
count_number: string;
|
|
923
|
+
sequence_number: number;
|
|
924
|
+
status: string;
|
|
925
|
+
count_date: string;
|
|
926
|
+
warehouse_id: number | null;
|
|
927
|
+
warehouse_name: string | null;
|
|
928
|
+
notes: string | null;
|
|
929
|
+
confirmed_at: string | null;
|
|
930
|
+
creator_id: number | null;
|
|
931
|
+
created_at: string | null;
|
|
932
|
+
lines?: components["schemas"]["StockCountLineResource"][];
|
|
933
|
+
}>>;
|
|
934
|
+
/**
|
|
935
|
+
* Confirma: emite los ajustes en bloque. La respuesta trae el resumen en
|
|
936
|
+
* `meta` — cuántas líneas se ajustaron, cuántas cuadraban, cuántas
|
|
937
|
+
* quedaron sin contar y cuántas se movieron mientras se contaba.
|
|
938
|
+
*/
|
|
939
|
+
confirm: (id: number | string, options?: WriteOptions) => Promise<{
|
|
940
|
+
data: {
|
|
941
|
+
id: number;
|
|
942
|
+
status: string;
|
|
943
|
+
};
|
|
944
|
+
meta: {
|
|
945
|
+
adjusted_lines: number;
|
|
946
|
+
unchanged_lines: number;
|
|
947
|
+
uncounted_lines: number;
|
|
948
|
+
moved_while_counting: number;
|
|
949
|
+
};
|
|
950
|
+
}>;
|
|
951
|
+
/** Cancela un borrador. Uno confirmado ya movió el almacén: 422. */
|
|
952
|
+
cancel: (id: number | string, options?: WriteOptions) => Promise<string | {
|
|
953
|
+
data: components["schemas"]["StockCountResource"];
|
|
954
|
+
}>;
|
|
955
|
+
/**
|
|
956
|
+
* Borra un recuento que no ha movido nada. Uno confirmado **no se
|
|
957
|
+
* borra**: sus asientos explican el saldo de hoy.
|
|
958
|
+
*/
|
|
959
|
+
delete: (id: number | string, options?: ReadOptions) => Promise<{
|
|
960
|
+
success: string;
|
|
961
|
+
}>;
|
|
962
|
+
};
|
|
864
963
|
get<T = unknown>(path: string, query?: RequestOptions['query'], options?: ReadOptions): Promise<T>;
|
|
865
964
|
post<T = unknown>(path: string, body?: unknown, options?: WriteOptions): Promise<T>;
|
|
866
965
|
put<T = unknown>(path: string, body?: unknown, options?: WriteOptions): Promise<T>;
|
package/dist/client.js
CHANGED
|
@@ -197,6 +197,54 @@ export class PimiaClient {
|
|
|
197
197
|
stock: (id, query, options) => this.get(`/warehouses/${id}/stock`, query, options),
|
|
198
198
|
};
|
|
199
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Recuentos de inventario: contar un almacén y cuadrarlo de una vez. Exige
|
|
202
|
+
* `items:read` / `items:write` y el módulo `stock` (opt-in), como el resto.
|
|
203
|
+
*
|
|
204
|
+
* El ciclo es **contar → mirar diferencias → confirmar**, y los dos últimos
|
|
205
|
+
* pasos son llamadas distintas a propósito:
|
|
206
|
+
*
|
|
207
|
+
* - `update` escribe lo contado y **no mueve una sola existencia**;
|
|
208
|
+
* - `confirm` emite los ajustes en bloque, uno por línea con diferencia,
|
|
209
|
+
* todos con motivo `count` y en la misma transacción.
|
|
210
|
+
*
|
|
211
|
+
* ⛔ **Dos cosas que hay que tener delante para no programar contra una
|
|
212
|
+
* aritmética que el servidor no garantiza:**
|
|
213
|
+
*
|
|
214
|
+
* 1. **La diferencia se calcula al CONFIRMAR**, contra el saldo de ese
|
|
215
|
+
* momento: un recuento dice «aquí hay 12», no «quítale 3». Si algo se
|
|
216
|
+
* movió entre contar y confirmar, el almacén queda igualmente en lo
|
|
217
|
+
* contado, y el `meta.moved_while_counting` de la respuesta dice cuántas
|
|
218
|
+
* líneas fueron.
|
|
219
|
+
* 2. **`counted_quantity: null` es «sin contar», y no es cero.** Las líneas
|
|
220
|
+
* en null no emiten nada; mandar 0 es declarar que miraste y no había.
|
|
221
|
+
*/
|
|
222
|
+
get stockCounts() {
|
|
223
|
+
return {
|
|
224
|
+
list: (query, options) => this.get('/stock-counts', query, options),
|
|
225
|
+
get: (id, options) => this.get(`/stock-counts/${id}`, undefined, options),
|
|
226
|
+
/**
|
|
227
|
+
* Abre el recuento. Nace **sembrado** con lo que el almacén dice tener
|
|
228
|
+
* (`seed`, por defecto sí): contar es corregir una lista, no escribirla.
|
|
229
|
+
*/
|
|
230
|
+
create: (body, options) => this.post('/stock-counts', body, options),
|
|
231
|
+
/** Cuenta: escribe lo contado. No mueve el almacén. */
|
|
232
|
+
update: (id, body, options) => this.put(`/stock-counts/${id}`, body, options),
|
|
233
|
+
/**
|
|
234
|
+
* Confirma: emite los ajustes en bloque. La respuesta trae el resumen en
|
|
235
|
+
* `meta` — cuántas líneas se ajustaron, cuántas cuadraban, cuántas
|
|
236
|
+
* quedaron sin contar y cuántas se movieron mientras se contaba.
|
|
237
|
+
*/
|
|
238
|
+
confirm: (id, options) => this.post(`/stock-counts/${id}/confirm`, {}, options),
|
|
239
|
+
/** Cancela un borrador. Uno confirmado ya movió el almacén: 422. */
|
|
240
|
+
cancel: (id, options) => this.post(`/stock-counts/${id}/cancel`, {}, options),
|
|
241
|
+
/**
|
|
242
|
+
* Borra un recuento que no ha movido nada. Uno confirmado **no se
|
|
243
|
+
* borra**: sus asientos explican el saldo de hoy.
|
|
244
|
+
*/
|
|
245
|
+
delete: (id, options) => this.delete(`/stock-counts/${id}`, options),
|
|
246
|
+
};
|
|
247
|
+
}
|
|
200
248
|
get(path, query, options) {
|
|
201
249
|
return this.request(path, { ...options, method: 'GET', query });
|
|
202
250
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* salen los tipos de `./api`.
|
|
7
7
|
*/
|
|
8
8
|
export { PimiaClient, toFormData } from './client.js';
|
|
9
|
-
export type { ContractRequest, ContractResource, CustomerRequest, CustomerResource, EstimateResource, EstimatesRequest, InvoiceResource, InvoicesRequest, ItemWarehouseStockResource, PimiaClientOptions, RateLimit, ReadOptions, RequestOptions, ResourceEnvelope, ResponseMeta, ResponseWithMeta, WarehouseRequest, WarehouseResource, WriteOptions, } from './client.js';
|
|
9
|
+
export type { ContractRequest, ContractResource, CustomerRequest, CustomerResource, EstimateResource, EstimatesRequest, InvoiceResource, InvoicesRequest, ItemWarehouseStockResource, PimiaClientOptions, RateLimit, ReadOptions, RequestOptions, ResourceEnvelope, ResponseMeta, ResponseWithMeta, StockCountRequest, StockCountResource, WarehouseRequest, WarehouseResource, WriteOptions, } from './client.js';
|
|
10
10
|
export { OAuth, createPkceChallenge, createState } from './oauth.js';
|
|
11
11
|
export type { AuthorizationServerMetadata, AuthorizeUrlOptions, OAuthConfig, PkceChallenge, } from './oauth.js';
|
|
12
12
|
export { MemoryTokenStore, isExpired, tokenSetFromResponse } from './tokens.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pimia/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Cliente TypeScript de la API de Pimia para apps de partner: OAuth con PKCE, rotación de refresh persistida, reintentos de rate limit y tipos generados del OpenAPI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Pimia (https://pimia.es)",
|