repzo 1.0.59 → 1.0.61

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,36 @@ 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
+ };
630
+ check: {
631
+ _path: string;
632
+ find: (
633
+ params?: Service.Check.Find.Params
634
+ ) => Promise<Service.Check.Find.Result>;
635
+ get: (
636
+ id: Service.Check.Get.ID,
637
+ params?: Service.Check.Get.Params
638
+ ) => Promise<Service.Check.Get.Result>;
639
+ create: (
640
+ body: Service.Check.Create.Body
641
+ ) => Promise<Service.Check.Create.Result>;
642
+ };
613
643
  transfer: {
614
644
  _path: string;
615
645
  find: (
package/lib/index.js CHANGED
@@ -1256,6 +1256,66 @@ 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
+ };
1293
+ this.check = {
1294
+ _path: "/checks",
1295
+ find: async (params) => {
1296
+ let res = await this._fetch(
1297
+ this.svAPIEndpoint,
1298
+ this.check._path,
1299
+ params
1300
+ );
1301
+ return res;
1302
+ },
1303
+ get: async (id, params) => {
1304
+ return await this._fetch(
1305
+ this.svAPIEndpoint,
1306
+ this.check._path + `/${id}`,
1307
+ params
1308
+ );
1309
+ },
1310
+ create: async (body) => {
1311
+ let res = await this._create(
1312
+ this.svAPIEndpoint,
1313
+ this.check._path,
1314
+ body
1315
+ );
1316
+ return res;
1317
+ },
1318
+ };
1259
1319
  this.transfer = {
1260
1320
  _path: "/transfer",
1261
1321
  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;
@@ -5194,6 +5195,236 @@ export declare namespace Service {
5194
5195
  }
5195
5196
  export {};
5196
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
+ check_populated?: string | Check.CheckSchema;
5271
+ };
5272
+ type PopulatedKeys = "teams" | "check_id";
5273
+ export namespace Find {
5274
+ type Params = DefaultPaginationQueryParams & {
5275
+ _id?: string[] | string;
5276
+ "creator._id"?: string[] | string;
5277
+ "origin._id"?: string[] | string;
5278
+ amount?: number;
5279
+ payment_type?: string;
5280
+ from_createdAt?: number;
5281
+ to_createdAt?: number;
5282
+ from_updatedAt?: number;
5283
+ [key: string]: any;
5284
+ populatedKeys?: PopulatedKeys[];
5285
+ };
5286
+ interface Result extends DefaultPaginationResult {
5287
+ data: SettlementSchemaWithPopulatedKeys[];
5288
+ absolute_total: number;
5289
+ page_total: number;
5290
+ }
5291
+ }
5292
+ export namespace Get {
5293
+ type ID = string;
5294
+ interface Params {
5295
+ populatedKeys?: PopulatedKeys[];
5296
+ }
5297
+ type Result = SettlementSchemaWithPopulatedKeys;
5298
+ }
5299
+ export namespace Create {
5300
+ type Body = CreateBody;
5301
+ type Result = SettlementSchema;
5302
+ }
5303
+ export namespace Update {
5304
+ type ID = string;
5305
+ type Body = UpdateBody;
5306
+ type Result = SettlementSchema;
5307
+ }
5308
+ export {};
5309
+ }
5310
+ namespace Check {
5311
+ export interface CheckSchema {
5312
+ _id: string;
5313
+ drawer_name: string;
5314
+ bank: string;
5315
+ bank_branch: string;
5316
+ check_number: number;
5317
+ amount: number;
5318
+ check_date: string;
5319
+ photo?: string;
5320
+ media?: string[];
5321
+ caption: {
5322
+ type: String;
5323
+ default: null;
5324
+ };
5325
+ photo_meta?: {
5326
+ device_orientation?: 1 | 2 | 3 | 4;
5327
+ height?: 1 | 2 | 3 | 4;
5328
+ width?: 1 | 2 | 3 | 4;
5329
+ };
5330
+ paytime: string;
5331
+ client_id: string;
5332
+ client_name: string;
5333
+ creator: {
5334
+ _id: string;
5335
+ type: "rep" | "admin";
5336
+ rep?: string;
5337
+ admin?: string;
5338
+ name?: string;
5339
+ };
5340
+ sync_id: string;
5341
+ payment_serial_number: SerialNumber;
5342
+ refund_serial_number?: SerialNumber;
5343
+ disabled: boolean;
5344
+ settled?: boolean;
5345
+ teams?: string[];
5346
+ company_namespace: string[];
5347
+ createdAt: Date;
5348
+ updatedAt: Date;
5349
+ }
5350
+ export interface CreateBody {
5351
+ drawer_name: string;
5352
+ bank: string;
5353
+ bank_branch: string;
5354
+ check_number: number;
5355
+ amount: number;
5356
+ check_date: string;
5357
+ photo?: string;
5358
+ media?: string[];
5359
+ caption: {
5360
+ type: String;
5361
+ default: null;
5362
+ };
5363
+ photo_meta?: {
5364
+ device_orientation?: 1 | 2 | 3 | 4;
5365
+ height?: 1 | 2 | 3 | 4;
5366
+ width?: 1 | 2 | 3 | 4;
5367
+ };
5368
+ paytime: string;
5369
+ client_id: string;
5370
+ client_name: string;
5371
+ creator: {
5372
+ _id: string;
5373
+ type: "rep" | "admin";
5374
+ rep?: string;
5375
+ admin?: string;
5376
+ name?: string;
5377
+ };
5378
+ sync_id: string;
5379
+ payment_serial_number: SerialNumber;
5380
+ refund_serial_number?: SerialNumber;
5381
+ disabled: boolean;
5382
+ settled?: boolean;
5383
+ teams?: string[];
5384
+ company_namespace: string[];
5385
+ }
5386
+ type CheckSchemaWithPopulatedKeys = CheckSchema & {
5387
+ teams?: string[] | Team.TeamSchema[];
5388
+ bank?: string | Bank.BankSchema;
5389
+ client_id?: string | Client.ClientSchema;
5390
+ };
5391
+ type PopulatedKeys = "bank" | "teams" | "client_id";
5392
+ export namespace Find {
5393
+ type Params = DefaultPaginationQueryParams & {
5394
+ _id?: string[] | string;
5395
+ "creator._id"?: string[] | string;
5396
+ client_id?: string[] | string;
5397
+ check_number?: number;
5398
+ client_name?: string;
5399
+ rep_name?: string;
5400
+ drawer_name?: string;
5401
+ bank_name?: string;
5402
+ amount?: number;
5403
+ settled?: boolean;
5404
+ from_updatedAt?: number;
5405
+ [key: string]: any;
5406
+ populatedKeys?: PopulatedKeys[];
5407
+ };
5408
+ interface Result extends DefaultPaginationResult {
5409
+ data: CheckSchemaWithPopulatedKeys[];
5410
+ absolute_total: number;
5411
+ page_total: number;
5412
+ }
5413
+ }
5414
+ export namespace Get {
5415
+ type ID = string;
5416
+ interface Params {
5417
+ withPrintDetails?: boolean;
5418
+ populatedKeys?: PopulatedKeys[];
5419
+ }
5420
+ type Result = CheckSchemaWithPopulatedKeys;
5421
+ }
5422
+ export namespace Create {
5423
+ type Body = CreateBody;
5424
+ type Result = CheckSchema;
5425
+ }
5426
+ export {};
5427
+ }
5197
5428
  namespace Cycle {
5198
5429
  type CycleStatus = "pending" | "approved" | "processing" | "rejected";
5199
5430
  export interface Schema {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.59",
3
+ "version": "1.0.61",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -1792,6 +1792,88 @@ 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
+
1844
+ check = {
1845
+ _path: "/checks",
1846
+
1847
+ find: async (
1848
+ params?: Service.Check.Find.Params
1849
+ ): Promise<Service.Check.Find.Result> => {
1850
+ let res: Service.Check.Find.Result = await this._fetch(
1851
+ this.svAPIEndpoint,
1852
+ this.check._path,
1853
+ params
1854
+ );
1855
+ return res;
1856
+ },
1857
+
1858
+ get: async (
1859
+ id: Service.Check.Get.ID,
1860
+ params?: Service.Check.Get.Params
1861
+ ): Promise<Service.Check.Get.Result> => {
1862
+ return await this._fetch(
1863
+ this.svAPIEndpoint,
1864
+ this.check._path + `/${id}`,
1865
+ params
1866
+ );
1867
+ },
1868
+
1869
+ create: async (
1870
+ body: Service.Check.Create.Body
1871
+ ): Promise<Service.Check.Create.Result> => {
1872
+ let res = await this._create(this.svAPIEndpoint, this.check._path, body);
1873
+ return res;
1874
+ },
1875
+ };
1876
+
1795
1877
  transfer = {
1796
1878
  _path: "/transfer",
1797
1879
  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;
@@ -5195,6 +5196,235 @@ export namespace Service {
5195
5196
  export type Result = RefundSchema;
5196
5197
  }
5197
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
+ check_populated?: string | Check.CheckSchema;
5273
+ };
5274
+ type PopulatedKeys = "teams" | "check_id";
5275
+ export namespace Find {
5276
+ export type Params = DefaultPaginationQueryParams & {
5277
+ _id?: string[] | string;
5278
+ "creator._id"?: string[] | string;
5279
+ "origin._id"?: string[] | string;
5280
+ amount?: number;
5281
+ payment_type?: string;
5282
+ from_createdAt?: number;
5283
+ to_createdAt?: number;
5284
+ from_updatedAt?: number;
5285
+ [key: string]: any; // integration_meta.
5286
+ populatedKeys?: PopulatedKeys[];
5287
+ };
5288
+ export interface Result extends DefaultPaginationResult {
5289
+ data: SettlementSchemaWithPopulatedKeys[];
5290
+ absolute_total: number;
5291
+ page_total: number;
5292
+ }
5293
+ }
5294
+
5295
+ export namespace Get {
5296
+ export type ID = string;
5297
+ export interface Params {
5298
+ populatedKeys?: PopulatedKeys[];
5299
+ }
5300
+ export type Result = SettlementSchemaWithPopulatedKeys;
5301
+ }
5302
+
5303
+ export namespace Create {
5304
+ export type Body = CreateBody;
5305
+ export type Result = SettlementSchema;
5306
+ }
5307
+
5308
+ export namespace Update {
5309
+ export type ID = string;
5310
+ export type Body = UpdateBody;
5311
+ export type Result = SettlementSchema;
5312
+ }
5313
+ }
5314
+
5315
+ export namespace Check {
5316
+ export interface CheckSchema {
5317
+ _id: string;
5318
+ drawer_name: string;
5319
+ bank: string;
5320
+ bank_branch: string;
5321
+ check_number: number;
5322
+ amount: number;
5323
+ check_date: string;
5324
+ photo?: string;
5325
+ media?: string[];
5326
+ caption: { type: String; default: null };
5327
+ photo_meta?: {
5328
+ device_orientation?: 1 | 2 | 3 | 4;
5329
+ height?: 1 | 2 | 3 | 4;
5330
+ width?: 1 | 2 | 3 | 4;
5331
+ };
5332
+ paytime: string;
5333
+ client_id: string;
5334
+ client_name: string;
5335
+ creator: {
5336
+ _id: string;
5337
+ type: "rep" | "admin";
5338
+ rep?: string;
5339
+ admin?: string;
5340
+ name?: string;
5341
+ };
5342
+ sync_id: string;
5343
+ payment_serial_number: SerialNumber;
5344
+ refund_serial_number?: SerialNumber;
5345
+ disabled: boolean;
5346
+ settled?: boolean;
5347
+ teams?: string[];
5348
+ company_namespace: string[];
5349
+ createdAt: Date;
5350
+ updatedAt: Date;
5351
+ }
5352
+ export interface CreateBody {
5353
+ drawer_name: string;
5354
+ bank: string;
5355
+ bank_branch: string;
5356
+ check_number: number;
5357
+ amount: number;
5358
+ check_date: string;
5359
+ photo?: string;
5360
+ media?: string[];
5361
+ caption: { type: String; default: null };
5362
+ photo_meta?: {
5363
+ device_orientation?: 1 | 2 | 3 | 4;
5364
+ height?: 1 | 2 | 3 | 4;
5365
+ width?: 1 | 2 | 3 | 4;
5366
+ };
5367
+ paytime: string;
5368
+ client_id: string;
5369
+ client_name: string;
5370
+ creator: {
5371
+ _id: string;
5372
+ type: "rep" | "admin";
5373
+ rep?: string;
5374
+ admin?: string;
5375
+ name?: string;
5376
+ };
5377
+ sync_id: string;
5378
+ payment_serial_number: SerialNumber;
5379
+ refund_serial_number?: SerialNumber;
5380
+ disabled: boolean;
5381
+ settled?: boolean;
5382
+ teams?: string[];
5383
+ company_namespace: string[];
5384
+ }
5385
+ type CheckSchemaWithPopulatedKeys = CheckSchema & {
5386
+ teams?: string[] | Team.TeamSchema[];
5387
+ bank?: string | Bank.BankSchema;
5388
+ client_id?: string | Client.ClientSchema;
5389
+ };
5390
+ type PopulatedKeys = "bank" | "teams" | "client_id";
5391
+ export namespace Find {
5392
+ export type Params = DefaultPaginationQueryParams & {
5393
+ _id?: string[] | string;
5394
+ "creator._id"?: string[] | string;
5395
+ client_id?: string[] | string;
5396
+ check_number?: number;
5397
+ client_name?: string;
5398
+ rep_name?: string;
5399
+ drawer_name?: string;
5400
+ bank_name?: string;
5401
+ amount?: number;
5402
+ settled?: boolean;
5403
+ from_updatedAt?: number;
5404
+ [key: string]: any; // integration_meta.
5405
+ populatedKeys?: PopulatedKeys[];
5406
+ };
5407
+ export interface Result extends DefaultPaginationResult {
5408
+ data: CheckSchemaWithPopulatedKeys[];
5409
+ absolute_total: number;
5410
+ page_total: number;
5411
+ }
5412
+ }
5413
+
5414
+ export namespace Get {
5415
+ export type ID = string;
5416
+ export interface Params {
5417
+ withPrintDetails?: boolean;
5418
+ populatedKeys?: PopulatedKeys[];
5419
+ }
5420
+ export type Result = CheckSchemaWithPopulatedKeys;
5421
+ }
5422
+
5423
+ export namespace Create {
5424
+ export type Body = CreateBody;
5425
+ export type Result = CheckSchema;
5426
+ }
5427
+ }
5198
5428
 
5199
5429
  export namespace Cycle {
5200
5430
  type CycleStatus = "pending" | "approved" | "processing" | "rejected";