server-core-module 1.0.9 → 1.0.10

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.
@@ -12,6 +12,9 @@ export type TOrder = {
12
12
  price: number;
13
13
  quantity: number;
14
14
  note?: string;
15
+ wrapper?: string;
16
+ ribbon?: string;
17
+ ribbonUrl?: string;
15
18
  }[];
16
19
  totalAmount: number;
17
20
  note?: string;
@@ -17,6 +17,9 @@ exports.schemaOrder = joi_1.default.object({
17
17
  price: joi_1.default.number().min(0).required(),
18
18
  quantity: joi_1.default.number().min(1).required(),
19
19
  note: joi_1.default.string().optional().allow(''),
20
+ wrapper: joi_1.default.string().optional().allow(''),
21
+ ribbon: joi_1.default.string().optional().allow(''),
22
+ ribbonUrl: joi_1.default.string().optional().allow(''),
20
23
  })).required(),
21
24
  totalAmount: joi_1.default.number().min(0).required(),
22
25
  note: joi_1.default.string().optional(),
@@ -36,6 +39,9 @@ exports.schemaOrderUpdate = joi_1.default.object({
36
39
  price: joi_1.default.number().min(0).required(),
37
40
  quantity: joi_1.default.number().min(1).required(),
38
41
  note: joi_1.default.string().optional().allow(''),
42
+ wrapper: joi_1.default.string().optional().allow(''),
43
+ ribbon: joi_1.default.string().optional().allow(''),
44
+ ribbonUrl: joi_1.default.string().optional().allow(''),
39
45
  })),
40
46
  totalAmount: joi_1.default.number().min(0),
41
47
  note: joi_1.default.string(),
@@ -10,12 +10,14 @@ 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
- <td>${item.note || '-'}</td>
18
- </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
+ <td>${item.wrapper || '-'}</td>
19
+ <td>${item.ribbon ? `<img src="${item.ribbonUrl}" width="50" /><br/>${item.ribbon}` : '-'}</td>
20
+ </tr>`).join("");
19
21
  resend.emails.send({
20
22
  from: "Cesar's Flower Shop 🌸 <noreply@cesarsflowershop.com>",
21
23
  to: email,
@@ -30,6 +32,8 @@ async function sendOrderConfirmation(email, name, items, totalAmount, deliveryFe
30
32
  <th>Price</th>
31
33
  <th>Subtotal</th>
32
34
  <th>Note</th>
35
+ <th>Wrapper</th>
36
+ <th>Ribbon</th>
33
37
  </tr>
34
38
  ${itemsList}
35
39
  </table>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "server-core-module",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "",
5
5
  "main": "dist/repositories/product.repository.js",
6
6
  "scripts": {