repzo 1.0.63 → 1.0.65

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
@@ -640,6 +640,36 @@ export default class Repzo {
640
640
  body: Service.Check.Create.Body
641
641
  ) => Promise<Service.Check.Create.Result>;
642
642
  };
643
+ day: {
644
+ _path: string;
645
+ find: (
646
+ params?: Service.Day.Find.Params
647
+ ) => Promise<Service.Day.Find.Result>;
648
+ get: (
649
+ id: Service.Day.Get.ID,
650
+ params?: Service.Day.Get.Params
651
+ ) => Promise<Service.Day.Get.Result>;
652
+ create: (
653
+ body: Service.Day.Create.Body
654
+ ) => Promise<Service.Day.Create.Result>;
655
+ };
656
+ receivingMaterial: {
657
+ _path: string;
658
+ find: (
659
+ params?: Service.ReceivingMaterial.Find.Params
660
+ ) => Promise<Service.ReceivingMaterial.Find.Result>;
661
+ get: (
662
+ id: Service.ReceivingMaterial.Get.ID,
663
+ params?: Service.ReceivingMaterial.Get.Params
664
+ ) => Promise<Service.ReceivingMaterial.Get.Result>;
665
+ create: (
666
+ body: Service.ReceivingMaterial.Create.Body
667
+ ) => Promise<Service.ReceivingMaterial.Create.Result>;
668
+ update: (
669
+ id: Service.ReceivingMaterial.Update.ID,
670
+ body: Service.ReceivingMaterial.Update.Body
671
+ ) => Promise<Service.ReceivingMaterial.Update.Result>;
672
+ };
643
673
  transfer: {
644
674
  _path: string;
645
675
  find: (
package/lib/index.js CHANGED
@@ -1316,6 +1316,58 @@ export default class Repzo {
1316
1316
  return res;
1317
1317
  },
1318
1318
  };
1319
+ this.day = {
1320
+ _path: "/day",
1321
+ find: async (params) => {
1322
+ let res = await this._fetch(this.svAPIEndpoint, this.day._path, params);
1323
+ return res;
1324
+ },
1325
+ get: async (id, params) => {
1326
+ return await this._fetch(
1327
+ this.svAPIEndpoint,
1328
+ this.day._path + `/${id}`,
1329
+ params
1330
+ );
1331
+ },
1332
+ create: async (body) => {
1333
+ let res = await this._create(this.svAPIEndpoint, this.day._path, body);
1334
+ return res;
1335
+ },
1336
+ };
1337
+ this.receivingMaterial = {
1338
+ _path: "/receiving-material",
1339
+ find: async (params) => {
1340
+ let res = await this._fetch(
1341
+ this.svAPIEndpoint,
1342
+ this.receivingMaterial._path,
1343
+ params
1344
+ );
1345
+ return res;
1346
+ },
1347
+ get: async (id, params) => {
1348
+ return await this._fetch(
1349
+ this.svAPIEndpoint,
1350
+ this.receivingMaterial._path + `/${id}`,
1351
+ params
1352
+ );
1353
+ },
1354
+ create: async (body) => {
1355
+ let res = await this._create(
1356
+ this.svAPIEndpoint,
1357
+ this.receivingMaterial._path,
1358
+ body
1359
+ );
1360
+ return res;
1361
+ },
1362
+ update: async (id, body) => {
1363
+ let res = await this._update(
1364
+ this.svAPIEndpoint,
1365
+ this.receivingMaterial._path + `/${id}`,
1366
+ body
1367
+ );
1368
+ return res;
1369
+ },
1370
+ };
1319
1371
  this.transfer = {
1320
1372
  _path: "/transfer",
1321
1373
  find: async (params) => {
@@ -5128,7 +5128,7 @@ export declare namespace Service {
5128
5128
  check?: Check;
5129
5129
  LinkedTxn?: {
5130
5130
  Txn_serial_number: SerialNumber;
5131
- Txn_invoice_total: number;
5131
+ Txn_total: number;
5132
5132
  TxnType: "return_invoice" | "payment" | "invoice";
5133
5133
  };
5134
5134
  company_namespace: string[];
@@ -5172,7 +5172,7 @@ export declare namespace Service {
5172
5172
  check?: Check;
5173
5173
  LinkedTxn?: {
5174
5174
  Txn_serial_number: SerialNumber;
5175
- Txn_invoice_total: number;
5175
+ Txn_total: number;
5176
5176
  TxnType: "return_invoice" | "payment" | "invoice";
5177
5177
  };
5178
5178
  company_namespace?: string[];
@@ -5475,6 +5475,329 @@ export declare namespace Service {
5475
5475
  }
5476
5476
  export {};
5477
5477
  }
5478
+ namespace Day {
5479
+ export interface DaySchema {
5480
+ _id: string;
5481
+ creator: RepCreator;
5482
+ startTime: string[];
5483
+ endTime: string[];
5484
+ plan: {
5485
+ [key: string]: any;
5486
+ };
5487
+ groupedPlan?: {
5488
+ [key: string]: any;
5489
+ };
5490
+ day: string;
5491
+ timeFrame: {
5492
+ startOfDay?: number;
5493
+ endOfDay?: number;
5494
+ };
5495
+ timeZone?: string;
5496
+ EOD?: string;
5497
+ closed_by_system?: boolean;
5498
+ open: boolean;
5499
+ paymentSnapShot_start?: any[];
5500
+ paymentSnapShot_end?: any[];
5501
+ inventorySnapShot?: any[];
5502
+ target?: {
5503
+ scheduled: any[];
5504
+ unscheduled: any[];
5505
+ missed: any[];
5506
+ };
5507
+ timeOnDuty?: number;
5508
+ breaksTime?: number;
5509
+ timeInVisits?: number;
5510
+ totalTime?: number;
5511
+ totalTravelTime?: number;
5512
+ travelTimeBetweenVisists?: number;
5513
+ teams: string[];
5514
+ created_by_system?: boolean;
5515
+ previously_closed?: boolean;
5516
+ start_geoPoint?: {
5517
+ type: string;
5518
+ coordinates: number[];
5519
+ };
5520
+ end_geoPoint?: {
5521
+ type: string;
5522
+ coordinates: number[];
5523
+ };
5524
+ odometer?: number;
5525
+ startTime_unix?: number[];
5526
+ endTime_unix?: number[];
5527
+ company_namespace: string[];
5528
+ createdAt: Date;
5529
+ updatedAt: Date;
5530
+ }
5531
+ export interface CreateBody {
5532
+ startTime: string[];
5533
+ endTime: string[];
5534
+ plan: {
5535
+ [key: string]: any;
5536
+ };
5537
+ groupedPlan?: {
5538
+ [key: string]: any;
5539
+ };
5540
+ day: string;
5541
+ timeFrame: {
5542
+ startOfDay?: number;
5543
+ endOfDay?: number;
5544
+ };
5545
+ timeZone?: string;
5546
+ EOD?: string;
5547
+ closed_by_system?: boolean;
5548
+ open: boolean;
5549
+ paymentSnapShot_start?: any[];
5550
+ paymentSnapShot_end?: any[];
5551
+ inventorySnapShot?: any[];
5552
+ target?: {
5553
+ [key: string]: any;
5554
+ };
5555
+ timeOnDuty?: number;
5556
+ breaksTime?: number;
5557
+ timeInVisits?: number;
5558
+ totalTime?: number;
5559
+ totalTravelTime?: number;
5560
+ travelTimeBetweenVisists?: number;
5561
+ teams: string[];
5562
+ created_by_system?: boolean;
5563
+ previously_closed?: boolean;
5564
+ start_geoPoint?: {
5565
+ type: string;
5566
+ coordinates: number[];
5567
+ };
5568
+ end_geoPoint?: {
5569
+ type: string;
5570
+ coordinates: number[];
5571
+ };
5572
+ odometer?: number;
5573
+ startTime_unix?: number[];
5574
+ endTime_unix?: number[];
5575
+ company_namespace: string[];
5576
+ }
5577
+ export interface UpdateBody {
5578
+ _id?: string;
5579
+ startTime?: string[];
5580
+ endTime?: string[];
5581
+ plan?: {
5582
+ [key: string]: any;
5583
+ };
5584
+ groupedPlan?: {
5585
+ [key: string]: any;
5586
+ };
5587
+ day?: string;
5588
+ timeFrame?: {
5589
+ startOfDay?: number;
5590
+ endOfDay?: number;
5591
+ };
5592
+ timeZone?: string;
5593
+ EOD?: string;
5594
+ closed_by_system?: boolean;
5595
+ open?: boolean;
5596
+ paymentSnapShot_start?: any[];
5597
+ paymentSnapShot_end?: any[];
5598
+ inventorySnapShot?: any[];
5599
+ target?: {
5600
+ scheduled: any[];
5601
+ unscheduled: any[];
5602
+ missed: any[];
5603
+ };
5604
+ timeOnDuty?: number;
5605
+ breaksTime?: number;
5606
+ timeInVisits?: number;
5607
+ totalTime?: number;
5608
+ totalTravelTime?: number;
5609
+ travelTimeBetweenVisists?: number;
5610
+ teams?: string[];
5611
+ created_by_system?: boolean;
5612
+ previously_closed?: boolean;
5613
+ start_geoPoint?: {
5614
+ type: string;
5615
+ coordinates: number[];
5616
+ };
5617
+ end_geoPoint?: {
5618
+ type: string;
5619
+ coordinates: number[];
5620
+ };
5621
+ odometer?: number;
5622
+ startTime_unix?: number[];
5623
+ endTime_unix?: number[];
5624
+ company_namespace?: string[];
5625
+ }
5626
+ type DaySchemaWithPopulatedKeys = DaySchema & {
5627
+ teams_populated?: string[] | Team.TeamSchema[];
5628
+ };
5629
+ type PopulatedKeys = "teams";
5630
+ export namespace Find {
5631
+ type Params = DefaultPaginationQueryParams & {
5632
+ _id?: string[] | string;
5633
+ "creator._id"?: string[] | string;
5634
+ open?: boolean;
5635
+ day?: string;
5636
+ from_day?: string;
5637
+ to_day?: string;
5638
+ from_updatedAt?: number;
5639
+ [key: string]: any;
5640
+ populatedKeys?: PopulatedKeys[];
5641
+ };
5642
+ interface Result extends DefaultPaginationResult {
5643
+ data: DaySchemaWithPopulatedKeys[];
5644
+ absolute_total: number;
5645
+ page_total: number;
5646
+ }
5647
+ }
5648
+ export namespace Get {
5649
+ type ID = string;
5650
+ interface Params {
5651
+ populatedKeys?: PopulatedKeys[];
5652
+ }
5653
+ type Result = DaySchemaWithPopulatedKeys;
5654
+ }
5655
+ export namespace Create {
5656
+ type Body = CreateBody;
5657
+ type Result = DaySchema;
5658
+ }
5659
+ export {};
5660
+ }
5661
+ namespace ReceivingMaterial {
5662
+ interface ReceivingMaterialSchema {
5663
+ _id: string;
5664
+ serial_number: SerialNumber;
5665
+ from: string | Warehouse.WarehouseSchema;
5666
+ to: string | Warehouse.WarehouseSchema;
5667
+ time: number;
5668
+ creator: AdminCreator | RepCreator | ClientCreator;
5669
+ editor?: AdminCreator | RepCreator | ClientCreator;
5670
+ sync_id: string;
5671
+ variants: {
5672
+ _id: string;
5673
+ variant_id: string;
5674
+ qty: number;
5675
+ variant_name?: string;
5676
+ variant_local_name?: string;
5677
+ product_id?: string;
5678
+ product_name?: string;
5679
+ product_local_name?: string;
5680
+ measure_unit_id?: string;
5681
+ measure_unit_name?: string;
5682
+ measure_unit_qty?: number;
5683
+ measure_unit_factor?: number;
5684
+ updatedAt?: Date;
5685
+ note?: string;
5686
+ }[];
5687
+ teams: string[] | Team.TeamSchema[];
5688
+ items_count?: number;
5689
+ total_items_base_unit_qty?: number;
5690
+ company_namespace: string[];
5691
+ transaction_processed: boolean;
5692
+ status: "pending" | "approved" | "processing" | "rejected" | "processed";
5693
+ comment?: string;
5694
+ business_day?: string;
5695
+ document_type?: "receiving-material";
5696
+ supplier?: string;
5697
+ createdAt: Date;
5698
+ updatedAt: Date;
5699
+ }
5700
+ interface CreateBody {
5701
+ from: string;
5702
+ to: string;
5703
+ time: number;
5704
+ sync_id: string;
5705
+ variants: {
5706
+ _id: string;
5707
+ variant_id: string;
5708
+ qty: number;
5709
+ variant_name?: string;
5710
+ variant_local_name?: string;
5711
+ product_id?: string;
5712
+ product_name?: string;
5713
+ product_local_name?: string;
5714
+ measure_unit_id?: string;
5715
+ measure_unit_name?: string;
5716
+ measure_unit_qty?: number;
5717
+ measure_unit_factor?: number;
5718
+ updatedAt?: Date;
5719
+ note?: string;
5720
+ }[];
5721
+ teams: string[];
5722
+ items_count?: number;
5723
+ total_items_base_unit_qty?: number;
5724
+ company_namespace: string[];
5725
+ transaction_processed: boolean;
5726
+ status: "pending" | "approved" | "processing" | "rejected" | "processed";
5727
+ comment?: string;
5728
+ business_day?: string;
5729
+ supplier?: string;
5730
+ }
5731
+ interface UpdateBody {
5732
+ _id?: string;
5733
+ serial_number?: SerialNumber;
5734
+ from?: string;
5735
+ to?: string;
5736
+ time?: number;
5737
+ sync_id?: string;
5738
+ variants?: {
5739
+ _id: string;
5740
+ variant_id: string;
5741
+ qty: number;
5742
+ variant_name?: string;
5743
+ variant_local_name?: string;
5744
+ product_id?: string;
5745
+ product_name?: string;
5746
+ product_local_name?: string;
5747
+ measure_unit_id?: string;
5748
+ measure_unit_name?: string;
5749
+ measure_unit_qty?: number;
5750
+ measure_unit_factor?: number;
5751
+ updatedAt?: Date;
5752
+ note?: string;
5753
+ }[];
5754
+ teams?: string[];
5755
+ items_count?: number;
5756
+ total_items_base_unit_qty?: number;
5757
+ company_namespace?: string[];
5758
+ transaction_processed?: boolean;
5759
+ status?: "pending" | "approved" | "processing" | "rejected" | "processed";
5760
+ comment?: string;
5761
+ business_day?: string;
5762
+ supplier?: string;
5763
+ }
5764
+ namespace Find {
5765
+ type Params = DefaultPaginationQueryParams & {
5766
+ _id?: string[] | string;
5767
+ "creator._id"?: string[] | string;
5768
+ "creator.name"?: string[] | string;
5769
+ "creator.type"?: string[] | string;
5770
+ type?: string;
5771
+ to?: string;
5772
+ from?: string;
5773
+ status?: string;
5774
+ supplier?: string;
5775
+ from_createdAt?: number;
5776
+ to_createdAt?: number;
5777
+ from_updatedAt?: number;
5778
+ [key: string]: any;
5779
+ };
5780
+ interface Result extends DefaultPaginationResult {
5781
+ data: ReceivingMaterialSchema[];
5782
+ absolute_total: number;
5783
+ page_total: number;
5784
+ }
5785
+ }
5786
+ namespace Get {
5787
+ type ID = string;
5788
+ interface Params {}
5789
+ type Result = ReceivingMaterialSchema;
5790
+ }
5791
+ namespace Create {
5792
+ type Body = CreateBody;
5793
+ type Result = ReceivingMaterialSchema;
5794
+ }
5795
+ namespace Update {
5796
+ type ID = string;
5797
+ type Body = UpdateBody;
5798
+ type Result = ReceivingMaterialSchema;
5799
+ }
5800
+ }
5478
5801
  namespace Cycle {
5479
5802
  type CycleStatus = "pending" | "approved" | "processing" | "rejected";
5480
5803
  export interface Schema {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.63",
3
+ "version": "1.0.65",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -1874,6 +1874,86 @@ export default class Repzo {
1874
1874
  },
1875
1875
  };
1876
1876
 
1877
+ day = {
1878
+ _path: "/day",
1879
+
1880
+ find: async (
1881
+ params?: Service.Day.Find.Params
1882
+ ): Promise<Service.Day.Find.Result> => {
1883
+ let res: Service.Day.Find.Result = await this._fetch(
1884
+ this.svAPIEndpoint,
1885
+ this.day._path,
1886
+ params
1887
+ );
1888
+ return res;
1889
+ },
1890
+
1891
+ get: async (
1892
+ id: Service.Day.Get.ID,
1893
+ params?: Service.Day.Get.Params
1894
+ ): Promise<Service.Day.Get.Result> => {
1895
+ return await this._fetch(
1896
+ this.svAPIEndpoint,
1897
+ this.day._path + `/${id}`,
1898
+ params
1899
+ );
1900
+ },
1901
+
1902
+ create: async (
1903
+ body: Service.Day.Create.Body
1904
+ ): Promise<Service.Day.Create.Result> => {
1905
+ let res = await this._create(this.svAPIEndpoint, this.day._path, body);
1906
+ return res;
1907
+ },
1908
+ };
1909
+ receivingMaterial = {
1910
+ _path: "/receiving-material",
1911
+
1912
+ find: async (
1913
+ params?: Service.ReceivingMaterial.Find.Params
1914
+ ): Promise<Service.ReceivingMaterial.Find.Result> => {
1915
+ let res: Service.ReceivingMaterial.Find.Result = await this._fetch(
1916
+ this.svAPIEndpoint,
1917
+ this.receivingMaterial._path,
1918
+ params
1919
+ );
1920
+ return res;
1921
+ },
1922
+
1923
+ get: async (
1924
+ id: Service.ReceivingMaterial.Get.ID,
1925
+ params?: Service.ReceivingMaterial.Get.Params
1926
+ ): Promise<Service.ReceivingMaterial.Get.Result> => {
1927
+ return await this._fetch(
1928
+ this.svAPIEndpoint,
1929
+ this.receivingMaterial._path + `/${id}`,
1930
+ params
1931
+ );
1932
+ },
1933
+
1934
+ create: async (
1935
+ body: Service.ReceivingMaterial.Create.Body
1936
+ ): Promise<Service.ReceivingMaterial.Create.Result> => {
1937
+ let res = await this._create(
1938
+ this.svAPIEndpoint,
1939
+ this.receivingMaterial._path,
1940
+ body
1941
+ );
1942
+ return res;
1943
+ },
1944
+
1945
+ update: async (
1946
+ id: Service.ReceivingMaterial.Update.ID,
1947
+ body: Service.ReceivingMaterial.Update.Body
1948
+ ): Promise<Service.ReceivingMaterial.Update.Result> => {
1949
+ let res: Service.ReceivingMaterial.Update.Result = await this._update(
1950
+ this.svAPIEndpoint,
1951
+ this.receivingMaterial._path + `/${id}`,
1952
+ body
1953
+ );
1954
+ return res;
1955
+ },
1956
+ };
1877
1957
  transfer = {
1878
1958
  _path: "/transfer",
1879
1959
  find: async (
@@ -5135,7 +5135,7 @@ export namespace Service {
5135
5135
  check?: Check;
5136
5136
  LinkedTxn?: {
5137
5137
  Txn_serial_number: SerialNumber;
5138
- Txn_invoice_total: number;
5138
+ Txn_total: number;
5139
5139
  TxnType: "return_invoice" | "payment" | "invoice";
5140
5140
  };
5141
5141
  company_namespace: string[];
@@ -5177,7 +5177,7 @@ export namespace Service {
5177
5177
  check?: Check;
5178
5178
  LinkedTxn?: {
5179
5179
  Txn_serial_number: SerialNumber;
5180
- Txn_invoice_total: number;
5180
+ Txn_total: number;
5181
5181
  TxnType: "return_invoice" | "payment" | "invoice";
5182
5182
  };
5183
5183
  company_namespace?: string[];
@@ -5483,6 +5483,309 @@ export namespace Service {
5483
5483
  }
5484
5484
  }
5485
5485
 
5486
+ export namespace Day {
5487
+ export interface DaySchema {
5488
+ _id: string;
5489
+ creator: RepCreator;
5490
+ startTime: string[];
5491
+ endTime: string[];
5492
+ plan: { [key: string]: any };
5493
+ groupedPlan?: { [key: string]: any };
5494
+ day: string;
5495
+ timeFrame: { startOfDay?: number; endOfDay?: number };
5496
+ timeZone?: string;
5497
+ EOD?: string;
5498
+ closed_by_system?: boolean;
5499
+ open: boolean;
5500
+ paymentSnapShot_start?: any[];
5501
+ paymentSnapShot_end?: any[];
5502
+ inventorySnapShot?: any[];
5503
+ target?: {
5504
+ scheduled: any[];
5505
+ unscheduled: any[];
5506
+ missed: any[];
5507
+ };
5508
+ timeOnDuty?: number;
5509
+ breaksTime?: number;
5510
+ timeInVisits?: number;
5511
+ totalTime?: number;
5512
+ totalTravelTime?: number;
5513
+ travelTimeBetweenVisists?: number;
5514
+ teams: string[];
5515
+ created_by_system?: boolean;
5516
+ previously_closed?: boolean;
5517
+ start_geoPoint?: {
5518
+ type: string;
5519
+ coordinates: number[];
5520
+ };
5521
+ end_geoPoint?: {
5522
+ type: string;
5523
+ coordinates: number[];
5524
+ };
5525
+ odometer?: number;
5526
+ startTime_unix?: number[];
5527
+ endTime_unix?: number[];
5528
+ company_namespace: string[];
5529
+ createdAt: Date;
5530
+ updatedAt: Date;
5531
+ }
5532
+
5533
+ export interface CreateBody {
5534
+ startTime: string[];
5535
+ endTime: string[];
5536
+ plan: { [key: string]: any };
5537
+ groupedPlan?: { [key: string]: any };
5538
+ day: string;
5539
+ timeFrame: { startOfDay?: number; endOfDay?: number };
5540
+ timeZone?: string;
5541
+ EOD?: string;
5542
+ closed_by_system?: boolean;
5543
+ open: boolean;
5544
+ paymentSnapShot_start?: any[];
5545
+ paymentSnapShot_end?: any[];
5546
+ inventorySnapShot?: any[];
5547
+ target?: { [key: string]: any };
5548
+ timeOnDuty?: number;
5549
+ breaksTime?: number;
5550
+ timeInVisits?: number;
5551
+ totalTime?: number;
5552
+ totalTravelTime?: number;
5553
+ travelTimeBetweenVisists?: number;
5554
+ teams: string[];
5555
+ created_by_system?: boolean;
5556
+ previously_closed?: boolean;
5557
+ start_geoPoint?: {
5558
+ type: string;
5559
+ coordinates: number[];
5560
+ };
5561
+ end_geoPoint?: {
5562
+ type: string;
5563
+ coordinates: number[];
5564
+ };
5565
+ odometer?: number;
5566
+ startTime_unix?: number[];
5567
+ endTime_unix?: number[];
5568
+ company_namespace: string[];
5569
+ }
5570
+
5571
+ export interface UpdateBody {
5572
+ _id?: string;
5573
+ startTime?: string[];
5574
+ endTime?: string[];
5575
+ plan?: { [key: string]: any };
5576
+ groupedPlan?: { [key: string]: any };
5577
+ day?: string;
5578
+ timeFrame?: { startOfDay?: number; endOfDay?: number };
5579
+ timeZone?: string;
5580
+ EOD?: string;
5581
+ closed_by_system?: boolean;
5582
+ open?: boolean;
5583
+ paymentSnapShot_start?: any[];
5584
+ paymentSnapShot_end?: any[];
5585
+ inventorySnapShot?: any[];
5586
+ target?: {
5587
+ scheduled: any[];
5588
+ unscheduled: any[];
5589
+ missed: any[];
5590
+ };
5591
+ timeOnDuty?: number;
5592
+ breaksTime?: number;
5593
+ timeInVisits?: number;
5594
+ totalTime?: number;
5595
+ totalTravelTime?: number;
5596
+ travelTimeBetweenVisists?: number;
5597
+ teams?: string[];
5598
+ created_by_system?: boolean;
5599
+ previously_closed?: boolean;
5600
+ start_geoPoint?: {
5601
+ type: string;
5602
+ coordinates: number[];
5603
+ };
5604
+ end_geoPoint?: {
5605
+ type: string;
5606
+ coordinates: number[];
5607
+ };
5608
+ odometer?: number;
5609
+ startTime_unix?: number[];
5610
+ endTime_unix?: number[];
5611
+ company_namespace?: string[];
5612
+ }
5613
+ type DaySchemaWithPopulatedKeys = DaySchema & {
5614
+ teams_populated?: string[] | Team.TeamSchema[];
5615
+ };
5616
+ type PopulatedKeys = "teams";
5617
+ export namespace Find {
5618
+ export type Params = DefaultPaginationQueryParams & {
5619
+ _id?: string[] | string;
5620
+ "creator._id"?: string[] | string;
5621
+ open?: boolean;
5622
+ day?: string;
5623
+ from_day?: string;
5624
+ to_day?: string;
5625
+ from_updatedAt?: number;
5626
+ [key: string]: any; // integration_meta.
5627
+ populatedKeys?: PopulatedKeys[];
5628
+ };
5629
+ export interface Result extends DefaultPaginationResult {
5630
+ data: DaySchemaWithPopulatedKeys[];
5631
+ absolute_total: number;
5632
+ page_total: number;
5633
+ }
5634
+ }
5635
+ export namespace Get {
5636
+ export type ID = string;
5637
+ export interface Params {
5638
+ populatedKeys?: PopulatedKeys[];
5639
+ }
5640
+ export type Result = DaySchemaWithPopulatedKeys;
5641
+ }
5642
+
5643
+ export namespace Create {
5644
+ export type Body = CreateBody;
5645
+ export type Result = DaySchema;
5646
+ }
5647
+ }
5648
+
5649
+ export namespace ReceivingMaterial {
5650
+ export interface ReceivingMaterialSchema {
5651
+ _id: string;
5652
+ serial_number: SerialNumber;
5653
+ from: string | Warehouse.WarehouseSchema;
5654
+ to: string | Warehouse.WarehouseSchema;
5655
+ time: number;
5656
+ creator: AdminCreator | RepCreator | ClientCreator;
5657
+ editor?: AdminCreator | RepCreator | ClientCreator;
5658
+ sync_id: string;
5659
+ variants: {
5660
+ _id: string;
5661
+ variant_id: string;
5662
+ qty: number;
5663
+ variant_name?: string;
5664
+ variant_local_name?: string;
5665
+ product_id?: string;
5666
+ product_name?: string;
5667
+ product_local_name?: string;
5668
+ measure_unit_id?: string;
5669
+ measure_unit_name?: string;
5670
+ measure_unit_qty?: number;
5671
+ measure_unit_factor?: number;
5672
+ updatedAt?: Date;
5673
+ note?: string;
5674
+ }[];
5675
+ teams: string[] | Team.TeamSchema[];
5676
+ items_count?: number;
5677
+ total_items_base_unit_qty?: number;
5678
+ company_namespace: string[];
5679
+ transaction_processed: boolean;
5680
+ status: "pending" | "approved" | "processing" | "rejected" | "processed";
5681
+ comment?: string;
5682
+ business_day?: string;
5683
+ document_type?: "receiving-material";
5684
+ supplier?: string;
5685
+ createdAt: Date;
5686
+ updatedAt: Date;
5687
+ }
5688
+ export interface CreateBody {
5689
+ from: string;
5690
+ to: string;
5691
+ time: number;
5692
+ sync_id: string;
5693
+ variants: {
5694
+ _id: string;
5695
+ variant_id: string;
5696
+ qty: number;
5697
+ variant_name?: string;
5698
+ variant_local_name?: string;
5699
+ product_id?: string;
5700
+ product_name?: string;
5701
+ product_local_name?: string;
5702
+ measure_unit_id?: string;
5703
+ measure_unit_name?: string;
5704
+ measure_unit_qty?: number;
5705
+ measure_unit_factor?: number;
5706
+ updatedAt?: Date;
5707
+ note?: string;
5708
+ }[];
5709
+ teams: string[];
5710
+ items_count?: number;
5711
+ total_items_base_unit_qty?: number;
5712
+ company_namespace: string[];
5713
+ transaction_processed: boolean;
5714
+ status: "pending" | "approved" | "processing" | "rejected" | "processed";
5715
+ comment?: string;
5716
+ business_day?: string;
5717
+ supplier?: string;
5718
+ }
5719
+ export interface UpdateBody {
5720
+ _id?: string;
5721
+ serial_number?: SerialNumber;
5722
+ from?: string;
5723
+ to?: string;
5724
+ time?: number;
5725
+ sync_id?: string;
5726
+ variants?: {
5727
+ _id: string;
5728
+ variant_id: string;
5729
+ qty: number;
5730
+ variant_name?: string;
5731
+ variant_local_name?: string;
5732
+ product_id?: string;
5733
+ product_name?: string;
5734
+ product_local_name?: string;
5735
+ measure_unit_id?: string;
5736
+ measure_unit_name?: string;
5737
+ measure_unit_qty?: number;
5738
+ measure_unit_factor?: number;
5739
+ updatedAt?: Date;
5740
+ note?: string;
5741
+ }[];
5742
+ teams?: string[];
5743
+ items_count?: number;
5744
+ total_items_base_unit_qty?: number;
5745
+ company_namespace?: string[];
5746
+ transaction_processed?: boolean;
5747
+ status?: "pending" | "approved" | "processing" | "rejected" | "processed";
5748
+ comment?: string;
5749
+ business_day?: string;
5750
+ supplier?: string;
5751
+ }
5752
+ export namespace Find {
5753
+ export type Params = DefaultPaginationQueryParams & {
5754
+ _id?: string[] | string;
5755
+ "creator._id"?: string[] | string;
5756
+ "creator.name"?: string[] | string;
5757
+ "creator.type"?: string[] | string;
5758
+ type?: string;
5759
+ to?: string;
5760
+ from?: string;
5761
+ status?: string;
5762
+ supplier?: string;
5763
+ from_createdAt?: number;
5764
+ to_createdAt?: number;
5765
+ from_updatedAt?: number;
5766
+ [key: string]: any; // integration_meta.
5767
+ };
5768
+ export interface Result extends DefaultPaginationResult {
5769
+ data: ReceivingMaterialSchema[];
5770
+ absolute_total: number;
5771
+ page_total: number;
5772
+ }
5773
+ }
5774
+ export namespace Get {
5775
+ export type ID = string;
5776
+ export interface Params {}
5777
+ export type Result = ReceivingMaterialSchema;
5778
+ }
5779
+ export namespace Create {
5780
+ export type Body = CreateBody;
5781
+ export type Result = ReceivingMaterialSchema;
5782
+ }
5783
+ export namespace Update {
5784
+ export type ID = string;
5785
+ export type Body = UpdateBody;
5786
+ export type Result = ReceivingMaterialSchema;
5787
+ }
5788
+ }
5486
5789
  export namespace Cycle {
5487
5790
  type CycleStatus = "pending" | "approved" | "processing" | "rejected";
5488
5791
  export interface Schema {