repzo 1.0.17 → 1.0.20

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.
@@ -3419,6 +3419,7 @@ export namespace Service {
3419
3419
  creator?: string[] | string;
3420
3420
  clients?: string[] | string;
3421
3421
  withPrintDetails?: boolean;
3422
+ "serial_number.formatted"?: string[] | string;
3422
3423
  [key: string]: any; // integration_meta.
3423
3424
  populatedKeys?: PopulatedKeys[];
3424
3425
  };
@@ -3452,6 +3453,132 @@ export namespace Service {
3452
3453
  }
3453
3454
  }
3454
3455
 
3456
+ export namespace Refund {
3457
+ export interface RefundSchema {
3458
+ _id: string;
3459
+ status: RefundStatus;
3460
+ remainder: number;
3461
+ amount: number;
3462
+ client_id: string;
3463
+ client_name: string;
3464
+ creator: AdminCreator | RepCreator;
3465
+ time?: number;
3466
+ serial_number: SerialNumber;
3467
+ route?: string;
3468
+ paytime: string;
3469
+ note?: string;
3470
+ currency: string;
3471
+ transaction_type: RefundType;
3472
+ check?: Check;
3473
+ LinkedTxn?: {
3474
+ Txn_serial_number: SerialNumber;
3475
+ Txn_invoice_total: number;
3476
+ TxnType: "return_invoice" | "payment" | "invoice";
3477
+ };
3478
+ company_namespace: string[];
3479
+ integration_meta?: { [key: string]: any };
3480
+ sync_id: string;
3481
+ custom_status?: string;
3482
+ visit_id?: string;
3483
+ teams?: string[];
3484
+ paymentsData: {
3485
+ amount: number;
3486
+ paid: number;
3487
+ balance: number;
3488
+ payments: PaymentData[];
3489
+ };
3490
+ createdAt: string;
3491
+ updatedAt: string;
3492
+ __v: number;
3493
+ }
3494
+ interface CreateBody {
3495
+ amount: number;
3496
+ client_id: string;
3497
+ client_name: string;
3498
+ time?: number;
3499
+ serial_number?: SerialNumber;
3500
+ route?: string;
3501
+ paytime: string;
3502
+ note?: string;
3503
+ currency: string;
3504
+ transaction_type: RefundType;
3505
+ check?: Check;
3506
+ LinkedTxn?: {
3507
+ Txn_serial_number: SerialNumber;
3508
+ Txn_invoice_total: number;
3509
+ TxnType: "return_invoice" | "payment" | "invoice";
3510
+ };
3511
+ company_namespace?: string[];
3512
+ integration_meta?: { [key: string]: any };
3513
+ sync_id: string;
3514
+ custom_status?: string;
3515
+ visit_id?: string;
3516
+ teams?: string[];
3517
+ }
3518
+ interface UpdateBody {
3519
+ integration_meta?: { [key: string]: any };
3520
+ }
3521
+
3522
+ type RefundSchemaWithPopulatedKeys = RefundSchema & {
3523
+ balance_to_refund: number;
3524
+ custom_status?: string | CustomStatus.CustomStatusSchema;
3525
+ check?: Check & { bank: Bank.BankSchema };
3526
+ invoice?: {
3527
+ invoice_serial_number: string;
3528
+ invoice_date: string;
3529
+ invoice_due_date: string;
3530
+ original_amount: number;
3531
+ refund: number;
3532
+ };
3533
+ };
3534
+ type RefundType = "check" | "cash";
3535
+ type PopulatedKeys = "custom_status";
3536
+ type RefundStatus = "consumed" | "unconsumed" | "partially_consumed";
3537
+ export namespace Find {
3538
+ export type Params = DefaultPaginationQueryParams & {
3539
+ _id?: string[] | string;
3540
+ "creator._id"?: string[] | string;
3541
+ client_id?: string[] | string;
3542
+ from_paytime?: number;
3543
+ to_paytime?: number;
3544
+ custom_status?: string[] | string;
3545
+ transaction_type?: RefundType | RefundType[];
3546
+ creator?: string[] | string;
3547
+ clients?: string[] | string;
3548
+ withPrintDetails?: boolean;
3549
+ [key: string]: any; // integration_meta.
3550
+ populatedKeys?: PopulatedKeys[];
3551
+ };
3552
+ export interface Result extends DefaultPaginationResult {
3553
+ data: RefundSchemaWithPopulatedKeys[];
3554
+ absolute_total: number;
3555
+ page_total: number;
3556
+ }
3557
+ }
3558
+
3559
+ export namespace Get {
3560
+ export type ID = string;
3561
+ export interface Params {
3562
+ withPrintDetails?: boolean;
3563
+ populatedKeys?: PopulatedKeys[];
3564
+ }
3565
+ export type Result = RefundSchemaWithPopulatedKeys & {
3566
+ custom_status: CustomStatus.CustomStatusSchema;
3567
+ };
3568
+ }
3569
+
3570
+ export namespace Create {
3571
+ export type Body = CreateBody;
3572
+ export type Result = RefundSchema;
3573
+ }
3574
+
3575
+ export namespace Update {
3576
+ export type ID = string;
3577
+ export type Body = UpdateBody;
3578
+ export type Result = RefundSchema;
3579
+ }
3580
+ }
3581
+
3455
3582
  export namespace Cycle {
3456
3583
  type CycleStatus = "pending" | "approved" | "processing" | "rejected";
3457
3584
  export interface Schema {
@@ -3837,7 +3964,7 @@ export namespace Service {
3837
3964
  sync_id: string;
3838
3965
  action: string;
3839
3966
  status: Status;
3840
- error?: { [key: string]: any };
3967
+ error?: { [key: string]: any } | { [key: string]: any }[];
3841
3968
  start_time: number;
3842
3969
  end_time?: number;
3843
3970
  total_time?: number;
@@ -3858,7 +3985,7 @@ export namespace Service {
3858
3985
  sync_id?: string;
3859
3986
  action: string;
3860
3987
  status: Status;
3861
- error?: { [key: string]: any };
3988
+ error?: { [key: string]: any } | { [key: string]: any }[];
3862
3989
  start_time: number;
3863
3990
  end_time?: number;
3864
3991
  total_time?: number;
@@ -3943,7 +4070,7 @@ export namespace Service {
3943
4070
  available_app_id: string;
3944
4071
  app_id: string;
3945
4072
  status: Status;
3946
- error?: { [key: string]: any };
4073
+ error?: { [key: string]: any } | { [key: string]: any }[];
3947
4074
  start_time: number;
3948
4075
  end_time?: number;
3949
4076
  total_time?: number;
@@ -3973,7 +4100,7 @@ export namespace Service {
3973
4100
  available_app_id: string;
3974
4101
  app_id: string;
3975
4102
  status: Status;
3976
- error?: { [key: string]: any };
4103
+ error?: { [key: string]: any } | { [key: string]: any }[];
3977
4104
  start_time: number;
3978
4105
  end_time?: number;
3979
4106
  total_time?: number;
package/test.ts CHANGED
@@ -1,8 +1,8 @@
1
- import Repzo from "./src/index.js";
2
- let repzo = new Repzo("");
3
- let clients = repzo.client.find({ search: "Mecca" });
4
- console.log(clients);
5
- repzo.client.create({ name: "kf" });
6
- repzo.headers["ho"] = "faf";
7
- repzo.client.update("", {});
8
- // repzo.
1
+ import Repzo from "./src/index.js";
2
+ let repzo = new Repzo("");
3
+ let clients = repzo.client.find({ search: "Mecca" });
4
+ console.log(clients);
5
+ repzo.client.create({ name: "kf" });
6
+ repzo.headers["ho"] = "faf";
7
+ repzo.client.update("", {});
8
+ // repzo.
package/tsconfig.json CHANGED
@@ -1,17 +1,17 @@
1
- {
2
- "compilerOptions": {
3
- "outDir": "./lib",
4
- "allowJs": true,
5
- "target": "ES2020",
6
- "module": "ES2020",
7
- "esModuleInterop": true,
8
- "moduleResolution": "Node",
9
- "resolveJsonModule": true,
10
- "noImplicitThis": false,
11
- "strict": true,
12
- "declaration": true
13
- },
14
- "ts-node": { "esm": true },
15
- "include": ["src/**/*"],
16
- "exclude": ["node_modules", "test/**/*", "**/*.spec.ts"]
17
- }
1
+ {
2
+ "compilerOptions": {
3
+ "outDir": "./lib",
4
+ "allowJs": true,
5
+ "target": "ES2020",
6
+ "module": "ES2020",
7
+ "esModuleInterop": true,
8
+ "moduleResolution": "Node",
9
+ "resolveJsonModule": true,
10
+ "noImplicitThis": false,
11
+ "strict": true,
12
+ "declaration": true
13
+ },
14
+ "ts-node": { "esm": true },
15
+ "include": ["src/**/*"],
16
+ "exclude": ["node_modules", "test/**/*", "**/*.spec.ts"]
17
+ }