repzo 1.0.193 → 1.0.194

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/lib/index.d.ts CHANGED
@@ -102,10 +102,11 @@ export declare const end_points: {
102
102
  readonly REPORT_SORT: "report-sort";
103
103
  readonly REPORT_FILTER: "report-filter";
104
104
  readonly SAFE_CRUD: "safe-crud";
105
+ readonly PAYMENT_METHOD: "payment-method";
105
106
  };
106
- export type EndPoints = typeof end_points[keyof typeof end_points];
107
+ export type EndPoints = (typeof end_points)[keyof typeof end_points];
107
108
  export declare const availableService: readonly ["client", "product", "variant", "category", "sub_category", "brand", "product_group", "tax", "measureunit", "measureunitFamily", "media", "priceList", "priceListItem", "team", "returnReason", "rep", "tag", "warehouse", "route", "productModifiersGroup", "channel", "speciality", "clientContact", "paymentTerm", "bank", "bank_list", "customStatus", "customList", "customListItem", "inventoryAdjustmentReason", "workorder", "workorderRequest", "supplier", "quickConvertToPdf", "visit", "activityFeedback", "activityFeedbackV2", "feedbackOption", "invoice", "proforma", "payment", "refund", "settlement", "check", "day", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "adjustInventory", "inventory", "integrationApp", "joinActionsWebHook", "patchAction", "updateIntegrationMeta", "assetPartType", "assetPart", "assetPartUnit", "assetPartReceival", "assetPartTransfer", "returnAssetPartUnit", "storeAssetPartUnit", "ocrInvoiceJobTemplate", "ocrInvoiceJobGroup", "activityAiSalesOrder", "ocrInvoiceJob", "ocrInvoiceJobPage", "settings", "mailUnsubscribe", "approvalRequest", "safeInvoiceSerialCounter", "clientLocation", "assetType", "asset", "assetUnit", "workorderPortal", "approval", "workorderCategory", "contract", "contractInstallment", "repBalanceSummary", "workorderPortalLink", "customField", "salesAnalyticsReport"];
108
- export type AvailableService = typeof availableService[number];
109
+ export type AvailableService = (typeof availableService)[number];
109
110
  export default class Repzo {
110
111
  private svAPIEndpoint;
111
112
  headers: Headers;
@@ -215,6 +216,7 @@ export default class Repzo {
215
216
  readonly REPORT_SORT: "report-sort";
216
217
  readonly REPORT_FILTER: "report-filter";
217
218
  readonly SAFE_CRUD: "safe-crud";
219
+ readonly PAYMENT_METHOD: "payment-method";
218
220
  };
219
221
  private _fetch;
220
222
  private _create;
@@ -1022,4 +1024,12 @@ export default class Repzo {
1022
1024
  _path: "safe-crud";
1023
1025
  create: (body: Service.SafeCrud.Create.Body) => Promise<Service.SafeCrud.Create.Result>;
1024
1026
  };
1027
+ paymentMethod: {
1028
+ _path: "payment-method";
1029
+ find: (params?: Service.PaymentMethod.Find.Params) => Promise<Service.PaymentMethod.Find.Result>;
1030
+ get: (id: Service.PaymentMethod.Get.ID, params?: Service.PaymentMethod.Get.Params) => Promise<Service.PaymentMethod.Get.Result>;
1031
+ create: (body: Service.PaymentMethod.Create.Body) => Promise<Service.PaymentMethod.Create.Result>;
1032
+ update: (id: Service.PaymentMethod.Update.ID, body: Service.PaymentMethod.Update.Body) => Promise<Service.PaymentMethod.Update.Result>;
1033
+ remove: (id: Service.PaymentMethod.Update.ID, params: Service.PaymentMethod.Remove.Params) => Promise<Service.PaymentMethod.Remove.Result>;
1034
+ };
1025
1035
  }
