repzo 1.0.60 → 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
@@ -627,6 +627,19 @@ export default class Repzo {
627
627
  body: Service.Settlement.Update.Body
628
628
  ) => Promise<Service.Settlement.Update.Result>;
629
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
+ };
630
643
  transfer: {
631
644
  _path: string;
632
645
  find: (
package/lib/index.js CHANGED
@@ -1290,6 +1290,32 @@ export default class Repzo {
1290
1290
  return res;
1291
1291
  },
1292
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
+ };
1293
1319
  this.transfer = {
1294
1320
  _path: "/transfer",
1295
1321
  find: async (params) => {
@@ -5267,8 +5267,9 @@ export declare namespace Service {
5267
5267
  }
5268
5268
  type SettlementSchemaWithPopulatedKeys = SettlementSchema & {
5269
5269
  teams_populated?: string[] | Team.TeamSchema[];
5270
+ check_populated?: string | Check.CheckSchema;
5270
5271
  };
5271
- type PopulatedKeys = "teams";
5272
+ type PopulatedKeys = "teams" | "check_id";
5272
5273
  export namespace Find {
5273
5274
  type Params = DefaultPaginationQueryParams & {
5274
5275
  _id?: string[] | string;
@@ -5306,6 +5307,124 @@ export declare namespace Service {
5306
5307
  }
5307
5308
  export {};
5308
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
+ }
5309
5428
  namespace Cycle {
5310
5429
  type CycleStatus = "pending" | "approved" | "processing" | "rejected";
5311
5430
  export interface Schema {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.60",
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
@@ -1841,6 +1841,39 @@ export default class Repzo {
1841
1841
  },
1842
1842
  };
1843
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
+
1844
1877
  transfer = {
1845
1878
  _path: "/transfer",
1846
1879
  find: async (
@@ -5269,8 +5269,9 @@ export namespace Service {
5269
5269
 
5270
5270
  type SettlementSchemaWithPopulatedKeys = SettlementSchema & {
5271
5271
  teams_populated?: string[] | Team.TeamSchema[];
5272
+ check_populated?: string | Check.CheckSchema;
5272
5273
  };
5273
- type PopulatedKeys = "teams";
5274
+ type PopulatedKeys = "teams" | "check_id";
5274
5275
  export namespace Find {
5275
5276
  export type Params = DefaultPaginationQueryParams & {
5276
5277
  _id?: string[] | string;
@@ -5310,6 +5311,121 @@ export namespace Service {
5310
5311
  export type Result = SettlementSchema;
5311
5312
  }
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
+ }
5428
+
5313
5429
  export namespace Cycle {
5314
5430
  type CycleStatus = "pending" | "approved" | "processing" | "rejected";
5315
5431
  export interface Schema {