server-core-module 1.0.5 → 1.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "server-core-module",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "",
5
5
  "main": "dist/repositories/product.repository.js",
6
6
  "scripts": {
@@ -12,6 +12,7 @@ export type TOrder = {
12
12
  name: string;
13
13
  price: number;
14
14
  quantity: number;
15
+ note?: string;
15
16
  }[];
16
17
  totalAmount: number;
17
18
  note?: string;
@@ -33,6 +34,7 @@ export const schemaOrder = Joi.object({
33
34
  name: Joi.string().required(),
34
35
  price: Joi.number().min(0).required(),
35
36
  quantity: Joi.number().min(1).required(),
37
+ note: Joi.string().optional().allow(''),
36
38
  })).required(),
37
39
  totalAmount: Joi.number().min(0).required(),
38
40
  note: Joi.string().optional(),
@@ -53,6 +55,7 @@ export const schemaOrderUpdate = Joi.object({
53
55
  name: Joi.string().required(),
54
56
  price: Joi.number().min(0).required(),
55
57
  quantity: Joi.number().min(1).required(),
58
+ note: Joi.string().optional().allow(''),
56
59
  })),
57
60
  totalAmount: Joi.number().min(0),
58
61
  note: Joi.string(),
@@ -6,13 +6,14 @@ export async function sendOrderConfirmation(email: string, name: string, items:
6
6
  try {
7
7
 
8
8
  const itemsList = items.map(item =>
9
- `<tr>
10
- <td>${item.name}</td>
11
- <td>${item.quantity}</td>
12
- <td>₱${item.price}</td>
13
- <td>₱${item.price * item.quantity}</td>
14
- </tr>`
15
- ).join("");
9
+ `<tr>
10
+ <td>${item.name}</td>
11
+ <td>${item.quantity}</td>
12
+ <td>₱${item.price}</td>
13
+ <td>₱${item.price * item.quantity}</td>
14
+ <td>${item.note || '-'}</td>
15
+ </tr>`
16
+ ).join("");
16
17
 
17
18
  resend.emails.send({
18
19
  from: "Cesar's Flower Shop 🌸 <noreply@cesarsflowershop.com>",
@@ -27,6 +28,7 @@ export async function sendOrderConfirmation(email: string, name: string, items:
27
28
  <th>Qty</th>
28
29
  <th>Price</th>
29
30
  <th>Subtotal</th>
31
+ <th>Note</th>
30
32
  </tr>
31
33
  ${itemsList}
32
34
  </table>
@@ -66,14 +68,15 @@ export async function sendOrderStatusUpdate(email: string, name: string, status:
66
68
  export async function sendAdminNotification(name: string, items: any[], totalAmount: number, customerEmail: string, deliveryFee?:number) {
67
69
  try {
68
70
 
69
- const itemsList = items.map(item =>
70
- `<tr>
71
- <td>${item.name}</td>
72
- <td>${item.quantity}</td>
73
- <td>₱${item.price}</td>
74
- <td>₱${item.price * item.quantity}</td>
75
- </tr>`
76
- ).join("");
71
+ const itemsList = items.map(item =>
72
+ `<tr>
73
+ <td>${item.name}</td>
74
+ <td>${item.quantity}</td>
75
+ <td>₱${item.price}</td>
76
+ <td>₱${item.price * item.quantity}</td>
77
+ <td>${item.note || '-'}</td>
78
+ </tr>`
79
+ ).join("");
77
80
 
78
81
  resend.emails.send({
79
82
  from: "Cesar's Flower Shop 🌸 <noreply@cesarsflowershop.com>",
@@ -89,18 +92,19 @@ export async function sendAdminNotification(name: string, items: any[], totalAmo
89
92
  <th>Qty</th>
90
93
  <th>Price</th>
91
94
  <th>Subtotal</th>
95
+ <th>Note</th>
92
96
  </tr>
93
97
  ${itemsList}
94
98
  <tr>
95
- <td colspan="3"><strong>Items Subtotal</strong></td>
99
+ <td colspan="4"><strong>Items Subtotal</strong></td>
96
100
  <td>₱${totalAmount - (deliveryFee || 0)}</td>
97
101
  </tr>
98
102
  <tr>
99
- <td colspan="3"><strong>Delivery Fee</strong></td>
103
+ <td colspan="4"><strong>Delivery Fee</strong></td>
100
104
  <td>₱${deliveryFee || 0}</td>
101
105
  </tr>
102
106
  <tr>
103
- <td colspan="3"><strong>Total</strong></td>
107
+ <td colspan="4"><strong>Total</strong></td>
104
108
  <td><strong>₱${totalAmount}</strong></td>
105
109
  </tr>
106
110
  </table>