repzo 1.0.70 → 1.0.72

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
@@ -758,6 +758,43 @@ export default class Repzo {
758
758
  id: Service.MediaStorage.Remove.ID
759
759
  ) => Promise<Service.MediaStorage.Remove.Result>;
760
760
  };
761
+ storecheckTemplate: {
762
+ _path: string;
763
+ find: (
764
+ params?: Service.StorecheckTemplate.Find.Params
765
+ ) => Promise<Service.StorecheckTemplate.Find.Result>;
766
+ get: (
767
+ id: Service.StorecheckTemplate.Get.ID,
768
+ params?: Service.StorecheckTemplate.Get.Params
769
+ ) => Promise<Service.StorecheckTemplate.Get.Result>;
770
+ create: (
771
+ body: Service.StorecheckTemplate.Create.Body
772
+ ) => Promise<Service.StorecheckTemplate.Create.Result>;
773
+ update: (
774
+ id: Service.StorecheckTemplate.Update.ID,
775
+ body: Service.StorecheckTemplate.Update.Body
776
+ ) => Promise<Service.StorecheckTemplate.Update.Result>;
777
+ remove: (
778
+ id: Service.StorecheckTemplate.Remove.ID
779
+ ) => Promise<Service.StorecheckTemplate.Remove.Result>;
780
+ };
781
+ activityStorecheck: {
782
+ _path: string;
783
+ find: (
784
+ params?: Service.ActivityStorecheck.Find.Params
785
+ ) => Promise<Service.ActivityStorecheck.Find.Result>;
786
+ get: (
787
+ id: Service.ActivityStorecheck.Get.ID,
788
+ params?: Service.ActivityStorecheck.Get.Params
789
+ ) => Promise<Service.ActivityStorecheck.Get.Result>;
790
+ create: (
791
+ body: Service.ActivityStorecheck.Create.Body
792
+ ) => Promise<Service.ActivityStorecheck.Create.Result>;
793
+ update: (
794
+ id: Service.ActivityStorecheck.Update.ID,
795
+ body: Service.ActivityStorecheck.Update.Body
796
+ ) => Promise<Service.ActivityStorecheck.Update.Result>;
797
+ };
761
798
  adjustInventory: {
762
799
  _path: string;
763
800
  find: (
package/lib/index.js CHANGED
@@ -1543,6 +1543,81 @@ export default class Repzo {
1543
1543
  return res;
1544
1544
  },
1545
1545
  };
1546
+ this.storecheckTemplate = {
1547
+ _path: "/storecheck-template",
1548
+ find: async (params) => {
1549
+ let res = await this._fetch(
1550
+ this.svAPIEndpoint,
1551
+ this.storecheckTemplate._path,
1552
+ params
1553
+ );
1554
+ return res;
1555
+ },
1556
+ get: async (id, params) => {
1557
+ return await this._fetch(
1558
+ this.svAPIEndpoint,
1559
+ this.storecheckTemplate._path + `/${id}`,
1560
+ params
1561
+ );
1562
+ },
1563
+ create: async (body) => {
1564
+ let res = await this._create(
1565
+ this.svAPIEndpoint,
1566
+ this.storecheckTemplate._path,
1567
+ body
1568
+ );
1569
+ return res;
1570
+ },
1571
+ update: async (id, body) => {
1572
+ let res = await this._update(
1573
+ this.svAPIEndpoint,
1574
+ this.storecheckTemplate._path + `/${id}`,
1575
+ body
1576
+ );
1577
+ return res;
1578
+ },
1579
+ remove: async (id) => {
1580
+ let res = await this._delete(
1581
+ this.svAPIEndpoint,
1582
+ this.storecheckTemplate._path + `/${id}`
1583
+ );
1584
+ return res;
1585
+ },
1586
+ };
1587
+ this.activityStorecheck = {
1588
+ _path: "/activity-storecheck",
1589
+ find: async (params) => {
1590
+ let res = await this._fetch(
1591
+ this.svAPIEndpoint,
1592
+ this.activityStorecheck._path,
1593
+ params
1594
+ );
1595
+ return res;
1596
+ },
1597
+ get: async (id, params) => {
1598
+ return await this._fetch(
1599
+ this.svAPIEndpoint,
1600
+ this.activityStorecheck._path + `/${id}`,
1601
+ params
1602
+ );
1603
+ },
1604
+ create: async (body) => {
1605
+ let res = await this._create(
1606
+ this.svAPIEndpoint,
1607
+ this.activityStorecheck._path,
1608
+ body
1609
+ );
1610
+ return res;
1611
+ },
1612
+ update: async (id, body) => {
1613
+ let res = await this._update(
1614
+ this.svAPIEndpoint,
1615
+ this.activityStorecheck._path + `/${id}`,
1616
+ body
1617
+ );
1618
+ return res;
1619
+ },
1620
+ };
1546
1621
  this.adjustInventory = {
1547
1622
  _path: "/adjust-inventory",
1548
1623
  find: async (params) => {
@@ -223,6 +223,17 @@ export type Day =
223
223
  | "Fri"
224
224
  | "Sat"
225
225
  | string;
226
+ export type FieldType =
227
+ | "Text"
228
+ | "String"
229
+ | "Date"
230
+ | "Image"
231
+ | "Boolean"
232
+ | "Number"
233
+ | "List"
234
+ | "Separator"
235
+ | "Heading"
236
+ | "Media";
226
237
  export interface WeeklyDetails {
227
238
  every: number;
228
239
  days: Day[];
@@ -373,6 +384,10 @@ export interface GeoTag {
373
384
  lng: number;
374
385
  formatted_address: string;
375
386
  }
387
+ interface GeoPoint {
388
+ type: "Point";
389
+ coordinates: number[];
390
+ }
376
391
  export declare namespace Service {
377
392
  namespace Client {
378
393
  interface Financials {
@@ -1851,6 +1866,369 @@ export declare namespace Service {
1851
1866
  }
1852
1867
  export {};
1853
1868
  }
1869
+ namespace StorecheckTemplate {
1870
+ type SourceType =
1871
+ | "product"
1872
+ | "variant"
1873
+ | "product-category"
1874
+ | "product-sub-category"
1875
+ | "product-brand"
1876
+ | "product-group";
1877
+ type DataType =
1878
+ | "Separator"
1879
+ | "timestamp"
1880
+ | "String"
1881
+ | "Number"
1882
+ | "Boolean"
1883
+ | "Date"
1884
+ | "Image"
1885
+ | "coords"
1886
+ | "Text"
1887
+ | "Media"
1888
+ | "Heading"
1889
+ | "List"
1890
+ | "Phone"
1891
+ | "Email"
1892
+ | "Signature"
1893
+ | "DateTime"
1894
+ | "YesNo"
1895
+ | "ProductBarcodeScan"
1896
+ | "BarcodeScan"
1897
+ | "GeoPoint";
1898
+ interface UsedField {
1899
+ code: string;
1900
+ key: string;
1901
+ data_type: DataType;
1902
+ field_type: "template_field" | "source_attribute" | "activity_attribute";
1903
+ label: string;
1904
+ isArray?: boolean;
1905
+ formula_key: string;
1906
+ field_id?: string;
1907
+ example_value: DataType;
1908
+ manipulator_function?: string;
1909
+ lookup?: {
1910
+ from?: string;
1911
+ localField?: string;
1912
+ foreignField?: string;
1913
+ as?: string;
1914
+ select?: string;
1915
+ unwind?: boolean;
1916
+ filter?: {
1917
+ input?: string;
1918
+ as: string;
1919
+ cond: any;
1920
+ };
1921
+ };
1922
+ }
1923
+ interface Field {
1924
+ _id?: string;
1925
+ name: string;
1926
+ local_name?: string;
1927
+ description?: string;
1928
+ local_description?: string;
1929
+ type: FieldType;
1930
+ isArray?: boolean;
1931
+ isRequired?: boolean;
1932
+ readOnly?: boolean;
1933
+ presets?: any[];
1934
+ previous_entry?: any;
1935
+ show_previous_result?: boolean;
1936
+ hidden?: boolean;
1937
+ custom_list?: string;
1938
+ custom_list_element?: string;
1939
+ parent_field?: string;
1940
+ invisible?: boolean;
1941
+ display_on_home_screen?: boolean;
1942
+ custom_list_end_point?: {
1943
+ [key: string]: any;
1944
+ };
1945
+ visibility?: {
1946
+ operator: "and" | "or";
1947
+ conditions: {
1948
+ field_id: string;
1949
+ type: "Boolean" | "List";
1950
+ custom_list?: string;
1951
+ operator: "lte" | "lt" | "gte" | "gt" | "eq" | "ne" | "in" | "nin";
1952
+ value: any[];
1953
+ }[];
1954
+ };
1955
+ barcode_scan?: boolean;
1956
+ is_calculated_field?: boolean;
1957
+ formula?: string;
1958
+ formula_key: string;
1959
+ used_fields?: UsedField[];
1960
+ }
1961
+ interface Entry {
1962
+ _id?: string;
1963
+ repeatable: boolean;
1964
+ grouping: "product-category" | "product-brand" | "product-group";
1965
+ require_all_source_elements: boolean;
1966
+ require_group_source_elements: boolean;
1967
+ source: SourceType;
1968
+ filters: string[];
1969
+ fields: Field[];
1970
+ }
1971
+ export interface StorecheckTemplateSchema {
1972
+ _id: string;
1973
+ name: string;
1974
+ local_name?: string;
1975
+ description?: string;
1976
+ local_description?: string;
1977
+ disabled: boolean;
1978
+ entries: Entry[];
1979
+ company_namespace: string[];
1980
+ can_edit_types?: boolean;
1981
+ copied_from?: string;
1982
+ client_specific_sources: boolean;
1983
+ previous_result_activated: boolean;
1984
+ presets_activated: boolean;
1985
+ createdAt?: string;
1986
+ updatedAt?: string;
1987
+ __v?: number;
1988
+ }
1989
+ export interface CreateBody {
1990
+ name: string;
1991
+ local_name?: string;
1992
+ description?: string;
1993
+ local_description?: string;
1994
+ disabled: boolean;
1995
+ company_namespace: string[];
1996
+ can_edit_types?: boolean;
1997
+ copied_from?: string;
1998
+ client_specific_sources: boolean;
1999
+ previous_result_activated: boolean;
2000
+ presets_activated: boolean;
2001
+ }
2002
+ export interface UpdateBody {
2003
+ _id?: string;
2004
+ name?: string;
2005
+ local_name?: string;
2006
+ description?: string;
2007
+ local_description?: string;
2008
+ disabled?: boolean;
2009
+ company_namespace?: string[];
2010
+ can_edit_types?: boolean;
2011
+ copied_from?: string;
2012
+ client_specific_sources?: boolean;
2013
+ previous_result_activated?: boolean;
2014
+ presets_activated?: boolean;
2015
+ }
2016
+ export namespace Find {
2017
+ type Params = DefaultPaginationQueryParams & {
2018
+ _id?: string[] | string;
2019
+ key?: string;
2020
+ name?: string;
2021
+ local_name?: string;
2022
+ disabled?: boolean;
2023
+ from_updatedAt?: number;
2024
+ };
2025
+ interface Result extends DefaultPaginationResult {
2026
+ data: StorecheckTemplateSchema[];
2027
+ }
2028
+ }
2029
+ export namespace Get {
2030
+ type ID = string;
2031
+ interface Params {}
2032
+ type Result = StorecheckTemplateSchema;
2033
+ }
2034
+ export namespace Create {
2035
+ type Body = CreateBody;
2036
+ type Result = StorecheckTemplateSchema;
2037
+ }
2038
+ export namespace Update {
2039
+ type ID = string;
2040
+ type Body = UpdateBody;
2041
+ type Result = StorecheckTemplateSchema;
2042
+ }
2043
+ export namespace Remove {
2044
+ type ID = string;
2045
+ type Result = StorecheckTemplateSchema;
2046
+ }
2047
+ export {};
2048
+ }
2049
+ namespace ActivityStorecheck {
2050
+ interface Field {
2051
+ _id?: string;
2052
+ name: string;
2053
+ type: FieldType;
2054
+ isArray: boolean;
2055
+ isRequired?: boolean;
2056
+ is_calculated_field?: boolean;
2057
+ formula_key?: string;
2058
+ parent_field?: string;
2059
+ custom_list?: string;
2060
+ field_id: string;
2061
+ result: any[];
2062
+ result_custom_list_ids?: any[];
2063
+ calculation_status?: "success" | "failed";
2064
+ calculation_error?: string | any[];
2065
+ company_namespace?: string[];
2066
+ }
2067
+ export interface Division {
2068
+ fields: Field[];
2069
+ }
2070
+ interface Result {
2071
+ source_id: string;
2072
+ source_name: string;
2073
+ divisions: Division[];
2074
+ }
2075
+ interface Entry {
2076
+ entry_id: string;
2077
+ source:
2078
+ | "product"
2079
+ | "variant"
2080
+ | "product-category"
2081
+ | "product-sub-category"
2082
+ | "product-brand"
2083
+ | "product-group";
2084
+ results: Result[];
2085
+ }
2086
+ export interface ActivityStorecheckSchema {
2087
+ _id: string;
2088
+ company_namespace: string[];
2089
+ client: string;
2090
+ client_name: string;
2091
+ sync_id: string;
2092
+ time_zone: string;
2093
+ template_id: string;
2094
+ visit?: string;
2095
+ visit_id: string;
2096
+ battery_level?: number;
2097
+ user: string;
2098
+ user_name: string;
2099
+ time: number;
2100
+ geo_tag?: GeoTag;
2101
+ geoPoint: GeoPoint;
2102
+ teams?: string[];
2103
+ route?: string;
2104
+ tags?: string[];
2105
+ entries: Entry[];
2106
+ platform?: string;
2107
+ version_name?: string;
2108
+ device_brand?: string;
2109
+ device_os?: string;
2110
+ device_os_version?: string;
2111
+ device_model?: string;
2112
+ identifier?: number;
2113
+ device_id?: string;
2114
+ device_unique_id?: string;
2115
+ network_state?: number;
2116
+ serial_number?: SerialNumber;
2117
+ job_start_time?: number;
2118
+ job_end_time?: number;
2119
+ job_duration?: number;
2120
+ }
2121
+ export interface CreateBody {
2122
+ company_namespace: string[];
2123
+ client: string;
2124
+ client_name: string;
2125
+ time_zone: string;
2126
+ template_id: string;
2127
+ visit?: string;
2128
+ visit_id: string;
2129
+ user: string;
2130
+ user_name: string;
2131
+ time: number;
2132
+ geo_tag?: GeoTag;
2133
+ geoPoint: GeoPoint;
2134
+ teams?: string[];
2135
+ route?: string;
2136
+ tags?: string[];
2137
+ entries: Entry[];
2138
+ }
2139
+ export interface UpdateBody {
2140
+ _id?: string;
2141
+ company_namespace?: string[];
2142
+ client?: string;
2143
+ client_name?: string;
2144
+ sync_id?: string;
2145
+ time_zone?: string;
2146
+ template_id?: string;
2147
+ visit?: string;
2148
+ visit_id?: string;
2149
+ battery_level?: number;
2150
+ user?: string;
2151
+ user_name?: string;
2152
+ time?: number;
2153
+ geo_tag?: GeoTag;
2154
+ geoPoint?: GeoPoint;
2155
+ teams?: string[];
2156
+ route?: string;
2157
+ tags?: string[];
2158
+ entries?: Entry[];
2159
+ platform?: string;
2160
+ version_name?: string;
2161
+ device_brand?: string;
2162
+ device_os?: string;
2163
+ device_os_version?: string;
2164
+ device_model?: string;
2165
+ identifier?: number;
2166
+ device_id?: string;
2167
+ device_unique_id?: string;
2168
+ network_state?: number;
2169
+ serial_number?: SerialNumber;
2170
+ job_start_time?: number;
2171
+ job_end_time?: number;
2172
+ job_duration?: number;
2173
+ }
2174
+ type PopulatedKeys =
2175
+ | "teams"
2176
+ | "tags"
2177
+ | "client"
2178
+ | "user"
2179
+ | "route"
2180
+ | "visit"
2181
+ | "template_id";
2182
+ export type ActivityStoreCheckWithPopulatedKeysSchema = ActivityStorecheckSchema & {
2183
+ teams_populated: Team.TeamSchema[] | string[];
2184
+ tags_populated: Tag.TagSchema[] | string[];
2185
+ client_populated: Client.ClientSchema | string;
2186
+ user_populated: Rep.RepSchema | string;
2187
+ route_populated: Route.RouteSchema | string;
2188
+ visit_populated: Visit.VisitSchema | string;
2189
+ template_id_populated:
2190
+ | StorecheckTemplate.StorecheckTemplateSchema
2191
+ | string;
2192
+ };
2193
+ export namespace Find {
2194
+ type Params = DefaultPaginationQueryParams & {
2195
+ _id?: string[] | string;
2196
+ search?: string;
2197
+ name?: string[] | string;
2198
+ local_name?: string[] | string;
2199
+ disabled?: boolean;
2200
+ from_updatedAt?: number;
2201
+ from_time?: number;
2202
+ to_time?: number;
2203
+ client?: string;
2204
+ user?: string;
2205
+ tags?: string[];
2206
+ template_id?: string;
2207
+ teams?: string[];
2208
+ route?: string;
2209
+ populatedKeys?: PopulatedKeys[];
2210
+ [key: string]: any;
2211
+ };
2212
+ interface Result extends DefaultPaginationResult {
2213
+ data: ActivityStoreCheckWithPopulatedKeysSchema[];
2214
+ }
2215
+ }
2216
+ export namespace Get {
2217
+ type ID = string;
2218
+ interface Params {}
2219
+ type Result = ActivityStorecheckSchema;
2220
+ }
2221
+ export namespace Create {
2222
+ type Body = CreateBody;
2223
+ type Result = ActivityStorecheckSchema;
2224
+ }
2225
+ export namespace Update {
2226
+ type ID = string;
2227
+ type Body = UpdateBody;
2228
+ type Result = ActivityStorecheckSchema;
2229
+ }
2230
+ export {};
2231
+ }
1854
2232
  namespace Msl {
1855
2233
  interface MslSchema {
1856
2234
  _id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.70",
3
+ "version": "1.0.72",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -2210,6 +2210,112 @@ export default class Repzo {
2210
2210
  },
2211
2211
  };
2212
2212
 
2213
+ storecheckTemplate = {
2214
+ _path: "/storecheck-template",
2215
+ find: async (
2216
+ params?: Service.StorecheckTemplate.Find.Params
2217
+ ): Promise<Service.StorecheckTemplate.Find.Result> => {
2218
+ let res: Service.StorecheckTemplate.Find.Result = await this._fetch(
2219
+ this.svAPIEndpoint,
2220
+ this.storecheckTemplate._path,
2221
+ params
2222
+ );
2223
+ return res;
2224
+ },
2225
+
2226
+ get: async (
2227
+ id: Service.StorecheckTemplate.Get.ID,
2228
+ params?: Service.StorecheckTemplate.Get.Params
2229
+ ): Promise<Service.StorecheckTemplate.Get.Result> => {
2230
+ return await this._fetch(
2231
+ this.svAPIEndpoint,
2232
+ this.storecheckTemplate._path + `/${id}`,
2233
+ params
2234
+ );
2235
+ },
2236
+
2237
+ create: async (
2238
+ body: Service.StorecheckTemplate.Create.Body
2239
+ ): Promise<Service.StorecheckTemplate.Create.Result> => {
2240
+ let res = await this._create(
2241
+ this.svAPIEndpoint,
2242
+ this.storecheckTemplate._path,
2243
+ body
2244
+ );
2245
+ return res;
2246
+ },
2247
+
2248
+ update: async (
2249
+ id: Service.StorecheckTemplate.Update.ID,
2250
+ body: Service.StorecheckTemplate.Update.Body
2251
+ ): Promise<Service.StorecheckTemplate.Update.Result> => {
2252
+ let res: Service.StorecheckTemplate.Update.Result = await this._update(
2253
+ this.svAPIEndpoint,
2254
+ this.storecheckTemplate._path + `/${id}`,
2255
+ body
2256
+ );
2257
+ return res;
2258
+ },
2259
+
2260
+ remove: async (
2261
+ id: Service.StorecheckTemplate.Remove.ID
2262
+ ): Promise<Service.StorecheckTemplate.Remove.Result> => {
2263
+ let res: Service.StorecheckTemplate.Remove.Result = await this._delete(
2264
+ this.svAPIEndpoint,
2265
+ this.storecheckTemplate._path + `/${id}`
2266
+ );
2267
+ return res;
2268
+ },
2269
+ };
2270
+
2271
+ activityStorecheck = {
2272
+ _path: "/activity-storecheck",
2273
+ find: async (
2274
+ params?: Service.ActivityStorecheck.Find.Params
2275
+ ): Promise<Service.ActivityStorecheck.Find.Result> => {
2276
+ let res: Service.ActivityStorecheck.Find.Result = await this._fetch(
2277
+ this.svAPIEndpoint,
2278
+ this.activityStorecheck._path,
2279
+ params
2280
+ );
2281
+ return res;
2282
+ },
2283
+
2284
+ get: async (
2285
+ id: Service.ActivityStorecheck.Get.ID,
2286
+ params?: Service.ActivityStorecheck.Get.Params
2287
+ ): Promise<Service.ActivityStorecheck.Get.Result> => {
2288
+ return await this._fetch(
2289
+ this.svAPIEndpoint,
2290
+ this.activityStorecheck._path + `/${id}`,
2291
+ params
2292
+ );
2293
+ },
2294
+
2295
+ create: async (
2296
+ body: Service.ActivityStorecheck.Create.Body
2297
+ ): Promise<Service.ActivityStorecheck.Create.Result> => {
2298
+ let res = await this._create(
2299
+ this.svAPIEndpoint,
2300
+ this.activityStorecheck._path,
2301
+ body
2302
+ );
2303
+ return res;
2304
+ },
2305
+
2306
+ update: async (
2307
+ id: Service.ActivityStorecheck.Update.ID,
2308
+ body: Service.ActivityStorecheck.Update.Body
2309
+ ): Promise<Service.ActivityStorecheck.Update.Result> => {
2310
+ let res: Service.ActivityStorecheck.Update.Result = await this._update(
2311
+ this.svAPIEndpoint,
2312
+ this.activityStorecheck._path + `/${id}`,
2313
+ body
2314
+ );
2315
+ return res;
2316
+ },
2317
+ };
2318
+
2213
2319
  adjustInventory = {
2214
2320
  _path: "/adjust-inventory",
2215
2321
  find: async (
@@ -225,6 +225,18 @@ export type Day =
225
225
  | "Fri"
226
226
  | "Sat"
227
227
  | string;
228
+
229
+ export type FieldType =
230
+ | "Text"
231
+ | "String"
232
+ | "Date"
233
+ | "Image"
234
+ | "Boolean"
235
+ | "Number"
236
+ | "List"
237
+ | "Separator"
238
+ | "Heading"
239
+ | "Media";
228
240
  export interface WeeklyDetails {
229
241
  every: number;
230
242
  days: Day[];
@@ -377,6 +389,11 @@ export interface GeoTag {
377
389
  lng: number;
378
390
  formatted_address: string;
379
391
  }
392
+ interface GeoPoint {
393
+ type: "Point";
394
+ coordinates: number[];
395
+ }
396
+
380
397
  // <reference path = "vehicle.ts" />
381
398
  export namespace Service {
382
399
  export namespace Client {
@@ -1884,6 +1901,371 @@ export namespace Service {
1884
1901
  }
1885
1902
  }
1886
1903
 
1904
+ export namespace StorecheckTemplate {
1905
+ type SourceType =
1906
+ | "product"
1907
+ | "variant"
1908
+ | "product-category"
1909
+ | "product-sub-category"
1910
+ | "product-brand"
1911
+ | "product-group";
1912
+
1913
+ type DataType =
1914
+ | "Separator"
1915
+ | "timestamp"
1916
+ | "String"
1917
+ | "Number"
1918
+ | "Boolean"
1919
+ | "Date"
1920
+ | "Image"
1921
+ | "coords"
1922
+ | "Text"
1923
+ | "Media"
1924
+ | "Heading"
1925
+ | "List"
1926
+ | "Phone"
1927
+ | "Email"
1928
+ | "Signature"
1929
+ | "DateTime"
1930
+ | "YesNo"
1931
+ | "ProductBarcodeScan"
1932
+ | "BarcodeScan"
1933
+ | "GeoPoint";
1934
+ interface UsedField {
1935
+ code: string;
1936
+ key: string;
1937
+ data_type: DataType;
1938
+ field_type: "template_field" | "source_attribute" | "activity_attribute";
1939
+ label: string;
1940
+ isArray?: boolean;
1941
+ formula_key: string;
1942
+ field_id?: string;
1943
+ example_value: DataType;
1944
+ manipulator_function?: string;
1945
+ lookup?: {
1946
+ from?: string;
1947
+ localField?: string;
1948
+ foreignField?: string;
1949
+ as?: string;
1950
+ select?: string;
1951
+ unwind?: boolean;
1952
+ filter?: {
1953
+ input?: string;
1954
+ as: string;
1955
+ cond: any;
1956
+ };
1957
+ };
1958
+ }
1959
+ interface Field {
1960
+ _id?: string;
1961
+ name: string;
1962
+ local_name?: string;
1963
+ description?: string;
1964
+ local_description?: string;
1965
+ type: FieldType;
1966
+ isArray?: boolean;
1967
+ isRequired?: boolean;
1968
+ readOnly?: boolean;
1969
+ presets?: any[];
1970
+ previous_entry?: any;
1971
+ show_previous_result?: boolean;
1972
+ hidden?: boolean;
1973
+ custom_list?: string;
1974
+ custom_list_element?: string;
1975
+ parent_field?: string;
1976
+ invisible?: boolean;
1977
+ display_on_home_screen?: boolean;
1978
+ custom_list_end_point?: { [key: string]: any };
1979
+ visibility?: {
1980
+ operator: "and" | "or";
1981
+ conditions: {
1982
+ field_id: string;
1983
+ type: "Boolean" | "List"; // FieldType;
1984
+ custom_list?: string;
1985
+ operator: "lte" | "lt" | "gte" | "gt" | "eq" | "ne" | "in" | "nin";
1986
+ value: any[];
1987
+ }[];
1988
+ };
1989
+ barcode_scan?: boolean;
1990
+ is_calculated_field?: boolean;
1991
+ formula?: string;
1992
+ formula_key: string;
1993
+ used_fields?: UsedField[];
1994
+ }
1995
+ interface Entry {
1996
+ _id?: string;
1997
+ repeatable: boolean;
1998
+ grouping: "product-category" | "product-brand" | "product-group";
1999
+ require_all_source_elements: boolean;
2000
+ require_group_source_elements: boolean;
2001
+ source: SourceType;
2002
+ filters: string[];
2003
+ fields: Field[];
2004
+ }
2005
+ export interface StorecheckTemplateSchema {
2006
+ _id: string;
2007
+ name: string;
2008
+ local_name?: string;
2009
+ description?: string;
2010
+ local_description?: string;
2011
+ disabled: boolean;
2012
+ entries: Entry[];
2013
+ company_namespace: string[];
2014
+ can_edit_types?: boolean;
2015
+ copied_from?: string;
2016
+ client_specific_sources: boolean;
2017
+ previous_result_activated: boolean;
2018
+ presets_activated: boolean;
2019
+ createdAt?: string;
2020
+ updatedAt?: string;
2021
+ __v?: number;
2022
+ }
2023
+ export interface CreateBody {
2024
+ name: string;
2025
+ local_name?: string;
2026
+ description?: string;
2027
+ local_description?: string;
2028
+ disabled: boolean;
2029
+ company_namespace: string[];
2030
+ can_edit_types?: boolean;
2031
+ copied_from?: string;
2032
+ client_specific_sources: boolean;
2033
+ previous_result_activated: boolean;
2034
+ presets_activated: boolean;
2035
+ }
2036
+ export interface UpdateBody {
2037
+ _id?: string;
2038
+ name?: string;
2039
+ local_name?: string;
2040
+ description?: string;
2041
+ local_description?: string;
2042
+ disabled?: boolean;
2043
+ company_namespace?: string[];
2044
+ can_edit_types?: boolean;
2045
+ copied_from?: string;
2046
+ client_specific_sources?: boolean;
2047
+ previous_result_activated?: boolean;
2048
+ presets_activated?: boolean;
2049
+ }
2050
+ export namespace Find {
2051
+ export type Params = DefaultPaginationQueryParams & {
2052
+ _id?: string[] | string;
2053
+ key?: string;
2054
+ name?: string;
2055
+ local_name?: string;
2056
+ disabled?: boolean;
2057
+ from_updatedAt?: number;
2058
+ };
2059
+ export interface Result extends DefaultPaginationResult {
2060
+ data: StorecheckTemplateSchema[];
2061
+ }
2062
+ }
2063
+ export namespace Get {
2064
+ export type ID = string;
2065
+ export interface Params {}
2066
+ export type Result = StorecheckTemplateSchema;
2067
+ }
2068
+ export namespace Create {
2069
+ export type Body = CreateBody;
2070
+ export type Result = StorecheckTemplateSchema;
2071
+ }
2072
+ export namespace Update {
2073
+ export type ID = string;
2074
+ export type Body = UpdateBody;
2075
+ export type Result = StorecheckTemplateSchema;
2076
+ }
2077
+ export namespace Remove {
2078
+ export type ID = string;
2079
+ export type Result = StorecheckTemplateSchema;
2080
+ }
2081
+ }
2082
+
2083
+ export namespace ActivityStorecheck {
2084
+ interface Field {
2085
+ _id?: string;
2086
+ name: string;
2087
+ type: FieldType;
2088
+ isArray: boolean;
2089
+ isRequired?: boolean;
2090
+ is_calculated_field?: boolean;
2091
+ formula_key?: string;
2092
+ parent_field?: string;
2093
+ custom_list?: string;
2094
+ field_id: string;
2095
+ result: any[];
2096
+ result_custom_list_ids?: any[];
2097
+ calculation_status?: "success" | "failed";
2098
+ calculation_error?: string | any[];
2099
+ company_namespace?: string[];
2100
+ }
2101
+ export interface Division {
2102
+ fields: Field[];
2103
+ }
2104
+ interface Result {
2105
+ source_id: string;
2106
+ source_name: string;
2107
+ divisions: Division[];
2108
+ }
2109
+ interface Entry {
2110
+ entry_id: string;
2111
+ source:
2112
+ | "product"
2113
+ | "variant"
2114
+ | "product-category"
2115
+ | "product-sub-category"
2116
+ | "product-brand"
2117
+ | "product-group";
2118
+ results: Result[];
2119
+ }
2120
+ export interface ActivityStorecheckSchema {
2121
+ _id: string;
2122
+ company_namespace: string[];
2123
+ client: string;
2124
+ client_name: string;
2125
+ sync_id: string;
2126
+ time_zone: string;
2127
+ template_id: string;
2128
+ visit?: string;
2129
+ visit_id: string;
2130
+ battery_level?: number;
2131
+ user: string;
2132
+ user_name: string;
2133
+ time: number;
2134
+ geo_tag?: GeoTag;
2135
+ geoPoint: GeoPoint;
2136
+ teams?: string[];
2137
+ route?: string;
2138
+ tags?: string[];
2139
+ entries: Entry[];
2140
+ platform?: string;
2141
+ version_name?: string;
2142
+ device_brand?: string;
2143
+ device_os?: string;
2144
+ device_os_version?: string;
2145
+ device_model?: string;
2146
+ identifier?: number;
2147
+ device_id?: string;
2148
+ device_unique_id?: string;
2149
+ network_state?: number;
2150
+ serial_number?: SerialNumber;
2151
+ job_start_time?: number;
2152
+ job_end_time?: number;
2153
+ job_duration?: number;
2154
+ }
2155
+
2156
+ export interface CreateBody {
2157
+ company_namespace: string[];
2158
+ client: string;
2159
+ client_name: string;
2160
+ time_zone: string;
2161
+ template_id: string;
2162
+ visit?: string;
2163
+ visit_id: string;
2164
+ user: string;
2165
+ user_name: string;
2166
+ time: number;
2167
+ geo_tag?: GeoTag;
2168
+ geoPoint: GeoPoint;
2169
+ teams?: string[];
2170
+ route?: string;
2171
+ tags?: string[];
2172
+ entries: Entry[];
2173
+ }
2174
+ export interface UpdateBody {
2175
+ _id?: string;
2176
+ company_namespace?: string[];
2177
+ client?: string;
2178
+ client_name?: string;
2179
+ sync_id?: string;
2180
+ time_zone?: string;
2181
+ template_id?: string;
2182
+ visit?: string;
2183
+ visit_id?: string;
2184
+ battery_level?: number;
2185
+ user?: string;
2186
+ user_name?: string;
2187
+ time?: number;
2188
+ geo_tag?: GeoTag;
2189
+ geoPoint?: GeoPoint;
2190
+ teams?: string[];
2191
+ route?: string;
2192
+ tags?: string[];
2193
+ entries?: Entry[];
2194
+ platform?: string;
2195
+ version_name?: string;
2196
+ device_brand?: string;
2197
+ device_os?: string;
2198
+ device_os_version?: string;
2199
+ device_model?: string;
2200
+ identifier?: number;
2201
+ device_id?: string;
2202
+ device_unique_id?: string;
2203
+ network_state?: number;
2204
+ serial_number?: SerialNumber;
2205
+ job_start_time?: number;
2206
+ job_end_time?: number;
2207
+ job_duration?: number;
2208
+ }
2209
+ type PopulatedKeys =
2210
+ | "teams"
2211
+ | "tags"
2212
+ | "client"
2213
+ | "user"
2214
+ | "route"
2215
+ | "visit"
2216
+ | "template_id";
2217
+
2218
+ export type ActivityStoreCheckWithPopulatedKeysSchema = ActivityStorecheckSchema & {
2219
+ teams_populated: Team.TeamSchema[] | string[];
2220
+ tags_populated: Tag.TagSchema[] | string[];
2221
+ client_populated: Client.ClientSchema | string;
2222
+ user_populated: Rep.RepSchema | string;
2223
+ route_populated: Route.RouteSchema | string;
2224
+ visit_populated: Visit.VisitSchema | string;
2225
+ template_id_populated:
2226
+ | StorecheckTemplate.StorecheckTemplateSchema
2227
+ | string;
2228
+ };
2229
+
2230
+ export namespace Find {
2231
+ export type Params = DefaultPaginationQueryParams & {
2232
+ _id?: string[] | string;
2233
+ search?: string;
2234
+ name?: string[] | string;
2235
+ local_name?: string[] | string;
2236
+ disabled?: boolean;
2237
+ from_updatedAt?: number;
2238
+ from_time?: number;
2239
+ to_time?: number;
2240
+ client?: string;
2241
+ user?: string;
2242
+ tags?: string[];
2243
+ template_id?: string;
2244
+ teams?: string[];
2245
+ route?: string;
2246
+ populatedKeys?: PopulatedKeys[];
2247
+ [key: string]: any;
2248
+ };
2249
+ export interface Result extends DefaultPaginationResult {
2250
+ data: ActivityStoreCheckWithPopulatedKeysSchema[];
2251
+ }
2252
+ }
2253
+ export namespace Get {
2254
+ export type ID = string;
2255
+ export interface Params {}
2256
+ export type Result = ActivityStorecheckSchema;
2257
+ }
2258
+ export namespace Create {
2259
+ export type Body = CreateBody;
2260
+ export type Result = ActivityStorecheckSchema;
2261
+ }
2262
+ export namespace Update {
2263
+ export type ID = string;
2264
+ export type Body = UpdateBody;
2265
+ export type Result = ActivityStorecheckSchema;
2266
+ }
2267
+ }
2268
+
1887
2269
  export namespace Msl {
1888
2270
  export interface MslSchema {
1889
2271
  _id: string;