repzo 1.0.122 → 1.0.124
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/changelog.md +1 -0
- package/lib/index.d.ts +21 -0
- package/lib/index.js +42 -0
- package/lib/types/index.d.ts +205 -3
- package/package.json +1 -1
- package/src/index.ts +55 -0
- package/src/types/index.ts +172 -4
package/changelog.md
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -93,6 +93,7 @@ export default class Repzo {
|
|
|
93
93
|
readonly ASSET: "asset";
|
|
94
94
|
readonly ASSET_UNIT: "asset-unit";
|
|
95
95
|
readonly WORKORDER_PORTAL: "workorder-portal";
|
|
96
|
+
readonly APPROVAL: "approvals";
|
|
96
97
|
};
|
|
97
98
|
private _fetch;
|
|
98
99
|
private _create;
|
|
@@ -1475,4 +1476,24 @@ export default class Repzo {
|
|
|
1475
1476
|
id: Service.WorkorderPortal.Update.ID
|
|
1476
1477
|
) => Promise<Service.WorkorderPortal.Remove.Result>;
|
|
1477
1478
|
};
|
|
1479
|
+
approval: {
|
|
1480
|
+
_path: "approvals";
|
|
1481
|
+
find: (
|
|
1482
|
+
params?: Service.Approval.Find.Params
|
|
1483
|
+
) => Promise<Service.Approval.Find.Result>;
|
|
1484
|
+
get: (
|
|
1485
|
+
id: Service.Approval.Get.ID,
|
|
1486
|
+
params?: Service.Approval.Get.Params
|
|
1487
|
+
) => Promise<Service.Approval.Get.Result>;
|
|
1488
|
+
create: (
|
|
1489
|
+
body: Service.Approval.Create.Body
|
|
1490
|
+
) => Promise<Service.Approval.Create.Result>;
|
|
1491
|
+
update: (
|
|
1492
|
+
id: Service.Approval.Update.ID,
|
|
1493
|
+
body: Service.Approval.Update.Body
|
|
1494
|
+
) => Promise<Service.Approval.Update.Result>;
|
|
1495
|
+
remove: (
|
|
1496
|
+
id: Service.Approval.Remove.ID
|
|
1497
|
+
) => Promise<Service.Approval.Remove.Result>;
|
|
1498
|
+
};
|
|
1478
1499
|
}
|
package/lib/index.js
CHANGED
|
@@ -82,6 +82,7 @@ export default class Repzo {
|
|
|
82
82
|
ASSET: "asset",
|
|
83
83
|
ASSET_UNIT: "asset-unit",
|
|
84
84
|
WORKORDER_PORTAL: "workorder-portal",
|
|
85
|
+
APPROVAL: "approvals",
|
|
85
86
|
};
|
|
86
87
|
this.END_POINTS = this._end_points;
|
|
87
88
|
this.client = {
|
|
@@ -2734,6 +2735,47 @@ export default class Repzo {
|
|
|
2734
2735
|
return res;
|
|
2735
2736
|
},
|
|
2736
2737
|
};
|
|
2738
|
+
this.approval = {
|
|
2739
|
+
_path: this._end_points.APPROVAL,
|
|
2740
|
+
find: async (params) => {
|
|
2741
|
+
let res = await this._fetch(
|
|
2742
|
+
this.svAPIEndpoint,
|
|
2743
|
+
this.approval._path,
|
|
2744
|
+
params
|
|
2745
|
+
);
|
|
2746
|
+
return res;
|
|
2747
|
+
},
|
|
2748
|
+
get: async (id, params) => {
|
|
2749
|
+
return await this._fetch(
|
|
2750
|
+
this.svAPIEndpoint,
|
|
2751
|
+
this.approval._path + `/${id}`,
|
|
2752
|
+
params
|
|
2753
|
+
);
|
|
2754
|
+
},
|
|
2755
|
+
create: async (body) => {
|
|
2756
|
+
let res = await this._create(
|
|
2757
|
+
this.svAPIEndpoint,
|
|
2758
|
+
this.approval._path,
|
|
2759
|
+
body
|
|
2760
|
+
);
|
|
2761
|
+
return res;
|
|
2762
|
+
},
|
|
2763
|
+
update: async (id, body) => {
|
|
2764
|
+
let res = await this._update(
|
|
2765
|
+
this.svAPIEndpoint,
|
|
2766
|
+
this.approval._path + `/${id}`,
|
|
2767
|
+
body
|
|
2768
|
+
);
|
|
2769
|
+
return res;
|
|
2770
|
+
},
|
|
2771
|
+
remove: async (id) => {
|
|
2772
|
+
let res = await this._delete(
|
|
2773
|
+
this.svAPIEndpoint,
|
|
2774
|
+
this.approval._path + `/${id}`
|
|
2775
|
+
);
|
|
2776
|
+
return res;
|
|
2777
|
+
},
|
|
2778
|
+
};
|
|
2737
2779
|
this.svAPIEndpoint =
|
|
2738
2780
|
!options?.env || options?.env == "production"
|
|
2739
2781
|
? "https://sv.api.repzo.me"
|
package/lib/types/index.d.ts
CHANGED
|
@@ -115,6 +115,10 @@ interface FormPopulated {
|
|
|
115
115
|
_id: StringId;
|
|
116
116
|
local_name?: string;
|
|
117
117
|
}
|
|
118
|
+
interface RetailExecutionTemplatePopulated {
|
|
119
|
+
_id: StringId;
|
|
120
|
+
name: string;
|
|
121
|
+
}
|
|
118
122
|
interface VisitMeta {
|
|
119
123
|
geo_fence_setting_visit_start: boolean;
|
|
120
124
|
geo_fence_setting_visit_end: boolean;
|
|
@@ -514,6 +518,8 @@ export declare namespace Service {
|
|
|
514
518
|
enable_payment_terms_grace_period_days?: boolean;
|
|
515
519
|
is_simplified?: boolean;
|
|
516
520
|
last_login_time?: number;
|
|
521
|
+
assigned_forms_v2_templates?: string[];
|
|
522
|
+
retail_execution_templates?: string[];
|
|
517
523
|
createdAt: string;
|
|
518
524
|
updatedAt: string;
|
|
519
525
|
__v: number;
|
|
@@ -585,6 +591,8 @@ export declare namespace Service {
|
|
|
585
591
|
enable_payment_terms_grace_period_days?: boolean;
|
|
586
592
|
is_simplified?: boolean;
|
|
587
593
|
last_login_time?: number;
|
|
594
|
+
assigned_forms_v2_templates?: string[];
|
|
595
|
+
retail_execution_templates?: string[];
|
|
588
596
|
}
|
|
589
597
|
export type PopulatedKeys =
|
|
590
598
|
| "tags"
|
|
@@ -601,7 +609,9 @@ export declare namespace Service {
|
|
|
601
609
|
| "assigned_product_groups"
|
|
602
610
|
| "speciality"
|
|
603
611
|
| "teams"
|
|
604
|
-
| "contacts"
|
|
612
|
+
| "contacts"
|
|
613
|
+
| "retail_execution_templates"
|
|
614
|
+
| "assigned_forms_v2_templates";
|
|
605
615
|
type ClientSchemaWithPopulatedKeys = ClientSchema & {
|
|
606
616
|
assigned_products?:
|
|
607
617
|
| string[]
|
|
@@ -621,6 +631,10 @@ export declare namespace Service {
|
|
|
621
631
|
| string
|
|
622
632
|
| Pick<Client.ClientSchema, "_id" | "name" | "client_code">;
|
|
623
633
|
channel?: string | Channel.ChannelSchema;
|
|
634
|
+
assigned_forms_v2_templates?: string[] | FormPopulated[];
|
|
635
|
+
retail_execution_templates?:
|
|
636
|
+
| string[]
|
|
637
|
+
| RetailExecutionTemplatePopulated[];
|
|
624
638
|
};
|
|
625
639
|
export namespace Find {
|
|
626
640
|
type Params = DefaultPaginationQueryParams & {
|
|
@@ -8107,6 +8121,184 @@ export declare namespace Service {
|
|
|
8107
8121
|
type Result = SupplierSchema;
|
|
8108
8122
|
}
|
|
8109
8123
|
}
|
|
8124
|
+
namespace Approval {
|
|
8125
|
+
interface Data {
|
|
8126
|
+
_id: StringId;
|
|
8127
|
+
creator: AdminCreator;
|
|
8128
|
+
name: string;
|
|
8129
|
+
disabled: boolean;
|
|
8130
|
+
company_namespace: string[];
|
|
8131
|
+
type:
|
|
8132
|
+
| "proforma"
|
|
8133
|
+
| "transfer"
|
|
8134
|
+
| "approval-request"
|
|
8135
|
+
| "receiving-material"
|
|
8136
|
+
| "asset-part-transfer"
|
|
8137
|
+
| "adjust-inventory"
|
|
8138
|
+
| "return-asset-part-unit"
|
|
8139
|
+
| "store-asset-part-unit";
|
|
8140
|
+
position?: number;
|
|
8141
|
+
description?: string;
|
|
8142
|
+
rules: {
|
|
8143
|
+
index: number;
|
|
8144
|
+
name: string;
|
|
8145
|
+
permissions: {
|
|
8146
|
+
can_edit: boolean;
|
|
8147
|
+
};
|
|
8148
|
+
admins: {
|
|
8149
|
+
_id: StringId;
|
|
8150
|
+
name?: string;
|
|
8151
|
+
type: "admin";
|
|
8152
|
+
}[];
|
|
8153
|
+
reps: {
|
|
8154
|
+
_id: StringId;
|
|
8155
|
+
name?: string;
|
|
8156
|
+
type: "rep";
|
|
8157
|
+
}[];
|
|
8158
|
+
append_creator?: boolean;
|
|
8159
|
+
append_assigned_origin_warehouse_rep?: boolean;
|
|
8160
|
+
append_assigned_destination_warehouse_rep?: boolean;
|
|
8161
|
+
send_email?: boolean;
|
|
8162
|
+
}[];
|
|
8163
|
+
filters?: {
|
|
8164
|
+
key: string;
|
|
8165
|
+
operator: "eq" | "ne" | "in" | "nin" | "gt" | "gte" | "lt" | "lte";
|
|
8166
|
+
value: any[];
|
|
8167
|
+
manipulator_function?: string;
|
|
8168
|
+
}[];
|
|
8169
|
+
createdAt: Date;
|
|
8170
|
+
updatedAt: Date;
|
|
8171
|
+
__v: number;
|
|
8172
|
+
}
|
|
8173
|
+
interface CreateBody {
|
|
8174
|
+
name: string;
|
|
8175
|
+
type:
|
|
8176
|
+
| "proforma"
|
|
8177
|
+
| "transfer"
|
|
8178
|
+
| "approval-request"
|
|
8179
|
+
| "receiving-material"
|
|
8180
|
+
| "asset-part-transfer"
|
|
8181
|
+
| "adjust-inventory"
|
|
8182
|
+
| "return-asset-part-unit"
|
|
8183
|
+
| "store-asset-part-unit";
|
|
8184
|
+
creator?: AdminCreator;
|
|
8185
|
+
disabled?: boolean;
|
|
8186
|
+
company_namespace?: string[];
|
|
8187
|
+
position?: number;
|
|
8188
|
+
description?: string;
|
|
8189
|
+
rules: {
|
|
8190
|
+
index: number;
|
|
8191
|
+
name: string;
|
|
8192
|
+
permissions?: {
|
|
8193
|
+
can_edit: boolean;
|
|
8194
|
+
};
|
|
8195
|
+
admins?: {
|
|
8196
|
+
_id: StringId;
|
|
8197
|
+
name?: string;
|
|
8198
|
+
type: "admin";
|
|
8199
|
+
}[];
|
|
8200
|
+
reps?: {
|
|
8201
|
+
_id: StringId;
|
|
8202
|
+
name?: string;
|
|
8203
|
+
type: "rep";
|
|
8204
|
+
}[];
|
|
8205
|
+
append_creator?: boolean;
|
|
8206
|
+
append_assigned_origin_warehouse_rep?: boolean;
|
|
8207
|
+
append_assigned_destination_warehouse_rep?: boolean;
|
|
8208
|
+
send_email?: boolean;
|
|
8209
|
+
}[];
|
|
8210
|
+
filters?: {
|
|
8211
|
+
key: string;
|
|
8212
|
+
operator: "eq" | "ne" | "in" | "nin" | "gt" | "gte" | "lt" | "lte";
|
|
8213
|
+
value: any[];
|
|
8214
|
+
manipulator_function?: string;
|
|
8215
|
+
}[];
|
|
8216
|
+
}
|
|
8217
|
+
interface UpdateBody {
|
|
8218
|
+
_id?: StringId;
|
|
8219
|
+
creator?: AdminCreator;
|
|
8220
|
+
name?: string;
|
|
8221
|
+
disabled?: boolean;
|
|
8222
|
+
company_namespace?: string[];
|
|
8223
|
+
type?:
|
|
8224
|
+
| "proforma"
|
|
8225
|
+
| "transfer"
|
|
8226
|
+
| "approval-request"
|
|
8227
|
+
| "receiving-material"
|
|
8228
|
+
| "asset-part-transfer"
|
|
8229
|
+
| "adjust-inventory"
|
|
8230
|
+
| "return-asset-part-unit"
|
|
8231
|
+
| "store-asset-part-unit";
|
|
8232
|
+
position?: number;
|
|
8233
|
+
description?: string;
|
|
8234
|
+
rules?: {
|
|
8235
|
+
index: number;
|
|
8236
|
+
name: string;
|
|
8237
|
+
permissions?: {
|
|
8238
|
+
can_edit: boolean;
|
|
8239
|
+
};
|
|
8240
|
+
admins?: {
|
|
8241
|
+
_id: StringId;
|
|
8242
|
+
name?: string;
|
|
8243
|
+
type: "admin";
|
|
8244
|
+
}[];
|
|
8245
|
+
reps?: {
|
|
8246
|
+
_id: StringId;
|
|
8247
|
+
name?: string;
|
|
8248
|
+
type: "rep";
|
|
8249
|
+
}[];
|
|
8250
|
+
append_creator?: boolean;
|
|
8251
|
+
append_assigned_origin_warehouse_rep?: boolean;
|
|
8252
|
+
append_assigned_destination_warehouse_rep?: boolean;
|
|
8253
|
+
send_email?: boolean;
|
|
8254
|
+
}[];
|
|
8255
|
+
filters?: {
|
|
8256
|
+
key: string;
|
|
8257
|
+
operator: "eq" | "ne" | "in" | "nin" | "gt" | "gte" | "lt" | "lte";
|
|
8258
|
+
value: any[];
|
|
8259
|
+
manipulator_function?: string;
|
|
8260
|
+
}[];
|
|
8261
|
+
createdAt?: Date;
|
|
8262
|
+
updatedAt?: Date;
|
|
8263
|
+
__v?: number;
|
|
8264
|
+
}
|
|
8265
|
+
namespace Find {
|
|
8266
|
+
type Params = DefaultPaginationQueryParams & {
|
|
8267
|
+
_id?: StringId[] | StringId;
|
|
8268
|
+
search?: string;
|
|
8269
|
+
name?: string[] | string;
|
|
8270
|
+
disabled?: boolean;
|
|
8271
|
+
sortBy?: {
|
|
8272
|
+
field: "_id" | "position" | "updatedAt";
|
|
8273
|
+
type: "asc" | "desc";
|
|
8274
|
+
}[];
|
|
8275
|
+
[key: string]: any;
|
|
8276
|
+
};
|
|
8277
|
+
interface Result extends DefaultPaginationResult {
|
|
8278
|
+
data: Data[];
|
|
8279
|
+
}
|
|
8280
|
+
}
|
|
8281
|
+
namespace Get {
|
|
8282
|
+
type ID = string;
|
|
8283
|
+
type Params = {
|
|
8284
|
+
[key: string]: any;
|
|
8285
|
+
};
|
|
8286
|
+
type Result = Data;
|
|
8287
|
+
}
|
|
8288
|
+
namespace Create {
|
|
8289
|
+
type Body = CreateBody;
|
|
8290
|
+
type Result = Data;
|
|
8291
|
+
}
|
|
8292
|
+
namespace Update {
|
|
8293
|
+
type ID = string;
|
|
8294
|
+
type Body = UpdateBody;
|
|
8295
|
+
type Result = Data;
|
|
8296
|
+
}
|
|
8297
|
+
namespace Remove {
|
|
8298
|
+
type ID = string;
|
|
8299
|
+
type Result = Data;
|
|
8300
|
+
}
|
|
8301
|
+
}
|
|
8110
8302
|
namespace Cycle {
|
|
8111
8303
|
type CycleStatus = "pending" | "approved" | "processing" | "rejected";
|
|
8112
8304
|
export interface Schema {
|
|
@@ -12915,6 +13107,11 @@ export declare namespace Service {
|
|
|
12915
13107
|
createdAt: Date;
|
|
12916
13108
|
updatedAt: Date;
|
|
12917
13109
|
}
|
|
13110
|
+
export type PopulatedDoc = Data & {
|
|
13111
|
+
cycle?: Cycle.Schema & {
|
|
13112
|
+
approval?: string | Approval.Data;
|
|
13113
|
+
};
|
|
13114
|
+
};
|
|
12918
13115
|
export interface CreateBody {
|
|
12919
13116
|
document_id?: StringId;
|
|
12920
13117
|
document_type: "client" | "visit";
|
|
@@ -13119,10 +13316,12 @@ export declare namespace Service {
|
|
|
13119
13316
|
field: "_id";
|
|
13120
13317
|
type: "asc" | "desc";
|
|
13121
13318
|
}[];
|
|
13319
|
+
withCycle?: boolean;
|
|
13320
|
+
populatedKeys?: ["approval"];
|
|
13122
13321
|
[key: string]: any;
|
|
13123
13322
|
};
|
|
13124
13323
|
interface Result extends DefaultPaginationResult {
|
|
13125
|
-
data: Data[];
|
|
13324
|
+
data: Data[] | PopulatedDoc[];
|
|
13126
13325
|
}
|
|
13127
13326
|
}
|
|
13128
13327
|
export namespace Get {
|
|
@@ -13132,10 +13331,13 @@ export declare namespace Service {
|
|
|
13132
13331
|
validityCheck?: boolean;
|
|
13133
13332
|
originalDoc_populatedKeys?: PopulatedKeys[];
|
|
13134
13333
|
withOriginalDoc?: boolean;
|
|
13334
|
+
populatedKeys?: ["approval"];
|
|
13135
13335
|
[key: string]: any;
|
|
13136
13336
|
};
|
|
13137
13337
|
type Result = Data & {
|
|
13138
|
-
cycle?: Cycle.Schema
|
|
13338
|
+
cycle?: Cycle.Schema & {
|
|
13339
|
+
approval?: string | Approval.Data;
|
|
13340
|
+
};
|
|
13139
13341
|
original_doc?: Client.ClientSchema | Visit.VisitSchema;
|
|
13140
13342
|
};
|
|
13141
13343
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -117,6 +117,7 @@ export default class Repzo {
|
|
|
117
117
|
ASSET: "asset",
|
|
118
118
|
ASSET_UNIT: "asset-unit",
|
|
119
119
|
WORKORDER_PORTAL: "workorder-portal",
|
|
120
|
+
APPROVAL: "approvals",
|
|
120
121
|
} as const;
|
|
121
122
|
public END_POINTS = this._end_points;
|
|
122
123
|
private async _fetch(baseUrl: string, path: string, params?: Params) {
|
|
@@ -4147,6 +4148,60 @@ export default class Repzo {
|
|
|
4147
4148
|
return res;
|
|
4148
4149
|
},
|
|
4149
4150
|
};
|
|
4151
|
+
|
|
4152
|
+
approval = {
|
|
4153
|
+
_path: this._end_points.APPROVAL,
|
|
4154
|
+
find: async (
|
|
4155
|
+
params?: Service.Approval.Find.Params
|
|
4156
|
+
): Promise<Service.Approval.Find.Result> => {
|
|
4157
|
+
let res: Service.Approval.Find.Result = await this._fetch(
|
|
4158
|
+
this.svAPIEndpoint,
|
|
4159
|
+
this.approval._path,
|
|
4160
|
+
params
|
|
4161
|
+
);
|
|
4162
|
+
return res;
|
|
4163
|
+
},
|
|
4164
|
+
get: async (
|
|
4165
|
+
id: Service.Approval.Get.ID,
|
|
4166
|
+
params?: Service.Approval.Get.Params
|
|
4167
|
+
): Promise<Service.Approval.Get.Result> => {
|
|
4168
|
+
return await this._fetch(
|
|
4169
|
+
this.svAPIEndpoint,
|
|
4170
|
+
this.approval._path + `/${id}`,
|
|
4171
|
+
params
|
|
4172
|
+
);
|
|
4173
|
+
},
|
|
4174
|
+
create: async (
|
|
4175
|
+
body: Service.Approval.Create.Body
|
|
4176
|
+
): Promise<Service.Approval.Create.Result> => {
|
|
4177
|
+
let res = await this._create(
|
|
4178
|
+
this.svAPIEndpoint,
|
|
4179
|
+
this.approval._path,
|
|
4180
|
+
body
|
|
4181
|
+
);
|
|
4182
|
+
return res;
|
|
4183
|
+
},
|
|
4184
|
+
update: async (
|
|
4185
|
+
id: Service.Approval.Update.ID,
|
|
4186
|
+
body: Service.Approval.Update.Body
|
|
4187
|
+
): Promise<Service.Approval.Update.Result> => {
|
|
4188
|
+
let res: Service.Approval.Update.Result = await this._update(
|
|
4189
|
+
this.svAPIEndpoint,
|
|
4190
|
+
this.approval._path + `/${id}`,
|
|
4191
|
+
body
|
|
4192
|
+
);
|
|
4193
|
+
return res;
|
|
4194
|
+
},
|
|
4195
|
+
remove: async (
|
|
4196
|
+
id: Service.Approval.Remove.ID
|
|
4197
|
+
): Promise<Service.Approval.Remove.Result> => {
|
|
4198
|
+
let res: Service.Approval.Remove.Result = await this._delete(
|
|
4199
|
+
this.svAPIEndpoint,
|
|
4200
|
+
this.approval._path + `/${id}`
|
|
4201
|
+
);
|
|
4202
|
+
return res;
|
|
4203
|
+
},
|
|
4204
|
+
};
|
|
4150
4205
|
}
|
|
4151
4206
|
|
|
4152
4207
|
function normalizeParams(params: Params): { [key: string]: any } {
|
package/src/types/index.ts
CHANGED
|
@@ -118,6 +118,10 @@ interface FormPopulated {
|
|
|
118
118
|
_id: StringId;
|
|
119
119
|
local_name?: string;
|
|
120
120
|
}
|
|
121
|
+
interface RetailExecutionTemplatePopulated {
|
|
122
|
+
_id: StringId;
|
|
123
|
+
name: string;
|
|
124
|
+
}
|
|
121
125
|
interface VisitMeta {
|
|
122
126
|
geo_fence_setting_visit_start: boolean;
|
|
123
127
|
geo_fence_setting_visit_end: boolean;
|
|
@@ -518,6 +522,8 @@ export namespace Service {
|
|
|
518
522
|
enable_payment_terms_grace_period_days?: boolean;
|
|
519
523
|
is_simplified?: boolean;
|
|
520
524
|
last_login_time?: number;
|
|
525
|
+
assigned_forms_v2_templates?: string[];
|
|
526
|
+
retail_execution_templates?: string[];
|
|
521
527
|
createdAt: string;
|
|
522
528
|
updatedAt: string;
|
|
523
529
|
__v: number;
|
|
@@ -585,6 +591,8 @@ export namespace Service {
|
|
|
585
591
|
enable_payment_terms_grace_period_days?: boolean;
|
|
586
592
|
is_simplified?: boolean;
|
|
587
593
|
last_login_time?: number;
|
|
594
|
+
assigned_forms_v2_templates?: string[];
|
|
595
|
+
retail_execution_templates?: string[];
|
|
588
596
|
}
|
|
589
597
|
export type PopulatedKeys =
|
|
590
598
|
| "tags"
|
|
@@ -601,7 +609,9 @@ export namespace Service {
|
|
|
601
609
|
| "assigned_product_groups"
|
|
602
610
|
| "speciality"
|
|
603
611
|
| "teams"
|
|
604
|
-
| "contacts"
|
|
612
|
+
| "contacts"
|
|
613
|
+
| "retail_execution_templates"
|
|
614
|
+
| "assigned_forms_v2_templates";
|
|
605
615
|
|
|
606
616
|
type ClientSchemaWithPopulatedKeys = ClientSchema & {
|
|
607
617
|
assigned_products?:
|
|
@@ -622,6 +632,10 @@ export namespace Service {
|
|
|
622
632
|
| string
|
|
623
633
|
| Pick<Client.ClientSchema, "_id" | "name" | "client_code">;
|
|
624
634
|
channel?: string | Channel.ChannelSchema;
|
|
635
|
+
assigned_forms_v2_templates?: string[] | FormPopulated[];
|
|
636
|
+
retail_execution_templates?:
|
|
637
|
+
| string[]
|
|
638
|
+
| RetailExecutionTemplatePopulated[];
|
|
625
639
|
};
|
|
626
640
|
|
|
627
641
|
export namespace Find {
|
|
@@ -7986,6 +8000,155 @@ export namespace Service {
|
|
|
7986
8000
|
}
|
|
7987
8001
|
}
|
|
7988
8002
|
|
|
8003
|
+
export namespace Approval {
|
|
8004
|
+
export interface Data {
|
|
8005
|
+
_id: StringId;
|
|
8006
|
+
creator: AdminCreator;
|
|
8007
|
+
name: string;
|
|
8008
|
+
disabled: boolean;
|
|
8009
|
+
company_namespace: string[];
|
|
8010
|
+
type:
|
|
8011
|
+
| "proforma"
|
|
8012
|
+
| "transfer"
|
|
8013
|
+
| "approval-request"
|
|
8014
|
+
| "receiving-material"
|
|
8015
|
+
| "asset-part-transfer"
|
|
8016
|
+
| "adjust-inventory"
|
|
8017
|
+
| "return-asset-part-unit"
|
|
8018
|
+
| "store-asset-part-unit";
|
|
8019
|
+
position?: number;
|
|
8020
|
+
description?: string;
|
|
8021
|
+
rules: {
|
|
8022
|
+
index: number;
|
|
8023
|
+
name: string;
|
|
8024
|
+
permissions: { can_edit: boolean };
|
|
8025
|
+
admins: { _id: StringId; name?: string; type: "admin" }[];
|
|
8026
|
+
reps: { _id: StringId; name?: string; type: "rep" }[];
|
|
8027
|
+
append_creator?: boolean;
|
|
8028
|
+
append_assigned_origin_warehouse_rep?: boolean;
|
|
8029
|
+
append_assigned_destination_warehouse_rep?: boolean;
|
|
8030
|
+
send_email?: boolean;
|
|
8031
|
+
}[];
|
|
8032
|
+
filters?: {
|
|
8033
|
+
key: string;
|
|
8034
|
+
operator: "eq" | "ne" | "in" | "nin" | "gt" | "gte" | "lt" | "lte";
|
|
8035
|
+
value: any[];
|
|
8036
|
+
manipulator_function?: string;
|
|
8037
|
+
}[];
|
|
8038
|
+
createdAt: Date;
|
|
8039
|
+
updatedAt: Date;
|
|
8040
|
+
__v: number;
|
|
8041
|
+
}
|
|
8042
|
+
|
|
8043
|
+
export interface CreateBody {
|
|
8044
|
+
name: string;
|
|
8045
|
+
type:
|
|
8046
|
+
| "proforma"
|
|
8047
|
+
| "transfer"
|
|
8048
|
+
| "approval-request"
|
|
8049
|
+
| "receiving-material"
|
|
8050
|
+
| "asset-part-transfer"
|
|
8051
|
+
| "adjust-inventory"
|
|
8052
|
+
| "return-asset-part-unit"
|
|
8053
|
+
| "store-asset-part-unit";
|
|
8054
|
+
creator?: AdminCreator;
|
|
8055
|
+
disabled?: boolean;
|
|
8056
|
+
company_namespace?: string[];
|
|
8057
|
+
position?: number;
|
|
8058
|
+
description?: string;
|
|
8059
|
+
rules: {
|
|
8060
|
+
index: number;
|
|
8061
|
+
name: string;
|
|
8062
|
+
permissions?: { can_edit: boolean };
|
|
8063
|
+
admins?: { _id: StringId; name?: string; type: "admin" }[];
|
|
8064
|
+
reps?: { _id: StringId; name?: string; type: "rep" }[];
|
|
8065
|
+
append_creator?: boolean;
|
|
8066
|
+
append_assigned_origin_warehouse_rep?: boolean;
|
|
8067
|
+
append_assigned_destination_warehouse_rep?: boolean;
|
|
8068
|
+
send_email?: boolean;
|
|
8069
|
+
}[];
|
|
8070
|
+
filters?: {
|
|
8071
|
+
key: string;
|
|
8072
|
+
operator: "eq" | "ne" | "in" | "nin" | "gt" | "gte" | "lt" | "lte";
|
|
8073
|
+
value: any[];
|
|
8074
|
+
manipulator_function?: string;
|
|
8075
|
+
}[];
|
|
8076
|
+
}
|
|
8077
|
+
export interface UpdateBody {
|
|
8078
|
+
_id?: StringId;
|
|
8079
|
+
creator?: AdminCreator;
|
|
8080
|
+
name?: string;
|
|
8081
|
+
disabled?: boolean;
|
|
8082
|
+
company_namespace?: string[];
|
|
8083
|
+
type?:
|
|
8084
|
+
| "proforma"
|
|
8085
|
+
| "transfer"
|
|
8086
|
+
| "approval-request"
|
|
8087
|
+
| "receiving-material"
|
|
8088
|
+
| "asset-part-transfer"
|
|
8089
|
+
| "adjust-inventory"
|
|
8090
|
+
| "return-asset-part-unit"
|
|
8091
|
+
| "store-asset-part-unit";
|
|
8092
|
+
position?: number;
|
|
8093
|
+
description?: string;
|
|
8094
|
+
rules?: {
|
|
8095
|
+
index: number;
|
|
8096
|
+
name: string;
|
|
8097
|
+
permissions?: { can_edit: boolean };
|
|
8098
|
+
admins?: { _id: StringId; name?: string; type: "admin" }[];
|
|
8099
|
+
reps?: { _id: StringId; name?: string; type: "rep" }[];
|
|
8100
|
+
append_creator?: boolean;
|
|
8101
|
+
append_assigned_origin_warehouse_rep?: boolean;
|
|
8102
|
+
append_assigned_destination_warehouse_rep?: boolean;
|
|
8103
|
+
send_email?: boolean;
|
|
8104
|
+
}[];
|
|
8105
|
+
filters?: {
|
|
8106
|
+
key: string;
|
|
8107
|
+
operator: "eq" | "ne" | "in" | "nin" | "gt" | "gte" | "lt" | "lte";
|
|
8108
|
+
value: any[];
|
|
8109
|
+
manipulator_function?: string;
|
|
8110
|
+
}[];
|
|
8111
|
+
createdAt?: Date;
|
|
8112
|
+
updatedAt?: Date;
|
|
8113
|
+
__v?: number;
|
|
8114
|
+
}
|
|
8115
|
+
|
|
8116
|
+
export namespace Find {
|
|
8117
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
8118
|
+
_id?: StringId[] | StringId;
|
|
8119
|
+
search?: string;
|
|
8120
|
+
name?: string[] | string;
|
|
8121
|
+
disabled?: boolean;
|
|
8122
|
+
sortBy?: {
|
|
8123
|
+
field: "_id" | "position" | "updatedAt";
|
|
8124
|
+
type: "asc" | "desc";
|
|
8125
|
+
}[];
|
|
8126
|
+
[key: string]: any; // integration_meta.
|
|
8127
|
+
};
|
|
8128
|
+
export interface Result extends DefaultPaginationResult {
|
|
8129
|
+
data: Data[];
|
|
8130
|
+
}
|
|
8131
|
+
}
|
|
8132
|
+
export namespace Get {
|
|
8133
|
+
export type ID = string;
|
|
8134
|
+
export type Params = { [key: string]: any };
|
|
8135
|
+
export type Result = Data;
|
|
8136
|
+
}
|
|
8137
|
+
export namespace Create {
|
|
8138
|
+
export type Body = CreateBody;
|
|
8139
|
+
export type Result = Data;
|
|
8140
|
+
}
|
|
8141
|
+
export namespace Update {
|
|
8142
|
+
export type ID = string;
|
|
8143
|
+
export type Body = UpdateBody;
|
|
8144
|
+
export type Result = Data;
|
|
8145
|
+
}
|
|
8146
|
+
export namespace Remove {
|
|
8147
|
+
export type ID = string;
|
|
8148
|
+
export type Result = Data;
|
|
8149
|
+
}
|
|
8150
|
+
}
|
|
8151
|
+
|
|
7989
8152
|
export namespace Cycle {
|
|
7990
8153
|
type CycleStatus = "pending" | "approved" | "processing" | "rejected";
|
|
7991
8154
|
export interface Schema {
|
|
@@ -12451,7 +12614,9 @@ export namespace Service {
|
|
|
12451
12614
|
createdAt: Date;
|
|
12452
12615
|
updatedAt: Date;
|
|
12453
12616
|
}
|
|
12454
|
-
|
|
12617
|
+
export type PopulatedDoc = Data & {
|
|
12618
|
+
cycle?: Cycle.Schema & { approval?: string | Approval.Data };
|
|
12619
|
+
};
|
|
12455
12620
|
export interface CreateBody {
|
|
12456
12621
|
document_id?: StringId;
|
|
12457
12622
|
document_type: "client" | "visit";
|
|
@@ -12645,10 +12810,12 @@ export namespace Service {
|
|
|
12645
12810
|
"meta.business_day": string | string[];
|
|
12646
12811
|
"meta.form._id": StringId | StringId[];
|
|
12647
12812
|
sortBy?: { field: "_id"; type: "asc" | "desc" }[];
|
|
12813
|
+
withCycle?: boolean;
|
|
12814
|
+
populatedKeys?: ["approval"];
|
|
12648
12815
|
[key: string]: any; // integration_meta.
|
|
12649
12816
|
};
|
|
12650
12817
|
export interface Result extends DefaultPaginationResult {
|
|
12651
|
-
data: Data[];
|
|
12818
|
+
data: Data[] | PopulatedDoc[];
|
|
12652
12819
|
}
|
|
12653
12820
|
}
|
|
12654
12821
|
export namespace Get {
|
|
@@ -12658,10 +12825,11 @@ export namespace Service {
|
|
|
12658
12825
|
validityCheck?: boolean;
|
|
12659
12826
|
originalDoc_populatedKeys?: PopulatedKeys[];
|
|
12660
12827
|
withOriginalDoc?: boolean;
|
|
12828
|
+
populatedKeys?: ["approval"];
|
|
12661
12829
|
[key: string]: any; // integration_meta.
|
|
12662
12830
|
};
|
|
12663
12831
|
export type Result = Data & {
|
|
12664
|
-
cycle?: Cycle.Schema;
|
|
12832
|
+
cycle?: Cycle.Schema & { approval?: string | Approval.Data };
|
|
12665
12833
|
original_doc?: Client.ClientSchema | Visit.VisitSchema;
|
|
12666
12834
|
};
|
|
12667
12835
|
}
|