repzo 1.0.46 → 1.0.48
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 +36 -0
- package/lib/index.js +80 -0
- package/lib/types/index.d.ts +162 -10
- package/package.json +1 -1
- package/src/index.ts +97 -0
- package/src/types/index.ts +168 -10
package/lib/index.d.ts
CHANGED
|
@@ -342,6 +342,42 @@ export default class Repzo {
|
|
|
342
342
|
id: Service.Warehouse.Remove.ID
|
|
343
343
|
) => Promise<Service.Warehouse.Remove.Result>;
|
|
344
344
|
};
|
|
345
|
+
route: {
|
|
346
|
+
_path: string;
|
|
347
|
+
find: (
|
|
348
|
+
params?: Service.Route.Find.Params
|
|
349
|
+
) => Promise<Service.Route.Find.Result>;
|
|
350
|
+
get: (id: Service.Route.Get.ID) => Promise<Service.Route.Get.Result>;
|
|
351
|
+
create: (
|
|
352
|
+
body: Service.Route.Create.Body
|
|
353
|
+
) => Promise<Service.Route.Create.Result>;
|
|
354
|
+
update: (
|
|
355
|
+
id: Service.Route.Update.ID,
|
|
356
|
+
body: Service.Route.Update.Body
|
|
357
|
+
) => Promise<Service.Route.Update.Result>;
|
|
358
|
+
remove: (
|
|
359
|
+
id: Service.Route.Remove.ID
|
|
360
|
+
) => Promise<Service.Route.Remove.Result>;
|
|
361
|
+
};
|
|
362
|
+
productModifiersGroup: {
|
|
363
|
+
_path: string;
|
|
364
|
+
find: (
|
|
365
|
+
params?: Service.ProductModifiersGroup.Find.Params
|
|
366
|
+
) => Promise<Service.ProductModifiersGroup.Find.Result>;
|
|
367
|
+
get: (
|
|
368
|
+
id: Service.ProductModifiersGroup.Get.ID
|
|
369
|
+
) => Promise<Service.ProductModifiersGroup.Get.Result>;
|
|
370
|
+
create: (
|
|
371
|
+
body: Service.ProductModifiersGroup.Create.Body
|
|
372
|
+
) => Promise<Service.ProductModifiersGroup.Create.Result>;
|
|
373
|
+
update: (
|
|
374
|
+
id: Service.ProductModifiersGroup.Update.ID,
|
|
375
|
+
body: Service.ProductModifiersGroup.Update.Body
|
|
376
|
+
) => Promise<Service.ProductModifiersGroup.Update.Result>;
|
|
377
|
+
remove: (
|
|
378
|
+
id: Service.ProductModifiersGroup.Remove.ID
|
|
379
|
+
) => Promise<Service.ProductModifiersGroup.Remove.Result>;
|
|
380
|
+
};
|
|
345
381
|
channel: {
|
|
346
382
|
_path: string;
|
|
347
383
|
find: (
|
package/lib/index.js
CHANGED
|
@@ -693,6 +693,86 @@ export default class Repzo {
|
|
|
693
693
|
return res;
|
|
694
694
|
},
|
|
695
695
|
};
|
|
696
|
+
this.route = {
|
|
697
|
+
_path: "/route",
|
|
698
|
+
find: async (params) => {
|
|
699
|
+
let res = await this._fetch(
|
|
700
|
+
this.svAPIEndpoint,
|
|
701
|
+
this.route._path,
|
|
702
|
+
params
|
|
703
|
+
);
|
|
704
|
+
return res;
|
|
705
|
+
},
|
|
706
|
+
get: async (id) => {
|
|
707
|
+
return await this._fetch(
|
|
708
|
+
this.svAPIEndpoint,
|
|
709
|
+
this.route._path + `/${id}`
|
|
710
|
+
);
|
|
711
|
+
},
|
|
712
|
+
create: async (body) => {
|
|
713
|
+
let res = await this._create(
|
|
714
|
+
this.svAPIEndpoint,
|
|
715
|
+
this.route._path,
|
|
716
|
+
body
|
|
717
|
+
);
|
|
718
|
+
return res;
|
|
719
|
+
},
|
|
720
|
+
update: async (id, body) => {
|
|
721
|
+
let res = await this._update(
|
|
722
|
+
this.svAPIEndpoint,
|
|
723
|
+
this.route._path + `/${id}`,
|
|
724
|
+
body
|
|
725
|
+
);
|
|
726
|
+
return res;
|
|
727
|
+
},
|
|
728
|
+
remove: async (id) => {
|
|
729
|
+
let res = await this._delete(
|
|
730
|
+
this.svAPIEndpoint,
|
|
731
|
+
this.route._path + `/${id}`
|
|
732
|
+
);
|
|
733
|
+
return res;
|
|
734
|
+
},
|
|
735
|
+
};
|
|
736
|
+
this.productModifiersGroup = {
|
|
737
|
+
_path: "/product-modifiers-group",
|
|
738
|
+
find: async (params) => {
|
|
739
|
+
let res = await this._fetch(
|
|
740
|
+
this.svAPIEndpoint,
|
|
741
|
+
this.productModifiersGroup._path,
|
|
742
|
+
params
|
|
743
|
+
);
|
|
744
|
+
return res;
|
|
745
|
+
},
|
|
746
|
+
get: async (id) => {
|
|
747
|
+
return await this._fetch(
|
|
748
|
+
this.svAPIEndpoint,
|
|
749
|
+
this.productModifiersGroup._path + `/${id}`
|
|
750
|
+
);
|
|
751
|
+
},
|
|
752
|
+
create: async (body) => {
|
|
753
|
+
let res = await this._create(
|
|
754
|
+
this.svAPIEndpoint,
|
|
755
|
+
this.productModifiersGroup._path,
|
|
756
|
+
body
|
|
757
|
+
);
|
|
758
|
+
return res;
|
|
759
|
+
},
|
|
760
|
+
update: async (id, body) => {
|
|
761
|
+
let res = await this._update(
|
|
762
|
+
this.svAPIEndpoint,
|
|
763
|
+
this.productModifiersGroup._path + `/${id}`,
|
|
764
|
+
body
|
|
765
|
+
);
|
|
766
|
+
return res;
|
|
767
|
+
},
|
|
768
|
+
remove: async (id) => {
|
|
769
|
+
let res = await this._delete(
|
|
770
|
+
this.svAPIEndpoint,
|
|
771
|
+
this.productModifiersGroup._path + `/${id}`
|
|
772
|
+
);
|
|
773
|
+
return res;
|
|
774
|
+
},
|
|
775
|
+
};
|
|
696
776
|
this.channel = {
|
|
697
777
|
_path: "/client-channel",
|
|
698
778
|
find: async (params) => {
|
package/lib/types/index.d.ts
CHANGED
|
@@ -867,7 +867,13 @@ export declare namespace Service {
|
|
|
867
867
|
[key: string]: any;
|
|
868
868
|
};
|
|
869
869
|
}
|
|
870
|
-
type PopulatedKeys = "product";
|
|
870
|
+
type PopulatedKeys = "product" | "modifiers_groups";
|
|
871
|
+
type VariantWithPopulatedKeys = VariantSchema & {
|
|
872
|
+
modifiers_groups?:
|
|
873
|
+
| string[]
|
|
874
|
+
| ProductModifiersGroup.ProductModifiersGroupSchema[];
|
|
875
|
+
product?: string | Product.ProductSchema;
|
|
876
|
+
};
|
|
871
877
|
export namespace Find {
|
|
872
878
|
type Params = DefaultPaginationQueryParams & {
|
|
873
879
|
_id?: string[] | string;
|
|
@@ -882,6 +888,7 @@ export declare namespace Service {
|
|
|
882
888
|
position?: number[] | number;
|
|
883
889
|
createdAt?: number;
|
|
884
890
|
updatedAt?: number;
|
|
891
|
+
from_updatedAt?: number;
|
|
885
892
|
default?: boolean;
|
|
886
893
|
category?: string[] | string;
|
|
887
894
|
subCategory?: string[] | string;
|
|
@@ -889,10 +896,11 @@ export declare namespace Service {
|
|
|
889
896
|
productGroup?: string[] | string;
|
|
890
897
|
teams?: string[] | string;
|
|
891
898
|
withProduct?: boolean;
|
|
899
|
+
populatedKeys?: PopulatedKeys[];
|
|
892
900
|
[key: string]: any;
|
|
893
901
|
};
|
|
894
902
|
interface Result extends DefaultPaginationResult {
|
|
895
|
-
data:
|
|
903
|
+
data: VariantWithPopulatedKeys[];
|
|
896
904
|
}
|
|
897
905
|
}
|
|
898
906
|
export namespace Get {
|
|
@@ -2171,6 +2179,84 @@ export declare namespace Service {
|
|
|
2171
2179
|
}
|
|
2172
2180
|
export {};
|
|
2173
2181
|
}
|
|
2182
|
+
namespace Route {
|
|
2183
|
+
export interface RouteSchema {
|
|
2184
|
+
_id: string;
|
|
2185
|
+
name: string;
|
|
2186
|
+
disabled: boolean;
|
|
2187
|
+
sync_id: string;
|
|
2188
|
+
force_sequence: boolean;
|
|
2189
|
+
editor: AdminCreator;
|
|
2190
|
+
list: List[];
|
|
2191
|
+
company_namespace: string[];
|
|
2192
|
+
createdAt: string;
|
|
2193
|
+
updatedAt: string;
|
|
2194
|
+
}
|
|
2195
|
+
export interface RouteBody {
|
|
2196
|
+
name?: string;
|
|
2197
|
+
disabled?: boolean;
|
|
2198
|
+
sync_id?: string;
|
|
2199
|
+
force_sequence?: boolean;
|
|
2200
|
+
editor?: AdminCreator;
|
|
2201
|
+
list?: List[];
|
|
2202
|
+
company_namespace?: string[];
|
|
2203
|
+
}
|
|
2204
|
+
type PopulatedKeys = "client" | "list.client";
|
|
2205
|
+
interface List {
|
|
2206
|
+
client: string;
|
|
2207
|
+
from?: string;
|
|
2208
|
+
to?: string;
|
|
2209
|
+
}
|
|
2210
|
+
export type RouteWithPopulatedKeysSchema = RouteSchema & {
|
|
2211
|
+
"list.client"?:
|
|
2212
|
+
| string[]
|
|
2213
|
+
| {
|
|
2214
|
+
client: string | Pick<Client.ClientSchema, "name" | "lat" | "lng">;
|
|
2215
|
+
from?: string;
|
|
2216
|
+
to?: string;
|
|
2217
|
+
}[];
|
|
2218
|
+
};
|
|
2219
|
+
export namespace Find {
|
|
2220
|
+
type Params = DefaultPaginationQueryParams & {
|
|
2221
|
+
_id?: string[] | string;
|
|
2222
|
+
name?: string[] | string;
|
|
2223
|
+
disabled?: boolean;
|
|
2224
|
+
from_updatedAt?: number;
|
|
2225
|
+
populatedKeys?: PopulatedKeys[];
|
|
2226
|
+
};
|
|
2227
|
+
interface Result extends DefaultPaginationResult {
|
|
2228
|
+
data: RouteWithPopulatedKeysSchema[];
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
export namespace Get {
|
|
2232
|
+
type ID = string;
|
|
2233
|
+
type Result = RouteSchema;
|
|
2234
|
+
}
|
|
2235
|
+
export namespace Create {
|
|
2236
|
+
interface Body extends RouteBody {
|
|
2237
|
+
name: string;
|
|
2238
|
+
force_sequence: boolean;
|
|
2239
|
+
list: List[];
|
|
2240
|
+
sync_id: string;
|
|
2241
|
+
}
|
|
2242
|
+
type Result = RouteSchema;
|
|
2243
|
+
}
|
|
2244
|
+
export namespace Update {
|
|
2245
|
+
type ID = string;
|
|
2246
|
+
interface Body extends RouteBody {
|
|
2247
|
+
_id?: string;
|
|
2248
|
+
createdAt?: string;
|
|
2249
|
+
updatedAt?: string;
|
|
2250
|
+
__v?: number;
|
|
2251
|
+
}
|
|
2252
|
+
type Result = RouteSchema;
|
|
2253
|
+
}
|
|
2254
|
+
export namespace Remove {
|
|
2255
|
+
type ID = string;
|
|
2256
|
+
type Result = RouteSchema;
|
|
2257
|
+
}
|
|
2258
|
+
export {};
|
|
2259
|
+
}
|
|
2174
2260
|
namespace Warehouse {
|
|
2175
2261
|
type WarehouseType = "van" | "main" | "origin";
|
|
2176
2262
|
export interface WarehouseSchema {
|
|
@@ -2197,7 +2283,11 @@ export declare namespace Service {
|
|
|
2197
2283
|
};
|
|
2198
2284
|
company_namespace?: string[];
|
|
2199
2285
|
}
|
|
2200
|
-
type PopulatedKeys = "rep_id";
|
|
2286
|
+
type PopulatedKeys = "rep_id" | "teams";
|
|
2287
|
+
export type WarehouseWithPopulatedKeysSchema = WarehouseSchema & {
|
|
2288
|
+
rep_id?: string[] | Pick<Rep.RepSchema, "_id" | "name">[];
|
|
2289
|
+
teams_populated?: string[] | Team.TeamSchema[];
|
|
2290
|
+
};
|
|
2201
2291
|
export namespace Find {
|
|
2202
2292
|
type Params = DefaultPaginationQueryParams & {
|
|
2203
2293
|
_id?: string[] | string;
|
|
@@ -2211,9 +2301,7 @@ export declare namespace Service {
|
|
|
2211
2301
|
populatedKeys?: PopulatedKeys[];
|
|
2212
2302
|
};
|
|
2213
2303
|
interface Result extends DefaultPaginationResult {
|
|
2214
|
-
data:
|
|
2215
|
-
rep_id?: Pick<Rep.RepSchema, "_id" | "name">;
|
|
2216
|
-
})[];
|
|
2304
|
+
data: WarehouseWithPopulatedKeysSchema[];
|
|
2217
2305
|
}
|
|
2218
2306
|
}
|
|
2219
2307
|
export namespace Get {
|
|
@@ -2243,6 +2331,67 @@ export declare namespace Service {
|
|
|
2243
2331
|
}
|
|
2244
2332
|
export {};
|
|
2245
2333
|
}
|
|
2334
|
+
namespace ProductModifiersGroup {
|
|
2335
|
+
interface ProductModifiersGroupSchema {
|
|
2336
|
+
_id: string;
|
|
2337
|
+
name: string;
|
|
2338
|
+
disabled: boolean;
|
|
2339
|
+
local_name?: string;
|
|
2340
|
+
position: number;
|
|
2341
|
+
multiple_modifiers: boolean;
|
|
2342
|
+
company_namespace: string[];
|
|
2343
|
+
createdAt: string;
|
|
2344
|
+
updatedAt: string;
|
|
2345
|
+
__v: number;
|
|
2346
|
+
}
|
|
2347
|
+
interface ProductModifiersGroupBody {
|
|
2348
|
+
name?: string;
|
|
2349
|
+
disabled?: boolean;
|
|
2350
|
+
local_name?: string;
|
|
2351
|
+
position?: number;
|
|
2352
|
+
multiple_modifiers?: boolean;
|
|
2353
|
+
company_namespace?: string[];
|
|
2354
|
+
}
|
|
2355
|
+
namespace Find {
|
|
2356
|
+
type Params = DefaultPaginationQueryParams & {
|
|
2357
|
+
_id?: string[] | string;
|
|
2358
|
+
search?: string;
|
|
2359
|
+
name?: string[] | string;
|
|
2360
|
+
local_name?: string[] | string;
|
|
2361
|
+
disabled?: boolean;
|
|
2362
|
+
from_updatedAt?: number;
|
|
2363
|
+
};
|
|
2364
|
+
interface Result extends DefaultPaginationResult {
|
|
2365
|
+
data: ProductModifiersGroupSchema[];
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
namespace Get {
|
|
2369
|
+
type ID = string;
|
|
2370
|
+
type Result = ProductModifiersGroupSchema;
|
|
2371
|
+
}
|
|
2372
|
+
namespace Create {
|
|
2373
|
+
interface Body extends ProductModifiersGroupBody {
|
|
2374
|
+
name: string;
|
|
2375
|
+
position: number;
|
|
2376
|
+
multiple_modifiers: boolean;
|
|
2377
|
+
}
|
|
2378
|
+
type Result = ProductModifiersGroupSchema;
|
|
2379
|
+
}
|
|
2380
|
+
namespace Update {
|
|
2381
|
+
type ID = string;
|
|
2382
|
+
interface Body extends ProductModifiersGroupBody {
|
|
2383
|
+
_id?: string;
|
|
2384
|
+
createdAt?: string;
|
|
2385
|
+
updatedAt?: string;
|
|
2386
|
+
__v?: number;
|
|
2387
|
+
}
|
|
2388
|
+
type Result = ProductModifiersGroupSchema;
|
|
2389
|
+
}
|
|
2390
|
+
namespace Remove {
|
|
2391
|
+
type ID = string;
|
|
2392
|
+
type Result = ProductModifiersGroupSchema;
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2246
2395
|
namespace Channel {
|
|
2247
2396
|
interface ChannelSchema {
|
|
2248
2397
|
_id: string;
|
|
@@ -4014,7 +4163,7 @@ export declare namespace Service {
|
|
|
4014
4163
|
[key: string]: any;
|
|
4015
4164
|
}[];
|
|
4016
4165
|
visit_id?: string;
|
|
4017
|
-
teams?: string[];
|
|
4166
|
+
teams?: string[] | Team.TeamSchema[];
|
|
4018
4167
|
converter?: AdminCreator | RepCreator | ClientCreator;
|
|
4019
4168
|
converted_proforma_serial_number?: SerialNumber;
|
|
4020
4169
|
converted_proforma_return_serial_number?: SerialNumber;
|
|
@@ -4028,8 +4177,8 @@ export declare namespace Service {
|
|
|
4028
4177
|
is_void?: boolean;
|
|
4029
4178
|
due_date: string;
|
|
4030
4179
|
return_serial_number?: SerialNumber;
|
|
4031
|
-
origin_warehouse: string;
|
|
4032
|
-
route?: string;
|
|
4180
|
+
origin_warehouse: string | Warehouse.WarehouseSchema;
|
|
4181
|
+
route?: string | Route.RouteSchema;
|
|
4033
4182
|
paymentsData: {
|
|
4034
4183
|
_id: string;
|
|
4035
4184
|
invoice_value: number;
|
|
@@ -4120,7 +4269,10 @@ export declare namespace Service {
|
|
|
4120
4269
|
| "client"
|
|
4121
4270
|
| "tax_number"
|
|
4122
4271
|
| "custom_status"
|
|
4123
|
-
| "return_reason"
|
|
4272
|
+
| "return_reason"
|
|
4273
|
+
| "teams"
|
|
4274
|
+
| "warehouse"
|
|
4275
|
+
| "route";
|
|
4124
4276
|
type SortingKeys =
|
|
4125
4277
|
| "line_total"
|
|
4126
4278
|
| "product_name"
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1041,6 +1041,103 @@ export default class Repzo {
|
|
|
1041
1041
|
},
|
|
1042
1042
|
};
|
|
1043
1043
|
|
|
1044
|
+
route = {
|
|
1045
|
+
_path: "/route",
|
|
1046
|
+
find: async (
|
|
1047
|
+
params?: Service.Route.Find.Params
|
|
1048
|
+
): Promise<Service.Route.Find.Result> => {
|
|
1049
|
+
let res: Service.Route.Find.Result = await this._fetch(
|
|
1050
|
+
this.svAPIEndpoint,
|
|
1051
|
+
this.route._path,
|
|
1052
|
+
params
|
|
1053
|
+
);
|
|
1054
|
+
return res;
|
|
1055
|
+
},
|
|
1056
|
+
get: async (
|
|
1057
|
+
id: Service.Route.Get.ID
|
|
1058
|
+
): Promise<Service.Route.Get.Result> => {
|
|
1059
|
+
return await this._fetch(this.svAPIEndpoint, this.route._path + `/${id}`);
|
|
1060
|
+
},
|
|
1061
|
+
create: async (
|
|
1062
|
+
body: Service.Route.Create.Body
|
|
1063
|
+
): Promise<Service.Route.Create.Result> => {
|
|
1064
|
+
let res = await this._create(this.svAPIEndpoint, this.route._path, body);
|
|
1065
|
+
return res;
|
|
1066
|
+
},
|
|
1067
|
+
update: async (
|
|
1068
|
+
id: Service.Route.Update.ID,
|
|
1069
|
+
body: Service.Route.Update.Body
|
|
1070
|
+
): Promise<Service.Route.Update.Result> => {
|
|
1071
|
+
let res: Service.Route.Update.Result = await this._update(
|
|
1072
|
+
this.svAPIEndpoint,
|
|
1073
|
+
this.route._path + `/${id}`,
|
|
1074
|
+
body
|
|
1075
|
+
);
|
|
1076
|
+
return res;
|
|
1077
|
+
},
|
|
1078
|
+
remove: async (
|
|
1079
|
+
id: Service.Route.Remove.ID
|
|
1080
|
+
): Promise<Service.Route.Remove.Result> => {
|
|
1081
|
+
let res: Service.Route.Remove.Result = await this._delete(
|
|
1082
|
+
this.svAPIEndpoint,
|
|
1083
|
+
this.route._path + `/${id}`
|
|
1084
|
+
);
|
|
1085
|
+
return res;
|
|
1086
|
+
},
|
|
1087
|
+
};
|
|
1088
|
+
|
|
1089
|
+
productModifiersGroup = {
|
|
1090
|
+
_path: "/product-modifiers-group",
|
|
1091
|
+
find: async (
|
|
1092
|
+
params?: Service.ProductModifiersGroup.Find.Params
|
|
1093
|
+
): Promise<Service.ProductModifiersGroup.Find.Result> => {
|
|
1094
|
+
let res: Service.ProductModifiersGroup.Find.Result = await this._fetch(
|
|
1095
|
+
this.svAPIEndpoint,
|
|
1096
|
+
this.productModifiersGroup._path,
|
|
1097
|
+
params
|
|
1098
|
+
);
|
|
1099
|
+
return res;
|
|
1100
|
+
},
|
|
1101
|
+
get: async (
|
|
1102
|
+
id: Service.ProductModifiersGroup.Get.ID
|
|
1103
|
+
): Promise<Service.ProductModifiersGroup.Get.Result> => {
|
|
1104
|
+
return await this._fetch(
|
|
1105
|
+
this.svAPIEndpoint,
|
|
1106
|
+
this.productModifiersGroup._path + `/${id}`
|
|
1107
|
+
);
|
|
1108
|
+
},
|
|
1109
|
+
create: async (
|
|
1110
|
+
body: Service.ProductModifiersGroup.Create.Body
|
|
1111
|
+
): Promise<Service.ProductModifiersGroup.Create.Result> => {
|
|
1112
|
+
let res = await this._create(
|
|
1113
|
+
this.svAPIEndpoint,
|
|
1114
|
+
this.productModifiersGroup._path,
|
|
1115
|
+
body
|
|
1116
|
+
);
|
|
1117
|
+
return res;
|
|
1118
|
+
},
|
|
1119
|
+
update: async (
|
|
1120
|
+
id: Service.ProductModifiersGroup.Update.ID,
|
|
1121
|
+
body: Service.ProductModifiersGroup.Update.Body
|
|
1122
|
+
): Promise<Service.ProductModifiersGroup.Update.Result> => {
|
|
1123
|
+
let res: Service.ProductModifiersGroup.Update.Result = await this._update(
|
|
1124
|
+
this.svAPIEndpoint,
|
|
1125
|
+
this.productModifiersGroup._path + `/${id}`,
|
|
1126
|
+
body
|
|
1127
|
+
);
|
|
1128
|
+
return res;
|
|
1129
|
+
},
|
|
1130
|
+
remove: async (
|
|
1131
|
+
id: Service.ProductModifiersGroup.Remove.ID
|
|
1132
|
+
): Promise<Service.ProductModifiersGroup.Remove.Result> => {
|
|
1133
|
+
let res: Service.ProductModifiersGroup.Remove.Result = await this._delete(
|
|
1134
|
+
this.svAPIEndpoint,
|
|
1135
|
+
this.productModifiersGroup._path + `/${id}`
|
|
1136
|
+
);
|
|
1137
|
+
return res;
|
|
1138
|
+
},
|
|
1139
|
+
};
|
|
1140
|
+
|
|
1044
1141
|
channel = {
|
|
1045
1142
|
_path: "/client-channel",
|
|
1046
1143
|
find: async (
|
package/src/types/index.ts
CHANGED
|
@@ -868,8 +868,14 @@ export namespace Service {
|
|
|
868
868
|
modifiers_groups?: string[];
|
|
869
869
|
integration_meta?: { [key: string]: any };
|
|
870
870
|
}
|
|
871
|
-
type PopulatedKeys = "product";
|
|
871
|
+
type PopulatedKeys = "product" | "modifiers_groups";
|
|
872
872
|
|
|
873
|
+
type VariantWithPopulatedKeys = VariantSchema & {
|
|
874
|
+
modifiers_groups?:
|
|
875
|
+
| string[]
|
|
876
|
+
| ProductModifiersGroup.ProductModifiersGroupSchema[];
|
|
877
|
+
product?: string | Product.ProductSchema;
|
|
878
|
+
};
|
|
873
879
|
export namespace Find {
|
|
874
880
|
export type Params = DefaultPaginationQueryParams & {
|
|
875
881
|
_id?: string[] | string;
|
|
@@ -884,6 +890,7 @@ export namespace Service {
|
|
|
884
890
|
position?: number[] | number;
|
|
885
891
|
createdAt?: number;
|
|
886
892
|
updatedAt?: number;
|
|
893
|
+
from_updatedAt?: number;
|
|
887
894
|
default?: boolean;
|
|
888
895
|
category?: string[] | string;
|
|
889
896
|
subCategory?: string[] | string;
|
|
@@ -891,10 +898,11 @@ export namespace Service {
|
|
|
891
898
|
productGroup?: string[] | string;
|
|
892
899
|
teams?: string[] | string;
|
|
893
900
|
withProduct?: boolean;
|
|
901
|
+
populatedKeys?: PopulatedKeys[];
|
|
894
902
|
[key: string]: any; // integration_meta.
|
|
895
903
|
};
|
|
896
904
|
export interface Result extends DefaultPaginationResult {
|
|
897
|
-
data:
|
|
905
|
+
data: VariantWithPopulatedKeys[];
|
|
898
906
|
}
|
|
899
907
|
}
|
|
900
908
|
|
|
@@ -2208,6 +2216,87 @@ export namespace Service {
|
|
|
2208
2216
|
}
|
|
2209
2217
|
}
|
|
2210
2218
|
|
|
2219
|
+
export namespace Route {
|
|
2220
|
+
export interface RouteSchema {
|
|
2221
|
+
_id: string;
|
|
2222
|
+
name: string;
|
|
2223
|
+
disabled: boolean;
|
|
2224
|
+
sync_id: string;
|
|
2225
|
+
force_sequence: boolean;
|
|
2226
|
+
editor: AdminCreator;
|
|
2227
|
+
list: List[];
|
|
2228
|
+
company_namespace: string[];
|
|
2229
|
+
createdAt: string;
|
|
2230
|
+
updatedAt: string;
|
|
2231
|
+
}
|
|
2232
|
+
export interface RouteBody {
|
|
2233
|
+
name?: string;
|
|
2234
|
+
disabled?: boolean;
|
|
2235
|
+
sync_id?: string;
|
|
2236
|
+
force_sequence?: boolean;
|
|
2237
|
+
editor?: AdminCreator;
|
|
2238
|
+
list?: List[];
|
|
2239
|
+
company_namespace?: string[];
|
|
2240
|
+
}
|
|
2241
|
+
type PopulatedKeys = "client" | "list.client";
|
|
2242
|
+
interface List {
|
|
2243
|
+
client: string;
|
|
2244
|
+
from?: string;
|
|
2245
|
+
to?: string;
|
|
2246
|
+
}
|
|
2247
|
+
|
|
2248
|
+
export type RouteWithPopulatedKeysSchema = RouteSchema & {
|
|
2249
|
+
"list.client"?:
|
|
2250
|
+
| string[]
|
|
2251
|
+
| {
|
|
2252
|
+
client: string | Pick<Client.ClientSchema, "name" | "lat" | "lng">;
|
|
2253
|
+
from?: string;
|
|
2254
|
+
to?: string;
|
|
2255
|
+
}[];
|
|
2256
|
+
};
|
|
2257
|
+
export namespace Find {
|
|
2258
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
2259
|
+
_id?: string[] | string;
|
|
2260
|
+
name?: string[] | string;
|
|
2261
|
+
disabled?: boolean;
|
|
2262
|
+
from_updatedAt?: number;
|
|
2263
|
+
populatedKeys?: PopulatedKeys[];
|
|
2264
|
+
};
|
|
2265
|
+
export interface Result extends DefaultPaginationResult {
|
|
2266
|
+
data: RouteWithPopulatedKeysSchema[];
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
export namespace Get {
|
|
2270
|
+
export type ID = string;
|
|
2271
|
+
export type Result = RouteSchema;
|
|
2272
|
+
}
|
|
2273
|
+
|
|
2274
|
+
export namespace Create {
|
|
2275
|
+
export interface Body extends RouteBody {
|
|
2276
|
+
name: string;
|
|
2277
|
+
force_sequence: boolean;
|
|
2278
|
+
list: List[];
|
|
2279
|
+
sync_id: string;
|
|
2280
|
+
}
|
|
2281
|
+
export type Result = RouteSchema;
|
|
2282
|
+
}
|
|
2283
|
+
|
|
2284
|
+
export namespace Update {
|
|
2285
|
+
export type ID = string;
|
|
2286
|
+
export interface Body extends RouteBody {
|
|
2287
|
+
_id?: string;
|
|
2288
|
+
createdAt?: string;
|
|
2289
|
+
updatedAt?: string;
|
|
2290
|
+
__v?: number;
|
|
2291
|
+
}
|
|
2292
|
+
export type Result = RouteSchema;
|
|
2293
|
+
}
|
|
2294
|
+
export namespace Remove {
|
|
2295
|
+
export type ID = string;
|
|
2296
|
+
export type Result = RouteSchema;
|
|
2297
|
+
}
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2211
2300
|
export namespace Warehouse {
|
|
2212
2301
|
type WarehouseType = "van" | "main" | "origin";
|
|
2213
2302
|
export interface WarehouseSchema {
|
|
@@ -2230,7 +2319,12 @@ export namespace Service {
|
|
|
2230
2319
|
integration_meta?: { [key: string]: any };
|
|
2231
2320
|
company_namespace?: string[];
|
|
2232
2321
|
}
|
|
2233
|
-
type PopulatedKeys = "rep_id";
|
|
2322
|
+
type PopulatedKeys = "rep_id" | "teams";
|
|
2323
|
+
|
|
2324
|
+
export type WarehouseWithPopulatedKeysSchema = WarehouseSchema & {
|
|
2325
|
+
rep_id?: string[] | Pick<Rep.RepSchema, "_id" | "name">[];
|
|
2326
|
+
teams_populated?: string[] | Team.TeamSchema[];
|
|
2327
|
+
};
|
|
2234
2328
|
export namespace Find {
|
|
2235
2329
|
export type Params = DefaultPaginationQueryParams & {
|
|
2236
2330
|
_id?: string[] | string;
|
|
@@ -2244,9 +2338,7 @@ export namespace Service {
|
|
|
2244
2338
|
populatedKeys?: PopulatedKeys[];
|
|
2245
2339
|
};
|
|
2246
2340
|
export interface Result extends DefaultPaginationResult {
|
|
2247
|
-
data:
|
|
2248
|
-
rep_id?: Pick<Rep.RepSchema, "_id" | "name">;
|
|
2249
|
-
})[];
|
|
2341
|
+
data: WarehouseWithPopulatedKeysSchema[];
|
|
2250
2342
|
}
|
|
2251
2343
|
}
|
|
2252
2344
|
|
|
@@ -2280,6 +2372,69 @@ export namespace Service {
|
|
|
2280
2372
|
}
|
|
2281
2373
|
}
|
|
2282
2374
|
|
|
2375
|
+
export namespace ProductModifiersGroup {
|
|
2376
|
+
export interface ProductModifiersGroupSchema {
|
|
2377
|
+
_id: string;
|
|
2378
|
+
name: string;
|
|
2379
|
+
disabled: boolean;
|
|
2380
|
+
local_name?: string;
|
|
2381
|
+
position: number;
|
|
2382
|
+
multiple_modifiers: boolean;
|
|
2383
|
+
company_namespace: string[];
|
|
2384
|
+
createdAt: string;
|
|
2385
|
+
updatedAt: string;
|
|
2386
|
+
__v: number;
|
|
2387
|
+
}
|
|
2388
|
+
export interface ProductModifiersGroupBody {
|
|
2389
|
+
name?: string;
|
|
2390
|
+
disabled?: boolean;
|
|
2391
|
+
local_name?: string;
|
|
2392
|
+
position?: number;
|
|
2393
|
+
multiple_modifiers?: boolean;
|
|
2394
|
+
company_namespace?: string[];
|
|
2395
|
+
}
|
|
2396
|
+
export namespace Find {
|
|
2397
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
2398
|
+
_id?: string[] | string;
|
|
2399
|
+
search?: string;
|
|
2400
|
+
name?: string[] | string;
|
|
2401
|
+
local_name?: string[] | string;
|
|
2402
|
+
disabled?: boolean;
|
|
2403
|
+
from_updatedAt?: number;
|
|
2404
|
+
};
|
|
2405
|
+
export interface Result extends DefaultPaginationResult {
|
|
2406
|
+
data: ProductModifiersGroupSchema[];
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
export namespace Get {
|
|
2410
|
+
export type ID = string;
|
|
2411
|
+
export type Result = ProductModifiersGroupSchema;
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2414
|
+
export namespace Create {
|
|
2415
|
+
export interface Body extends ProductModifiersGroupBody {
|
|
2416
|
+
name: string;
|
|
2417
|
+
position: number;
|
|
2418
|
+
multiple_modifiers: boolean;
|
|
2419
|
+
}
|
|
2420
|
+
export type Result = ProductModifiersGroupSchema;
|
|
2421
|
+
}
|
|
2422
|
+
export namespace Update {
|
|
2423
|
+
export type ID = string;
|
|
2424
|
+
export interface Body extends ProductModifiersGroupBody {
|
|
2425
|
+
_id?: string;
|
|
2426
|
+
createdAt?: string;
|
|
2427
|
+
updatedAt?: string;
|
|
2428
|
+
__v?: number;
|
|
2429
|
+
}
|
|
2430
|
+
export type Result = ProductModifiersGroupSchema;
|
|
2431
|
+
}
|
|
2432
|
+
export namespace Remove {
|
|
2433
|
+
export type ID = string;
|
|
2434
|
+
export type Result = ProductModifiersGroupSchema;
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
|
|
2283
2438
|
export namespace Channel {
|
|
2284
2439
|
export interface ChannelSchema {
|
|
2285
2440
|
_id: string;
|
|
@@ -4062,7 +4217,7 @@ export namespace Service {
|
|
|
4062
4217
|
promotions: Promotion.Schema[];
|
|
4063
4218
|
priceLists: { [key: string]: any }[];
|
|
4064
4219
|
visit_id?: string;
|
|
4065
|
-
teams?: string[];
|
|
4220
|
+
teams?: string[] | Team.TeamSchema[];
|
|
4066
4221
|
converter?: AdminCreator | RepCreator | ClientCreator;
|
|
4067
4222
|
converted_proforma_serial_number?: SerialNumber;
|
|
4068
4223
|
converted_proforma_return_serial_number?: SerialNumber;
|
|
@@ -4076,8 +4231,8 @@ export namespace Service {
|
|
|
4076
4231
|
is_void?: boolean;
|
|
4077
4232
|
due_date: string;
|
|
4078
4233
|
return_serial_number?: SerialNumber;
|
|
4079
|
-
origin_warehouse: string;
|
|
4080
|
-
route?: string;
|
|
4234
|
+
origin_warehouse: string | Warehouse.WarehouseSchema;
|
|
4235
|
+
route?: string | Route.RouteSchema;
|
|
4081
4236
|
paymentsData: {
|
|
4082
4237
|
_id: string;
|
|
4083
4238
|
invoice_value: number;
|
|
@@ -4165,7 +4320,10 @@ export namespace Service {
|
|
|
4165
4320
|
| "client"
|
|
4166
4321
|
| "tax_number"
|
|
4167
4322
|
| "custom_status"
|
|
4168
|
-
| "return_reason"
|
|
4323
|
+
| "return_reason"
|
|
4324
|
+
| "teams"
|
|
4325
|
+
| "warehouse"
|
|
4326
|
+
| "route";
|
|
4169
4327
|
type SortingKeys =
|
|
4170
4328
|
| "line_total"
|
|
4171
4329
|
| "product_name"
|