@managesome/eposmatic-toolkit 0.2.365 → 0.2.367
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/constants/ENUMS.d.ts +2 -1
- package/lib/constants/ENUMS.js +1 -0
- package/lib/helpers/types/email-templates.d.ts +31 -1
- package/lib/helpers/utils/email-helpers.js +5 -0
- package/lib/schemas/models/warehouse-communications.d.ts +3 -3
- package/lib/schemas/models/warehouse-communications.js +1 -1
- package/lib/schemas/types/warehouse-communications.d.ts +1 -1
- package/package.json +1 -1
package/lib/constants/ENUMS.d.ts
CHANGED
|
@@ -1195,7 +1195,8 @@ export declare enum EMAIL_TEMPLATES_TYPE_ENUM {
|
|
|
1195
1195
|
SUBSCRIPTION_EXPIRED = "SUBSCRIPTION_EXPIRED",
|
|
1196
1196
|
SUBSCRIPTION_RENEWED = "SUBSCRIPTION_RENEWED",
|
|
1197
1197
|
WELCOME = "WELCOME",
|
|
1198
|
-
MARKETING_FORM_SUBMISSION = "MARKETING_FORM_SUBMISSION"
|
|
1198
|
+
MARKETING_FORM_SUBMISSION = "MARKETING_FORM_SUBMISSION",
|
|
1199
|
+
EMAIL_TEMPLATE_FOR_RFQ = "EMAIL_TEMPLATE_FOR_RFQ"
|
|
1199
1200
|
}
|
|
1200
1201
|
export declare enum DISCOUNT_TYPE_ENUM {
|
|
1201
1202
|
SPECIAL = "SPECIAL",
|
package/lib/constants/ENUMS.js
CHANGED
|
@@ -1918,6 +1918,7 @@ var EMAIL_TEMPLATES_TYPE_ENUM;
|
|
|
1918
1918
|
EMAIL_TEMPLATES_TYPE_ENUM["SUBSCRIPTION_RENEWED"] = "SUBSCRIPTION_RENEWED";
|
|
1919
1919
|
EMAIL_TEMPLATES_TYPE_ENUM["WELCOME"] = "WELCOME";
|
|
1920
1920
|
EMAIL_TEMPLATES_TYPE_ENUM["MARKETING_FORM_SUBMISSION"] = "MARKETING_FORM_SUBMISSION";
|
|
1921
|
+
EMAIL_TEMPLATES_TYPE_ENUM["EMAIL_TEMPLATE_FOR_RFQ"] = "EMAIL_TEMPLATE_FOR_RFQ";
|
|
1921
1922
|
})(EMAIL_TEMPLATES_TYPE_ENUM || (exports.EMAIL_TEMPLATES_TYPE_ENUM = EMAIL_TEMPLATES_TYPE_ENUM = {}));
|
|
1922
1923
|
// ======================>> <<====================== //
|
|
1923
1924
|
var DISCOUNT_TYPE_ENUM;
|
|
@@ -170,4 +170,34 @@ export interface IEmailMarketingFormSubmission {
|
|
|
170
170
|
number_of_outlets: string;
|
|
171
171
|
action_buttons: IEmailActionButton[];
|
|
172
172
|
}
|
|
173
|
-
|
|
173
|
+
interface IEmailTemplateForRfqItem {
|
|
174
|
+
name: string;
|
|
175
|
+
quantity: number;
|
|
176
|
+
currency_symbol: string;
|
|
177
|
+
price: number;
|
|
178
|
+
subtotal: number;
|
|
179
|
+
}
|
|
180
|
+
export interface IEmailTemplateForRFQ {
|
|
181
|
+
warehouse_name: string;
|
|
182
|
+
warehouse_logo_url?: string | null;
|
|
183
|
+
reference_number?: string | null;
|
|
184
|
+
issued_date: string;
|
|
185
|
+
expected_deadline: string;
|
|
186
|
+
payment_terms_days?: number | null;
|
|
187
|
+
counterparty_name: string;
|
|
188
|
+
counterparty_email: string;
|
|
189
|
+
line_items: IEmailTemplateForRfqItem[];
|
|
190
|
+
currency_symbol: string;
|
|
191
|
+
subtotal: number;
|
|
192
|
+
gst?: number | null;
|
|
193
|
+
is_gst_inclusive?: boolean | null;
|
|
194
|
+
gst_amount?: number | null;
|
|
195
|
+
grand_total: number;
|
|
196
|
+
notes?: string | null;
|
|
197
|
+
action_buttons: IEmailActionButton[];
|
|
198
|
+
support_email: string;
|
|
199
|
+
subject: string;
|
|
200
|
+
description: string;
|
|
201
|
+
}
|
|
202
|
+
export type ITemplateModel = IEmailAccountActivated | IEmailAccountDeactivated | IEmailLateDeliveryAlert | IEmailLowInventoryAlert | IEmailOrderReceipt | IEmailOrderStatusUpdate | IEmailRateOrder | IEmailReceivedOrderReview | IEmailSubscriptionDueSoon | IEmailSubscriptionPending | IEmailSubscriptionExpired | IEmailSubscriptionRenewed | IEmailUnconfirmOrderAlert | IEmailWelcome | IEmailMarketingFormSubmission | IEmailTemplateForRFQ;
|
|
203
|
+
export {};
|
|
@@ -84,6 +84,11 @@ const templates = {
|
|
|
84
84
|
alias: 'marketing-form-submission',
|
|
85
85
|
stream: STREAMS.transactional,
|
|
86
86
|
},
|
|
87
|
+
[constants_1.EMAIL_TEMPLATES_TYPE_ENUM.EMAIL_TEMPLATE_FOR_RFQ]: {
|
|
88
|
+
id: 44822342,
|
|
89
|
+
alias: 'email-template-for-rfq',
|
|
90
|
+
stream: STREAMS.transactional,
|
|
91
|
+
},
|
|
87
92
|
};
|
|
88
93
|
function getEmailTemplateBody(templateType, to, templateModel) {
|
|
89
94
|
const { id, alias, stream } = templates[templateType];
|
|
@@ -11,13 +11,13 @@ export declare const WarehouseCommunicationsSchema: Schema<any, import("mongoose
|
|
|
11
11
|
_id: import("mongoose").Types.ObjectId;
|
|
12
12
|
createdAt: NativeDate;
|
|
13
13
|
updatedAt: NativeDate;
|
|
14
|
+
description: string;
|
|
14
15
|
warehouse_id: string;
|
|
15
16
|
document_kind: import("../../constants").EMAIL_DOCUMENT_KIND_ENUM;
|
|
16
17
|
document_id: string;
|
|
17
18
|
communication_channel: COMMUNICATION_CHANNEL_ENUM;
|
|
18
19
|
to: string;
|
|
19
20
|
subject: string;
|
|
20
|
-
body: string;
|
|
21
21
|
metadata: {
|
|
22
22
|
grand_total: number;
|
|
23
23
|
subtotal: number;
|
|
@@ -83,13 +83,13 @@ export declare const WarehouseCommunicationsSchema: Schema<any, import("mongoose
|
|
|
83
83
|
_id: import("mongoose").Types.ObjectId;
|
|
84
84
|
createdAt: NativeDate;
|
|
85
85
|
updatedAt: NativeDate;
|
|
86
|
+
description: string;
|
|
86
87
|
warehouse_id: string;
|
|
87
88
|
document_kind: import("../../constants").EMAIL_DOCUMENT_KIND_ENUM;
|
|
88
89
|
document_id: string;
|
|
89
90
|
communication_channel: COMMUNICATION_CHANNEL_ENUM;
|
|
90
91
|
to: string;
|
|
91
92
|
subject: string;
|
|
92
|
-
body: string;
|
|
93
93
|
metadata: {
|
|
94
94
|
grand_total: number;
|
|
95
95
|
subtotal: number;
|
|
@@ -155,13 +155,13 @@ export declare const WarehouseCommunicationsSchema: Schema<any, import("mongoose
|
|
|
155
155
|
_id: import("mongoose").Types.ObjectId;
|
|
156
156
|
createdAt: NativeDate;
|
|
157
157
|
updatedAt: NativeDate;
|
|
158
|
+
description: string;
|
|
158
159
|
warehouse_id: string;
|
|
159
160
|
document_kind: import("../../constants").EMAIL_DOCUMENT_KIND_ENUM;
|
|
160
161
|
document_id: string;
|
|
161
162
|
communication_channel: COMMUNICATION_CHANNEL_ENUM;
|
|
162
163
|
to: string;
|
|
163
164
|
subject: string;
|
|
164
|
-
body: string;
|
|
165
165
|
metadata: {
|
|
166
166
|
grand_total: number;
|
|
167
167
|
subtotal: number;
|
|
@@ -44,7 +44,7 @@ export interface IWarehouseCommunication {
|
|
|
44
44
|
communication_channel: TWarehouseCommunicationChannel;
|
|
45
45
|
to: string;
|
|
46
46
|
subject: string;
|
|
47
|
-
|
|
47
|
+
description: string;
|
|
48
48
|
metadata: IWarehouseCommunicationMetadata;
|
|
49
49
|
sent_at?: Date | null;
|
|
50
50
|
createdAt: Date;
|