sitero 0.0.18 → 0.0.20

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.
@@ -32,7 +32,7 @@ function createOrderCompleteAdminEmail(ctx) {
32
32
  url,
33
33
  orderNumber: order.orderNumber ?? "",
34
34
  productItems: order.items.reduce(
35
- (prev, { productName, quantity, unitPriceAmount }) => prev + productItemHtml(productName ?? "", quantity, unitPriceAmount),
35
+ (prev, { productName, quantity, subtotalAmount }) => prev + productItemHtml(productName ?? "", quantity, subtotalAmount),
36
36
  ""
37
37
  ),
38
38
  recipientName: order.recipientName ?? "",
@@ -53,7 +53,10 @@ function createOrderCompleteAdminEmail(ctx) {
53
53
  transferAccountNumber: order.text1 ?? "",
54
54
  totalQuantity: String(
55
55
  order.items.reduce((sum, item) => sum + item.quantity, 0)
56
- )
56
+ ),
57
+ /// added
58
+ taxHtml: order.text2 ? extraHtml("\u7D71\u4E00\u7DE8\u865F", order.text2) : "",
59
+ noteHtml: order.note ? extraHtml("\u5099\u8A3B", order.note) : ""
57
60
  });
58
61
  return infrastructure.email.sendEmail({
59
62
  to: email,
@@ -66,14 +69,32 @@ function createOrderCompleteAdminEmail(ctx) {
66
69
  send
67
70
  };
68
71
  }
69
- const productItemHtml = (name, quantity, price) => `
72
+ const productItemHtml = (name, quantity, subtotalAmount) => `
70
73
  <tr style="text-align: right">
71
74
  <td style="border-bottom: 1px solid #ddd; padding: 2px 6px">
72
75
  ${name}
73
76
  </td>
74
77
  <td style="border-bottom: 1px solid #ddd; padding: 2px 6px">${quantity}</td>
75
- <td style="border-bottom: 1px solid #ddd; padding: 2px 6px">NT $${price}</td>
78
+ <td style="border-bottom: 1px solid #ddd; padding: 2px 6px">NT $${subtotalAmount}</td>
76
79
  </tr>
77
80
  `;
81
+ const extraHtml = (title, content) => `
82
+ <tr>
83
+ <th
84
+ style="
85
+ border: 1px solid #c5c5c5;
86
+ background-color: #f5f5f5;
87
+ font-weight: normal;
88
+ padding: 2px 6px;
89
+ width: 100px;
90
+ "
91
+ >
92
+ ${title}
93
+ </th>
94
+ <td style="border-bottom: 1px solid #ddd; padding: 2px 6px">
95
+ ${content}
96
+ </td>
97
+ </tr>
98
+ `;
78
99
 
79
100
  export { createOrderCompleteAdminEmail };
@@ -1 +1 @@
1
- {"version":3,"file":"create-order-complete-admin-email.d.ts","sourceRoot":"","sources":["../../../../../../../../src/web/server/applications/emails/order/create-order-complete-admin-email.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AASrD,UAAU,UAAU;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;CAClB;AAID,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,YAAY;2BAUnD,MAAM,gBACA,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;8CAaiB,UAAU;EAoDlE"}
1
+ {"version":3,"file":"create-order-complete-admin-email.d.ts","sourceRoot":"","sources":["../../../../../../../../src/web/server/applications/emails/order/create-order-complete-admin-email.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AASrD,UAAU,UAAU;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;CAClB;AAID,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,YAAY;2BAUnD,MAAM,gBACA,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;8CAaiB,UAAU;EAuDlE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sitero",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "author": "Yiming Liao",
5
5
  "license": "MIT",
6
6
  "type": "module",