package/lib/index.js CHANGED
@@ -103,6 +103,7 @@ export const end_points = {
103
103
  REPORT_SORT: "report-sort",
104
104
  REPORT_FILTER: "report-filter",
105
105
  SAFE_CRUD: "safe-crud",
106
+ PAYMENT_METHOD: "payment-method",
106
107
  };
107
108
  export const availableService = [
108
109
  "client",
@@ -2096,6 +2097,28 @@ class Repzo {
2096
2097
  return res;
2097
2098
  },
2098
2099
  };
2100
+ this.paymentMethod = {
2101
+ _path: Repzo._end_points.PAYMENT_METHOD,
2102
+ find: async (params) => {
2103
+ let res = await this._fetch(this.svAPIEndpoint, this.paymentMethod._path, params);
2104
+ return res;
2105
+ },
2106
+ get: async (id, params) => {
2107
+ return await this._fetch(this.svAPIEndpoint, this.paymentMethod._path + `/${id}`, params);
2108
+ },
2109
+ create: async (body) => {
2110
+ let res = await this._create(this.svAPIEndpoint, this.paymentMethod._path, body);
2111
+ return res;
2112
+ },
2113
+ update: async (id, body) => {
2114
+ let res = await this._update(this.svAPIEndpoint, this.paymentMethod._path + `/${id}`, body);
2115
+ return res;
2116
+ },
2117
+ remove: async (id, params) => {
2118
+ let res = await this._delete(this.svAPIEndpoint, this.paymentMethod._path + `/${id}`, params);
2119
+ return res;
2120
+ },
2121
+ };
2099
2122
  this.svAPIEndpoint =
2100
2123
  !options?.env || options?.env == "production"
2101
2124
  ? "https://sv.api.repzo.me"
@@ -6978,22 +6978,23 @@ export declare namespace Service {
6978
6978
  }
