server-core-module 1.0.6 → 1.0.8

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.
@@ -11,6 +11,7 @@ export type TOrder = {
11
11
  name: string;
12
12
  price: number;
13
13
  quantity: number;
14
+ note?: string;
14
15
  }[];
15
16
  totalAmount: number;
16
17
  note?: string;
@@ -16,6 +16,7 @@ exports.schemaOrder = joi_1.default.object({
16
16
  name: joi_1.default.string().required(),
17
17
  price: joi_1.default.number().min(0).required(),
18
18
  quantity: joi_1.default.number().min(1).required(),
19
+ note: joi_1.default.string().optional().allow(''),
19
20
  })).required(),
20
21
  totalAmount: joi_1.default.number().min(0).required(),
21
22
  note: joi_1.default.string().optional(),
@@ -34,6 +35,7 @@ exports.schemaOrderUpdate = joi_1.default.object({
34
35
  name: joi_1.default.string().required(),
35
36
  price: joi_1.default.number().min(0).required(),
36
37
  quantity: joi_1.default.number().min(1).required(),
38
+ note: joi_1.default.string().optional().allow(''),
37
39
  })),
38
40
  totalAmount: joi_1.default.number().min(0),
39
41
  note: joi_1.default.string(),
@@ -10,11 +10,12 @@ async function sendOrderConfirmation(email, name, items, totalAmount, deliveryFe
10
10
  console.log("Sending email to:", email);
11
11
  try {
12
12
  const itemsList = items.map(item => `<tr>
13
- <td>${item.name}</td>
14
- <td>${item.quantity}</td>
15
- <td>₱${item.price}</td>
16
- <td>₱${item.price * item.quantity}</td>
17
- </tr>`).join("");
13
+ <td>${item.name}</td>
14
+ <td>${item.quantity}</td>
15
+ <td>₱${item.price}</td>
16
+ <td>₱${item.price * item.quantity}</td>
17
+ <td>${item.note || '-'}</td>
18
+ </tr>`).join("");
18
19
  resend.emails.send({
19
20
  from: "Cesar's Flower Shop 🌸 <noreply@cesarsflowershop.com>",
20
21
  to: email,
@@ -28,6 +29,7 @@ async function sendOrderConfirmation(email, name, items, totalAmount, deliveryFe
28
29
  <th>Qty</th>
29
30
  <th>Price</th>
30
31
  <th>Subtotal</th>
32
+ <th>Note</th>
31
33
  </tr>
32
34
  ${itemsList}
33
35
  </table>
@@ -66,11 +68,12 @@ async function sendOrderStatusUpdate(email, name, status) {
66
68
  async function sendAdminNotification(name, items, totalAmount, customerEmail, deliveryFee) {
67
69
  try {
68
70
  const itemsList = items.map(item => `<tr>
69
- <td>${item.name}</td>
70
- <td>${item.quantity}</td>
71
- <td>₱${item.price}</td>
72
- <td>₱${item.price * item.quantity}</td>
73
- </tr>`).join("");
71
+ <td>${item.name}</td>
72
+ <td>${item.quantity}</td>
73
+ <td>₱${item.price}</td>
74
+ <td>₱${item.price * item.quantity}</td>
75
+ <td>${item.note || '-'}</td>
76
+ </tr>`).join("");
74
77
  resend.emails.send({
75
78
  from: "Cesar's Flower Shop 🌸 <noreply@cesarsflowershop.com>",
76
79
  to: process.env.ADMIN_EMAIL,
@@ -85,18 +88,19 @@ async function sendAdminNotification(name, items, totalAmount, customerEmail, de
85
88
  <th>Qty</th>
86
89
  <th>Price</th>
87
90
  <th>Subtotal</th>
91
+ <th>Note</th>
88
92
  </tr>
89
93
  ${itemsList}
90
94
  <tr>
91
- <td colspan="3"><strong>Items Subtotal</strong></td>
95
+ <td colspan="4"><strong>Items Subtotal</strong></td>
92
96
  <td>₱${totalAmount - (deliveryFee || 0)}</td>
93
97
  </tr>
94
98
  <tr>
95
- <td colspan="3"><strong>Delivery Fee</strong></td>
99
+ <td colspan="4"><strong>Delivery Fee</strong></td>
96
100
  <td>₱${deliveryFee || 0}</td>
97
101
  </tr>
98
102
  <tr>
99
- <td colspan="3"><strong>Total</strong></td>
103
+ <td colspan="4"><strong>Total</strong></td>
100
104
  <td><strong>₱${totalAmount}</strong></td>
101
105
  </tr>
102
106
  </table>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "server-core-module",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "",
5
5
  "main": "dist/repositories/product.repository.js",
6
6
  "scripts": {
@@ -12,7 +12,10 @@ export type TOrder = {
12
12
  name: string;
13
13
  price: number;
14
14
  quantity: number;
15
- note?: string;
15
+ note?: string;
16
+ wrapper?: string;
17
+ ribbon?: string;
18
+ ribbonUrl?: string;
16
19
  }[];
17
20
  totalAmount: number;
18
21
  note?: string;
@@ -35,6 +38,9 @@ export const schemaOrder = Joi.object({
35
38
  price: Joi.number().min(0).required(),
36
39
  quantity: Joi.number().min(1).required(),
37
40
  note: Joi.string().optional().allow(''),
41
+ wrapper: Joi.string().optional().allow(''),
42
+ ribbon: Joi.string().optional().allow(''),
43
+ ribbonUrl: Joi.string().optional().allow(''),
38
44
  })).required(),
39
45
  totalAmount: Joi.number().min(0).required(),
40
46
  note: Joi.string().optional(),
@@ -56,6 +62,9 @@ export const schemaOrderUpdate = Joi.object({
56
62
  price: Joi.number().min(0).required(),
57
63
  quantity: Joi.number().min(1).required(),
58
64
  note: Joi.string().optional().allow(''),
65
+ wrapper: Joi.string().optional().allow(''),
66
+ ribbon: Joi.string().optional().allow(''),
67
+ ribbonUrl: Joi.string().optional().allow(''),
59
68
  })),
60
69
  totalAmount: Joi.number().min(0),
61
70
  note: Joi.string(),