repzo 1.0.58 → 1.0.60

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
@@ -610,6 +610,23 @@ export default class Repzo {
610
610
  body: Service.Refund.Update.Body
611
611
  ) => Promise<Service.Refund.Update.Result>;
612
612
  };
613
+ settlement: {
614
+ _path: string;
615
+ find: (
616
+ params?: Service.Settlement.Find.Params
617
+ ) => Promise<Service.Settlement.Find.Result>;
618
+ get: (
619
+ id: Service.Settlement.Get.ID,
620
+ params?: Service.Settlement.Get.Params
621
+ ) => Promise<Service.Settlement.Get.Result>;
622
+ create: (
623
+ body: Service.Settlement.Create.Body
624
+ ) => Promise<Service.Settlement.Create.Result>;
625
+ update: (
626
+ id: Service.Settlement.Update.ID,
627
+ body: Service.Settlement.Update.Body
628
+ ) => Promise<Service.Settlement.Update.Result>;
629
+ };
613
630
  transfer: {
614
631
  _path: string;
615
632
  find: (
package/lib/index.js CHANGED
@@ -1256,6 +1256,40 @@ export default class Repzo {
1256
1256
  return res;
1257
1257
  },
1258
1258
  };
1259
+ this.settlement = {
1260
+ _path: "/settlement",
1261
+ find: async (params) => {
1262
+ let res = await this._fetch(
1263
+ this.svAPIEndpoint,
1264
+ this.settlement._path,
1265
+ params
1266
+ );
1267
+ return res;
1268
+ },
1269
+ get: async (id, params) => {
1270
+ return await this._fetch(
1271
+ this.svAPIEndpoint,
1272
+ this.settlement._path + `/${id}`,
1273
+ params
1274
+ );
1275
+ },
1276
+ create: async (body) => {
1277
+ let res = await this._create(
1278
+ this.svAPIEndpoint,
1279
+ this.settlement._path,
1280
+ body
1281
+ );
1282
+ return res;
1283
+ },
1284
+ update: async (id, body) => {
1285
+ let res = await this._update(
1286
+ this.svAPIEndpoint,
1287
+ this.settlement._path + `/${id}`,
1288
+ body
1289
+ );
1290
+ return res;
1291
+ },
1292
+ };
1259
1293
  this.transfer = {
1260
1294
  _path: "/transfer",
1261
1295
  find: async (params) => {
@@ -5060,6 +5060,7 @@ export declare namespace Service {
5060
5060
  client_id: string;
5061
5061
  client_name: string;
5062
5062
  creator: AdminCreator | RepCreator;
5063
+ implemented_by?: AdminCreator | RepCreator;
5063
5064
  time?: number;
5064
5065
  serial_number: SerialNumber;
5065
5066
  route?: string;
@@ -5067,6 +5068,7 @@ export declare namespace Service {
5067
5068
  note?: string;
5068
5069
  currency: string;
5069
5070
  transaction_type: RefundType;
5071
+ transaction_processed: boolean;
5070
5072
  check?: Check;
5071
5073
  LinkedTxn?: {
5072
5074
  Txn_serial_number: SerialNumber;
@@ -5087,6 +5089,10 @@ export declare namespace Service {
5087
5089
  balance: number;
5088
5090
  payments: PaymentData[];
5089
5091
  };
5092
+ client_geo_location?: {
5093
+ lat: number;
5094
+ lng: number;
5095
+ };
5090
5096
  createdAt: string;
5091
5097
  updatedAt: string;
5092
5098
  __v: number;
@@ -5097,6 +5103,11 @@ export declare namespace Service {
5097
5103
  client_name: string;
5098
5104
  time?: number;
5099
5105
  serial_number?: SerialNumber;
5106
+ transaction_processed: boolean;
5107
+ client_geo_location?: {
5108
+ lat: number;
5109
+ lng: number;
5110
+ };
5100
5111
  route?: string;
5101
5112
  paytime: string;
5102
5113
  note?: string;
@@ -5135,9 +5146,11 @@ export declare namespace Service {
5135
5146
  original_amount: number;
5136
5147
  refund: number;
5137
5148
  };
5149
+ teams?: string[] | Team.TeamSchema[];
5150
+ route?: string | Route.RouteSchema;
5138
5151
  };
5139
5152
  type RefundType = "check" | "cash";
5140
- type PopulatedKeys = "custom_status";
5153
+ type PopulatedKeys = "custom_status" | "teams" | "route";
5141
5154
  type RefundStatus = "consumed" | "unconsumed" | "partially_consumed";
5142
5155
  export namespace Find {
5143
5156
  type Params = DefaultPaginationQueryParams & {
@@ -5150,6 +5163,7 @@ export declare namespace Service {
5150
5163
  transaction_type?: RefundType | RefundType[];
5151
5164
  creator?: string[] | string;
5152
5165
  clients?: string[] | string;
5166
+ from_updatedAt?: number;
5153
5167
  withPrintDetails?: boolean;
5154
5168
  [key: string]: any;
5155
5169
  populatedKeys?: PopulatedKeys[];
@@ -5181,6 +5195,117 @@ export declare namespace Service {
5181
5195
  }
5182
5196
  export {};
5183
5197
  }
5198
+ namespace Settlement {
5199
+ export interface SettlementSchema {
5200
+ _id: string;
5201
+ amount: number;
5202
+ creator: {
5203
+ _id: string;
5204
+ type: "admin" | "rep";
5205
+ admin?: string;
5206
+ rep?: string;
5207
+ name: string;
5208
+ };
5209
+ origin: {
5210
+ _id: string;
5211
+ type: "rep";
5212
+ name: string;
5213
+ rep?: string;
5214
+ };
5215
+ time?: number;
5216
+ serial_number: SerialNumber;
5217
+ paytime: string;
5218
+ note?: string;
5219
+ payment_type: "check" | "cash";
5220
+ check_id?: string;
5221
+ teams: string[];
5222
+ company_namespace: string[];
5223
+ sync_id: string;
5224
+ transaction_processed: boolean;
5225
+ createdAt: Date;
5226
+ updatedAt: Date;
5227
+ }
5228
+ export interface CreateBody {
5229
+ amount: number;
5230
+ time?: number;
5231
+ serial_number: SerialNumber;
5232
+ paytime: string;
5233
+ note?: string;
5234
+ payment_type: "check" | "cash";
5235
+ check_id?: string;
5236
+ teams: string[];
5237
+ company_namespace: string[];
5238
+ sync_id: string;
5239
+ transaction_processed: boolean;
5240
+ }
5241
+ export interface UpdateBody {
5242
+ _id?: string;
5243
+ amount?: number;
5244
+ creator?: {
5245
+ _id: string;
5246
+ type: "admin" | "rep";
5247
+ admin?: string;
5248
+ rep?: string;
5249
+ name: string;
5250
+ };
5251
+ origin?: {
5252
+ _id: string;
5253
+ type: "rep";
5254
+ name: string;
5255
+ rep?: string;
5256
+ };
5257
+ time?: number;
5258
+ serial_number?: SerialNumber;
5259
+ paytime?: string;
5260
+ note?: string;
5261
+ payment_type?: "check" | "cash";
5262
+ check_id?: string;
5263
+ teams?: string[];
5264
+ company_namespace?: string[];
5265
+ sync_id?: string;
5266
+ transaction_processed?: boolean;
5267
+ }
5268
+ type SettlementSchemaWithPopulatedKeys = SettlementSchema & {
5269
+ teams_populated?: string[] | Team.TeamSchema[];
5270
+ };
5271
+ type PopulatedKeys = "teams";
5272
+ export namespace Find {
5273
+ type Params = DefaultPaginationQueryParams & {
5274
+ _id?: string[] | string;
5275
+ "creator._id"?: string[] | string;
5276
+ "origin._id"?: string[] | string;
5277
+ amount?: number;
5278
+ payment_type?: string;
5279
+ from_createdAt?: number;
5280
+ to_createdAt?: number;
5281
+ from_updatedAt?: number;
5282
+ [key: string]: any;
5283
+ populatedKeys?: PopulatedKeys[];
5284
+ };
5285
+ interface Result extends DefaultPaginationResult {
5286
+ data: SettlementSchemaWithPopulatedKeys[];
5287
+ absolute_total: number;
5288
+ page_total: number;
5289
+ }
5290
+ }
5291
+ export namespace Get {
5292
+ type ID = string;
5293
+ interface Params {
5294
+ populatedKeys?: PopulatedKeys[];
5295
+ }
5296
+ type Result = SettlementSchemaWithPopulatedKeys;
5297
+ }
5298
+ export namespace Create {
5299
+ type Body = CreateBody;
5300
+ type Result = SettlementSchema;
5301
+ }
5302
+ export namespace Update {
5303
+ type ID = string;
5304
+ type Body = UpdateBody;
5305
+ type Result = SettlementSchema;
5306
+ }
5307
+ export {};
5308
+ }
5184
5309
  namespace Cycle {
5185
5310
  type CycleStatus = "pending" | "approved" | "processing" | "rejected";
5186
5311
  export interface Schema {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.58",
3
+ "version": "1.0.60",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -1792,6 +1792,55 @@ export default class Repzo {
1792
1792
  },
1793
1793
  };
1794
1794
 
1795
+ settlement = {
1796
+ _path: "/settlement",
1797
+
1798
+ find: async (
1799
+ params?: Service.Settlement.Find.Params
1800
+ ): Promise<Service.Settlement.Find.Result> => {
1801
+ let res: Service.Settlement.Find.Result = await this._fetch(
1802
+ this.svAPIEndpoint,
1803
+ this.settlement._path,
1804
+ params
1805
+ );
1806
+ return res;
1807
+ },
1808
+
1809
+ get: async (
1810
+ id: Service.Settlement.Get.ID,
1811
+ params?: Service.Settlement.Get.Params
1812
+ ): Promise<Service.Settlement.Get.Result> => {
1813
+ return await this._fetch(
1814
+ this.svAPIEndpoint,
1815
+ this.settlement._path + `/${id}`,
1816
+ params
1817
+ );
1818
+ },
1819
+
1820
+ create: async (
1821
+ body: Service.Settlement.Create.Body
1822
+ ): Promise<Service.Settlement.Create.Result> => {
1823
+ let res = await this._create(
1824
+ this.svAPIEndpoint,
1825
+ this.settlement._path,
1826
+ body
1827
+ );
1828
+ return res;
1829
+ },
1830
+
1831
+ update: async (
1832
+ id: Service.Settlement.Update.ID,
1833
+ body: Service.Settlement.Update.Body
1834
+ ): Promise<Service.Settlement.Update.Result> => {
1835
+ let res: Service.Settlement.Update.Result = await this._update(
1836
+ this.svAPIEndpoint,
1837
+ this.settlement._path + `/${id}`,
1838
+ body
1839
+ );
1840
+ return res;
1841
+ },
1842
+ };
1843
+
1795
1844
  transfer = {
1796
1845
  _path: "/transfer",
1797
1846
  find: async (
@@ -5066,6 +5066,7 @@ export namespace Service {
5066
5066
  client_id: string;
5067
5067
  client_name: string;
5068
5068
  creator: AdminCreator | RepCreator;
5069
+ implemented_by?: AdminCreator | RepCreator;
5069
5070
  time?: number;
5070
5071
  serial_number: SerialNumber;
5071
5072
  route?: string;
@@ -5073,6 +5074,7 @@ export namespace Service {
5073
5074
  note?: string;
5074
5075
  currency: string;
5075
5076
  transaction_type: RefundType;
5077
+ transaction_processed: boolean;
5076
5078
  check?: Check;
5077
5079
  LinkedTxn?: {
5078
5080
  Txn_serial_number: SerialNumber;
@@ -5091,6 +5093,10 @@ export namespace Service {
5091
5093
  balance: number;
5092
5094
  payments: PaymentData[];
5093
5095
  };
5096
+ client_geo_location?: {
5097
+ lat: number;
5098
+ lng: number;
5099
+ };
5094
5100
  createdAt: string;
5095
5101
  updatedAt: string;
5096
5102
  __v: number;
@@ -5101,6 +5107,11 @@ export namespace Service {
5101
5107
  client_name: string;
5102
5108
  time?: number;
5103
5109
  serial_number?: SerialNumber;
5110
+ transaction_processed: boolean;
5111
+ client_geo_location?: {
5112
+ lat: number;
5113
+ lng: number;
5114
+ };
5104
5115
  route?: string;
5105
5116
  paytime: string;
5106
5117
  note?: string;
@@ -5134,9 +5145,11 @@ export namespace Service {
5134
5145
  original_amount: number;
5135
5146
  refund: number;
5136
5147
  };
5148
+ teams?: string[] | Team.TeamSchema[];
5149
+ route?: string | Route.RouteSchema;
5137
5150
  };
5138
5151
  type RefundType = "check" | "cash";
5139
- type PopulatedKeys = "custom_status";
5152
+ type PopulatedKeys = "custom_status" | "teams" | "route";
5140
5153
  type RefundStatus = "consumed" | "unconsumed" | "partially_consumed";
5141
5154
  export namespace Find {
5142
5155
  export type Params = DefaultPaginationQueryParams & {
@@ -5149,6 +5162,7 @@ export namespace Service {
5149
5162
  transaction_type?: RefundType | RefundType[];
5150
5163
  creator?: string[] | string;
5151
5164
  clients?: string[] | string;
5165
+ from_updatedAt?: number;
5152
5166
  withPrintDetails?: boolean;
5153
5167
  [key: string]: any; // integration_meta.
5154
5168
  populatedKeys?: PopulatedKeys[];
@@ -5182,7 +5196,120 @@ export namespace Service {
5182
5196
  export type Result = RefundSchema;
5183
5197
  }
5184
5198
  }
5199
+ export namespace Settlement {
5200
+ export interface SettlementSchema {
5201
+ _id: string;
5202
+ amount: number;
5203
+ creator: {
5204
+ _id: string;
5205
+ type: "admin" | "rep";
5206
+ admin?: string;
5207
+ rep?: string;
5208
+ name: string;
5209
+ };
5210
+ origin: {
5211
+ _id: string;
5212
+ type: "rep";
5213
+ name: string;
5214
+ rep?: string;
5215
+ };
5216
+ time?: number;
5217
+ serial_number: SerialNumber;
5218
+ paytime: string;
5219
+ note?: string;
5220
+ payment_type: "check" | "cash";
5221
+ check_id?: string;
5222
+ teams: string[];
5223
+ company_namespace: string[];
5224
+ sync_id: string;
5225
+ transaction_processed: boolean;
5226
+ createdAt: Date;
5227
+ updatedAt: Date;
5228
+ }
5229
+ export interface CreateBody {
5230
+ amount: number;
5231
+ time?: number;
5232
+ serial_number: SerialNumber;
5233
+ paytime: string;
5234
+ note?: string;
5235
+ payment_type: "check" | "cash";
5236
+ check_id?: string;
5237
+ teams: string[];
5238
+ company_namespace: string[];
5239
+ sync_id: string;
5240
+ transaction_processed: boolean;
5241
+ }
5242
+ export interface UpdateBody {
5243
+ _id?: string;
5244
+ amount?: number;
5245
+ creator?: {
5246
+ _id: string;
5247
+ type: "admin" | "rep";
5248
+ admin?: string;
5249
+ rep?: string;
5250
+ name: string;
5251
+ };
5252
+ origin?: {
5253
+ _id: string;
5254
+ type: "rep";
5255
+ name: string;
5256
+ rep?: string;
5257
+ };
5258
+ time?: number;
5259
+ serial_number?: SerialNumber;
5260
+ paytime?: string;
5261
+ note?: string;
5262
+ payment_type?: "check" | "cash";
5263
+ check_id?: string;
5264
+ teams?: string[];
5265
+ company_namespace?: string[];
5266
+ sync_id?: string;
5267
+ transaction_processed?: boolean;
5268
+ }
5269
+
5270
+ type SettlementSchemaWithPopulatedKeys = SettlementSchema & {
5271
+ teams_populated?: string[] | Team.TeamSchema[];
5272
+ };
5273
+ type PopulatedKeys = "teams";
5274
+ export namespace Find {
5275
+ export type Params = DefaultPaginationQueryParams & {
5276
+ _id?: string[] | string;
5277
+ "creator._id"?: string[] | string;
5278
+ "origin._id"?: string[] | string;
5279
+ amount?: number;
5280
+ payment_type?: string;
5281
+ from_createdAt?: number;
5282
+ to_createdAt?: number;
5283
+ from_updatedAt?: number;
5284
+ [key: string]: any; // integration_meta.
5285
+ populatedKeys?: PopulatedKeys[];
5286
+ };
5287
+ export interface Result extends DefaultPaginationResult {
5288
+ data: SettlementSchemaWithPopulatedKeys[];
5289
+ absolute_total: number;
5290
+ page_total: number;
5291
+ }
5292
+ }
5293
+
5294
+ export namespace Get {
5295
+ export type ID = string;
5296
+ export interface Params {
5297
+ populatedKeys?: PopulatedKeys[];
5298
+ }
5299
+ export type Result = SettlementSchemaWithPopulatedKeys;
5300
+ }
5301
+
5302
+ export namespace Create {
5303
+ export type Body = CreateBody;
5304
+ export type Result = SettlementSchema;
5305
+ }
5185
5306
 
5307
+ export namespace Update {
5308
+ export type ID = string;
5309
+ export type Body = UpdateBody;
5310
+ export type Result = SettlementSchema;
5311
+ }
5312
+ }
5186
5313
  export namespace Cycle {
5187
5314
  type CycleStatus = "pending" | "approved" | "processing" | "rejected";
5188
5315
  export interface Schema {