6979
6979
  namespace Payment {
6980
6980
  export interface PaymentSchema {
6981
- _id: string;
6981
+ _id: StringId;
6982
6982
  status: PaymentStatus;
6983
6983
  remainder: number;
6984
6984
  amount: number;
6985
- client_id: string;
6985
+ client_id: StringId;
6986
6986
  client_name: string;
6987
6987
  creator: AdminCreator | RepCreator;
6988
6988
  implemented_by?: AdminCreator | RepCreator;
6989
6989
  transaction_processed: boolean;
6990
6990
  time?: number;
6991
6991
  serial_number: SerialNumber;
6992
- route?: string;
6992
+ route?: StringId;
6993
6993
  paytime: string;
6994
6994
  note?: string;
6995
6995
  currency: string;
6996
6996
  payment_type: PaymentType;
6997
+ payment_method?: StringId;
6997
6998
  check?: Check;
6998
6999
  LinkedTxn?: {
6999
7000
  Txn_serial_number: SerialNumber;
@@ -7009,18 +7010,28 @@ export declare namespace Service {
7009
7010
  [key: string]: any;
7010
7011
  };
7011
7012
  sync_id: string;
7012
- custom_status?: string;
7013
+ custom_status?: StringId;
7013
7014
  visit_id?: string;
7014
- teams?: string[];
7015
+ teams?: StringId[];
7015
7016
  paymentsData: {
7016
7017
  amount: number;
7017
7018
  paid: number;
7018
7019
  balance: number;
7019
7020
  payments: PaymentData[];
7020
7021
  };
7022
+ reference?: string;
7023
+ media?: StringId[];
7024
+ network_state?: number;
7025
+ platform?: string;
7026
+ version_name?: string;
7027
+ battery_level?: number;
7028
+ time_zone?: string;
7029
+ identifier?: number;
7030
+ device_id?: string;
7031
+ device_unique_id?: string;
7032
+ ending_balance?: number;
7021
7033
  createdAt: string;
7022
7034
  updatedAt: string;
7023
- ending_balance?: number;
7024
7035
  __v: number;
7025
7036
  }
7026
7037
  export type Data = PaymentSchema;
@@ -7035,6 +7046,7 @@ export declare namespace Service {
7035
7046
  note?: string;
7036
7047
  currency: string;
7037
7048
  payment_type: PaymentType;
7049
+ payment_method?: StringId;
7038
7050
  transaction_processed: boolean;
7039
7051
  check?: Check;
7040
7052
  LinkedTxn?: {
@@ -7054,6 +7066,8 @@ export declare namespace Service {
7054
7066
  custom_status?: string;
7055
7067
  visit_id?: string;
7056
7068
  teams?: string[];
7069
+ reference?: string;
7070
+ media?: StringId[];
7057
7071
  }
7058
7072
  export interface UpdateBody {
7059
7073
  integration_meta?: {
@@ -7073,11 +7087,13 @@ export declare namespace Service {
7073
7087
  original_amount: number;
7074
7088
  payment: number;
7075
7089
  };
7076
- teams?: string[] | Team.TeamSchema[];
7077
- route?: string | Route.RouteSchema;
7090
+ teams?: StringId[] | Team.TeamSchema[];
7091
+ route?: StringId | Route.RouteSchema;
7092
+ payment_method?: StringId | PaymentMethod.Data;
7093
+ media?: (StringId | PopulatedMediaStorage)[];
7078
7094
  };
7079
7095
  type PaymentType = "check" | "cash";
7080
- type PopulatedKeys = "custom_status" | "teams" | "route";
7096
+ type PopulatedKeys = "custom_status" | "teams" | "route" | "payment_method";
7081
7097
  type PaymentStatus = "consumed" | "unconsumed" | "partially_consumed";
7082
7098
  export namespace Find {
7083
7099
  type Params = DefaultPaginationQueryParams & {
@@ -16368,6 +16384,94 @@ export declare namespace Service {
16368
16384
  }
16369
16385
  export {};
16370
16386
  }
16387
+ namespace PaymentMethod {
16388
+ export type PaymentMethodType = "online" | "offline";
16389
+ export type PaymentMethodAccountType = "cash";
16390
+ export interface Data {
16391
+ _id: StringId;
16392
+ name: string;
16393
+ local_name?: string;
16394
+ type: PaymentMethodType;
16395
+ account_type: PaymentMethodAccountType;
16396
+ fee?: number;
16397
+ rate?: number;
16398
+ disabled: boolean;
16399
+ logo?: StringId;
16400
+ rep_auto_settled?: boolean;
16401
+ creator: Admin;
16402
+ editor?: Admin;
16403
+ company_namespace: string[];
16404
+ createdAt: string;
16405
+ updatedAt: string;
16406
+ }
16407
+ export interface CreateBody {
16408
+ name: string;
16409
+ local_name?: string;
16410
+ type: PaymentMethodType;
16411
+ account_type: PaymentMethodAccountType;
16412
+ fee?: number;
16413
+ rate?: number;
16414
+ disabled?: boolean;
16415
+ logo?: StringId;
16416
+ rep_auto_settled?: boolean;
16417
+ creator?: Admin;
16418
+ company_namespace?: string[];
16419
+ }
16420
+ export interface UpdateBody {
16421
+ _id?: StringId;
16422
+ name?: string;
16423
+ local_name?: string;
16424
+ type?: PaymentMethodType;
16425
+ account_type?: PaymentMethodAccountType;
16426
+ fee?: number;
16427
+ rate?: number;
16428
+ disabled?: boolean;
16429
+ logo?: StringId;
16430
+ rep_auto_settled?: boolean;
16431
+ creator?: Admin;
16432
+ editor?: Admin;
16433
+ company_namespace?: string[];
16434
+ createdAt?: string;
16435
+ updatedAt?: string;
16436
+ }
16437
+ export type PopulatedDoc = Data & {
16438
+ logo_populated?: PopulatedMediaStorage;
16439
+ };
16440
+ type PopulatedKeys = "logo";
16441
+ export namespace Find {
16442
+ type Params = DefaultPaginationQueryParams & {
16443
+ _id?: StringId | StringId[];
16444
+ search?: string;
16445
+ name?: string | string[];
16446
+ disabled?: boolean;
16447
+ };
16448
+ interface Result extends DefaultPaginationResult {
16449
+ data: PopulatedDoc[];
16450
+ }
16451
+ }
16452
+ export namespace Get {
16453
+ type ID = string;
16454
+ type Params = {
16455
+ populatedKeys?: PopulatedKeys[];
16456
+ };
16457
+ type Result = PopulatedDoc;
16458
+ }
16459
+ export namespace Create {
16460
+ type Body = CreateBody;
16461
+ type Result = Data;
16462
+ }
16463
+ export namespace Update {
16464
+ type ID = StringId;
16465
+ type Body = UpdateBody;
16466
+ type Result = Data;
16467
+ }
16468
+ export namespace Remove {
16469
+ type ID = string;
16470
+ type Params = {};
16471
+ type Result = Data;
16472
+ }
16473
+ export {};
16474
+ }
16371
16475
  }
16372
16476
  export type StringId = string;
16373
16477
  export type NameSpaces = string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.193",
3
+ "version": "1.0.194",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
package/src/index.ts CHANGED
@@ -113,6 +113,7 @@ export const end_points = {
113
113
  REPORT_SORT: "report-sort",
114
114
  REPORT_FILTER: "report-filter",
115
115
  SAFE_CRUD: "safe-crud",
116
+ PAYMENT_METHOD: "payment-method",
116
117
  } as const;
117
118
  export type EndPoints = (typeof end_points)[keyof typeof end_points];
118
119
 
@@ -5342,6 +5343,62 @@ export default class Repzo {
5342
5343
  return res;
5343
5344
  },
5344
5345
  };
5346
+
5347
+ paymentMethod = {
5348
+ _path: Repzo._end_points.PAYMENT_METHOD,
5349
+ find: async (
5350
+ params?: Service.PaymentMethod.Find.Params,
5351
+ ): Promise<Service.PaymentMethod.Find.Result> => {
5352
+ let res: Service.PaymentMethod.Find.Result = await this._fetch(
5353
+ this.svAPIEndpoint,
5354
+ this.paymentMethod._path,
5355
+ params,
5356
+ );
5357
+ return res;
5358
+ },
5359
+ get: async (
5360
+ id: Service.PaymentMethod.Get.ID,
5361
+ params?: Service.PaymentMethod.Get.Params,
5362
+ ): Promise<Service.PaymentMethod.Get.Result> => {
5363
+ return await this._fetch(
5364
+ this.svAPIEndpoint,
5365
+ this.paymentMethod._path + `/${id}`,
5366
+ params,
5367
+ );
5368
+ },
5369
+ create: async (
5370
+ body: Service.PaymentMethod.Create.Body,
5371
+ ): Promise<Service.PaymentMethod.Create.Result> => {
5372
+ let res = await this._create(
5373
+ this.svAPIEndpoint,
5374
+ this.paymentMethod._path,
5375
+ body,
5376
+ );
5377
+ return res;
5378
+ },
5379
+ update: async (
5380
+ id: Service.PaymentMethod.Update.ID,
5381
+ body: Service.PaymentMethod.Update.Body,
5382
+ ): Promise<Service.PaymentMethod.Update.Result> => {
5383
+ let res: Service.PaymentMethod.Update.Result = await this._update(
5384
+ this.svAPIEndpoint,
5385
+ this.paymentMethod._path + `/${id}`,
5386
+ body,
5387
+ );
5388
+ return res;
5389
+ },
5390
+ remove: async (
5391
+ id: Service.PaymentMethod.Update.ID,
5392
+ params: Service.PaymentMethod.Remove.Params,
5393
+ ): Promise<Service.PaymentMethod.Remove.Result> => {
5394
+ let res: Service.PaymentMethod.Remove.Result = await this._delete(
5395
+ this.svAPIEndpoint,
5396
+ this.paymentMethod._path + `/${id}`,
5397
+ params,
5398
+ );
5399
+ return res;
5400
+ },
5401
+ };
5345
5402
  }
5346
5403
 
5347
5404
  function normalizeParams(params: Params): { [key: string]: any } {
@@ -7502,22 +7502,23 @@ export namespace Service {
7502
7502
 
7503
7503
  export namespace Payment {
7504
7504
  export interface PaymentSchema {
7505
- _id: string;
7505
+ _id: StringId;
7506
7506
  status: PaymentStatus;
7507
7507
  remainder: number;
7508
7508
  amount: number;
7509
- client_id: string;
7509
+ client_id: StringId;
7510
7510
  client_name: string;
7511
7511
  creator: AdminCreator | RepCreator;
7512
7512
  implemented_by?: AdminCreator | RepCreator;
7513
7513
  transaction_processed: boolean;
7514
7514
  time?: number;
7515
7515
  serial_number: SerialNumber;
7516
- route?: string;
7516
+ route?: StringId;
7517
7517
  paytime: string;
7518
7518
  note?: string;
7519
7519
  currency: string;
7520
7520
  payment_type: PaymentType;
7521
+ payment_method?: StringId;
7521
7522
  check?: Check;
7522
7523
  LinkedTxn?: {
7523
7524
  Txn_serial_number: SerialNumber;
@@ -7531,18 +7532,28 @@ export namespace Service {
7531
7532
  company_namespace: string[];
7532
7533
  integration_meta?: { [key: string]: any };
7533
7534
  sync_id: string;
7534
- custom_status?: string;
7535
+ custom_status?: StringId;
7535
7536
  visit_id?: string;
7536
- teams?: string[];
7537
+ teams?: StringId[];
7537
7538
  paymentsData: {
7538
7539
  amount: number;
7539
7540
  paid: number;
7540
7541
  balance: number;
7541
7542
  payments: PaymentData[];
7542
7543
  };
7544
+ reference?: string;
7545
+ media?: StringId[];
7546
+ network_state?: number;
7547
+ platform?: string;
7548
+ version_name?: string;
7549
+ battery_level?: number;
7550
+ time_zone?: string;
7551
+ identifier?: number;
7552
+ device_id?: string;
7553
+ device_unique_id?: string;
7554
+ ending_balance?: number;
7543
7555
  createdAt: string;
7544
7556
  updatedAt: string;
7545
- ending_balance?: number;
7546
7557
  __v: number;
7547
7558
  }
7548
7559
  export type Data = PaymentSchema;
@@ -7557,6 +7568,7 @@ export namespace Service {
7557
7568
  note?: string;
7558
7569
  currency: string;
7559
7570
  payment_type: PaymentType;
7571
+ payment_method?: StringId;
7560
7572
  transaction_processed: boolean;
7561
7573
  check?: Check;
7562
7574
  LinkedTxn?: {
@@ -7574,6 +7586,8 @@ export namespace Service {
7574
7586
  custom_status?: string;
7575
7587
  visit_id?: string;
7576
7588
  teams?: string[];
7589
+ reference?: string;
7590
+ media?: StringId[];
7577
7591
  }
7578
7592
  export interface UpdateBody {
7579
7593
  integration_meta?: { [key: string]: any };
@@ -7590,11 +7604,13 @@ export namespace Service {
7590
7604
  original_amount: number;
7591
7605
  payment: number;
7592
7606
  };
7593
- teams?: string[] | Team.TeamSchema[];
7594
- route?: string | Route.RouteSchema;
7607
+ teams?: StringId[] | Team.TeamSchema[];
7608
+ route?: StringId | Route.RouteSchema;
7609
+ payment_method?: StringId | PaymentMethod.Data;
7610
+ media?: (StringId | PopulatedMediaStorage)[];
7595
7611
  };
7596
7612
  type PaymentType = "check" | "cash";
7597
- type PopulatedKeys = "custom_status" | "teams" | "route";
7613
+ type PopulatedKeys = "custom_status" | "teams" | "route" | "payment_method";
7598
7614
  type PaymentStatus = "consumed" | "unconsumed" | "partially_consumed";
7599
7615
  export namespace Find {
7600
7616
  export type Params = DefaultPaginationQueryParams & {
@@ -7614,10 +7630,7 @@ export namespace Service {
7614
7630
  populatedKeys?: PopulatedKeys[];
7615
7631
  from__id?: string;
7616
7632
  to__id?: string;
7617
- sortBy?: {
7618
- field: "_id";
7619
- type: "asc" | "desc";
7620
- }[];
7633
+ sortBy?: { field: "_id"; type: "asc" | "desc" }[];
7621
7634
  };
7622
7635
  export interface Result extends DefaultPaginationResult {
7623
7636
  data: PaymentSchemaWithPopulatedKeys[];
@@ -18606,6 +18619,94 @@ export namespace Service {
18606
18619
  }
18607
18620
  }
18608
18621
  }
18622
+
18623
+ export namespace PaymentMethod {
18624
+ export type PaymentMethodType = "online" | "offline";
18625
+ export type PaymentMethodAccountType = "cash";
18626
+ export interface Data {
18627
+ _id: StringId;
18628
+ name: string;
18629
+ local_name?: string;
18630
+ type: PaymentMethodType;
18631
+ account_type: PaymentMethodAccountType;
18632
+ fee?: number;
18633
+ rate?: number;
18634
+ disabled: boolean;
18635
+ logo?: StringId;
18636
+ rep_auto_settled?: boolean;
18637
+ creator: Admin;
18638
+ editor?: Admin;
18639
+ company_namespace: string[];
18640
+ createdAt: string;
18641
+ updatedAt: string;
18642
+ }
18643
+ export interface CreateBody {
18644
+ name: string;
18645
+ local_name?: string;
18646
+ type: PaymentMethodType;
18647
+ account_type: PaymentMethodAccountType;
18648
+ fee?: number;
18649
+ rate?: number;
18650
+ disabled?: boolean;
18651
+ logo?: StringId;
18652
+ rep_auto_settled?: boolean;
18653
+ creator?: Admin;
18654
+ company_namespace?: string[];
18655
+ }
18656
+ export interface UpdateBody {
18657
+ _id?: StringId;
18658
+ name?: string;
18659
+ local_name?: string;
18660
+ type?: PaymentMethodType;
18661
+ account_type?: PaymentMethodAccountType;
18662
+ fee?: number;
18663
+ rate?: number;
18664
+ disabled?: boolean;
18665
+ logo?: StringId;
18666
+ rep_auto_settled?: boolean;
18667
+ creator?: Admin;
18668
+ editor?: Admin;
18669
+ company_namespace?: string[];
18670
+ createdAt?: string;
18671
+ updatedAt?: string;
18672
+ }
18673
+ export type PopulatedDoc = Data & {
18674
+ logo_populated?: PopulatedMediaStorage;
18675
+ };
18676
+
18677
+ type PopulatedKeys = "logo";
18678
+
18679
+ export namespace Find {
18680
+ export type Params = DefaultPaginationQueryParams & {
18681
+ _id?: StringId | StringId[];
18682
+ search?: string;
18683
+ name?: string | string[];
18684
+ disabled?: boolean;
18685
+ };
18686
+ export interface Result extends DefaultPaginationResult {
18687
+ data: PopulatedDoc[];
18688
+ }
18689
+ }
18690
+ export namespace Get {
18691
+ export type ID = string;
18692
+ export type Params = { populatedKeys?: PopulatedKeys[] };
18693
+ export type Result = PopulatedDoc;
18694
+ }
18695
+ export namespace Create {
18696
+ export type Body = CreateBody;
18697
+ export type Result = Data;
18698
+ }
18699
+ export namespace Update {
18700
+ export type ID = StringId;
18701
+ export type Body = UpdateBody;
18702
+ export type Result = Data;
18703
+ }
18704
+ export namespace Remove {
18705
+ export type ID = string;
18706
+ export type Params = {};
18707
+ export type Result = Data;
18708
+ }
18709
+ }
18609
18710
  }
18610
18711
 
18611
18712
  export type StringId = string;