sitero 0.0.18 → 0.0.20-kowkun.1

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.
@@ -23,7 +23,7 @@ function createOrderUpdateAction(ctx) {
23
23
  const {
24
24
  infrastructure: { zod, i18n, repositories },
25
25
  interfaces: { executions, middlewares },
26
- constants: { ecpayEnv, ecpayProfile, apiUrl },
26
+ constants: { ecpayEnv, ecpayProfileLogistic, apiUrl },
27
27
  logger
28
28
  } = ctx;
29
29
  return async function orderUpdateAction({
@@ -31,7 +31,7 @@ function createOrderUpdateAction(ctx) {
31
31
  formData
32
32
  }) {
33
33
  const ECPAY_PROFILE = {
34
- production: ecpayProfile,
34
+ production: ecpayProfileLogistic,
35
35
  stage: LOGISTIC_STAGE_PROFILE
36
36
  // logistic
37
37
  };
@@ -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 };
@@ -30,11 +30,11 @@ function createPaymentNotifyApi(ctx) {
30
30
  infrastructure: { cache, repositories },
31
31
  interfaces
32
32
  },
33
- constants: { ecpayEnv, ecpayProfile, apiUrl },
33
+ constants: { ecpayEnv, ecpayProfileLogistic, apiUrl },
34
34
  logger
35
35
  } = ctx;
36
36
  const ECPAY_PROFILE = {
37
- production: ecpayProfile,
37
+ production: ecpayProfileLogistic,
38
38
  stage: AIO_CHECKOUT_STAGE_PROFILE
39
39
  };
40
40
  return async function paymentNotifyApi(request) {
@@ -82,7 +82,7 @@ function createPaymentNotifyApi(ctx) {
82
82
  if (order.shippingMethod === SHIPPING_METHOD.CVS_PICKUP && order.shippingStatus === ORDER_SHIPPING_STATUS.NOT_READY) {
83
83
  const { url, requestPayload, MerchantTradeNo: MerchantTradeNo2 } = createEcpayLogisticRequest({
84
84
  env: ecpayEnv,
85
- ecpayProfile: ecpayEnv === "stage" ? LOGISTIC_STAGE_PROFILE : ecpayProfile,
85
+ ecpayProfile: ecpayEnv === "stage" ? LOGISTIC_STAGE_PROFILE : ecpayProfileLogistic,
86
86
  // logistic
87
87
  input: {
88
88
  ServerReplyURL: joinUrl(apiUrl, API_PATHS.web["logistic-notify"]),
@@ -2,7 +2,7 @@ import type { EcpayEnvironment, EcpayMerchantProfile } from "../types";
2
2
  import { type CreateEcpayLogisticRequestInput } from "./create-request";
3
3
  interface EcpayLogisticTriggerParams {
4
4
  env: EcpayEnvironment;
5
- ecpayProfile: EcpayMerchantProfile;
5
+ ecpayProfileLogistic: EcpayMerchantProfile;
6
6
  input: CreateEcpayLogisticRequestInput;
7
7
  onSubmit?: (params: {
8
8
  MerchantTradeNo: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ecpay-logistic-handler.d.ts","sourceRoot":"","sources":["../../../../../../src/commerce/ecpay/logistic/ecpay-logistic-handler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEvE,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,kBAAkB,CAAC;AAE1B,UAAU,0BAA0B;IAClC,GAAG,EAAE,gBAAgB,CAAC;IACtB,YAAY,EAAE,oBAAoB,CAAC;IACnC,KAAK,EAAE,+BAA+B,CAAC;IACvC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,eAAe,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC1D;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,0BAA0B,QActE"}
1
+ {"version":3,"file":"ecpay-logistic-handler.d.ts","sourceRoot":"","sources":["../../../../../../src/commerce/ecpay/logistic/ecpay-logistic-handler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEvE,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,kBAAkB,CAAC;AAE1B,UAAU,0BAA0B;IAClC,GAAG,EAAE,gBAAgB,CAAC;IACtB,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,KAAK,EAAE,+BAA+B,CAAC;IACvC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,eAAe,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC1D;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,0BAA0B,QActE"}
@@ -28,6 +28,7 @@ export interface ActionContext {
28
28
  appName: string;
29
29
  ecpayEnv: EcpayEnvironment;
30
30
  ecpayProfile: EcpayMerchantProfile;
31
+ ecpayProfileLogistic: EcpayMerchantProfile;
31
32
  apiUrl: string;
32
33
  };
33
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"action-context.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/server/interfaces/actions/action-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EACV,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpC,MAAM,WAAW,aAAa;IAC5B,cAAc,EAAE,kBAAkB,CAAC;IACnC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,UAAU,EAAE;QACV,WAAW,EAAE;YACX,KAAK,EAAE;gBACL,mBAAmB,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;aACnE,CAAC;YACF,IAAI,EAAE;gBACJ,kBAAkB,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;aACjE,CAAC;SACH,CAAC;QACF,UAAU,EAAE;YACV,aAAa,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;SACvD,CAAC;KACH,CAAC;IAEF,MAAM,EAAE,MAAM,CAAC;IAGf,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;KACjC,CAAC;IAGF,SAAS,EAAE;QACT,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,gBAAgB,CAAC;QAC3B,YAAY,EAAE,oBAAoB,CAAC;QACnC,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH"}
1
+ {"version":3,"file":"action-context.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/server/interfaces/actions/action-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EACV,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpC,MAAM,WAAW,aAAa;IAC5B,cAAc,EAAE,kBAAkB,CAAC;IACnC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,UAAU,EAAE;QACV,WAAW,EAAE;YACX,KAAK,EAAE;gBACL,mBAAmB,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;aACnE,CAAC;YACF,IAAI,EAAE;gBACJ,kBAAkB,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;aACjE,CAAC;SACH,CAAC;QACF,UAAU,EAAE;YACV,aAAa,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;SACvD,CAAC;KACH,CAAC;IAEF,MAAM,EAAE,MAAM,CAAC;IAGf,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;KACjC,CAAC;IAGF,SAAS,EAAE;QACT,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,gBAAgB,CAAC;QAC3B,YAAY,EAAE,oBAAoB,CAAC;QACnC,oBAAoB,EAAE,oBAAoB,CAAC;QAC3C,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH"}
@@ -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"}
@@ -7,6 +7,7 @@ export interface ApiContext {
7
7
  cvsMapRedirectUrl: string;
8
8
  ecpayEnv: EcpayEnvironment;
9
9
  ecpayProfile: EcpayMerchantProfile;
10
+ ecpayProfileLogistic: EcpayMerchantProfile;
10
11
  apiUrl: string;
11
12
  };
12
13
  logger: Logger;
@@ -1 +1 @@
1
- {"version":3,"file":"api-context.d.ts","sourceRoot":"","sources":["../../../../../../../src/web/server/interfaces/apis/api-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpC,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,UAAU,CAAC;IAGvB,SAAS,EAAE;QACT,iBAAiB,EAAE,MAAM,CAAC;QAC1B,QAAQ,EAAE,gBAAgB,CAAC;QAC3B,YAAY,EAAE,oBAAoB,CAAC;QACnC,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF,MAAM,EAAE,MAAM,CAAC;CAChB"}
1
+ {"version":3,"file":"api-context.d.ts","sourceRoot":"","sources":["../../../../../../../src/web/server/interfaces/apis/api-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpC,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,UAAU,CAAC;IAGvB,SAAS,EAAE;QACT,iBAAiB,EAAE,MAAM,CAAC;QAC1B,QAAQ,EAAE,gBAAgB,CAAC;QAC3B,YAAY,EAAE,oBAAoB,CAAC;QACnC,oBAAoB,EAAE,oBAAoB,CAAC;QAC3C,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -1 +1 @@
1
- {"version":3,"file":"payment-notify-api.d.ts","sourceRoot":"","sources":["../../../../../../../../src/web/server/interfaces/apis/payment-notify/payment-notify-api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AA2B7D,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,UAAU,IAgBb,SAAS,WAAW,oCA0H5D"}
1
+ {"version":3,"file":"payment-notify-api.d.ts","sourceRoot":"","sources":["../../../../../../../../src/web/server/interfaces/apis/payment-notify/payment-notify-api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AA2B7D,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,UAAU,IAgBb,SAAS,WAAW,oCA4H5D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sitero",
3
- "version": "0.0.18",
3
+ "version": "0.0.20-kowkun.1",
4
4
  "author": "Yiming Liao",
5
5
  "license": "MIT",
6
6
  "type": "module",