@trusted-solutions/sdit.models 0.24.0 → 0.24.2
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/lambda/contract.d.ts +10 -0
- package/lambda/subscription.d.ts +111 -0
- package/lambda/subscription.js +9 -0
- package/lambda/subscription.js.map +1 -0
- package/models/contract.d.ts +4 -4
- package/package.json +1 -1
package/lambda/contract.d.ts
CHANGED
|
@@ -56,6 +56,16 @@ export interface UpdateContractPlanRequest {
|
|
|
56
56
|
* Will ignore `planId` if provided.
|
|
57
57
|
*/
|
|
58
58
|
planIds?: string[];
|
|
59
|
+
/**
|
|
60
|
+
* undefined: 不變更
|
|
61
|
+
* null/空字串: 移除此property
|
|
62
|
+
*/
|
|
63
|
+
name?: string;
|
|
64
|
+
/**
|
|
65
|
+
* undefined: 不變更
|
|
66
|
+
* null/空字串: 移除此property
|
|
67
|
+
*/
|
|
68
|
+
note?: string;
|
|
59
69
|
}
|
|
60
70
|
export declare type UpdateContractPlanResponse = null;
|
|
61
71
|
/**
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { Contract } from '../models/contract';
|
|
2
|
+
export declare enum SubscriptionVariantType {
|
|
3
|
+
month = "M",
|
|
4
|
+
year = "Y"
|
|
5
|
+
}
|
|
6
|
+
export declare type Subscription = {
|
|
7
|
+
id: string;
|
|
8
|
+
createdAt: number;
|
|
9
|
+
externalId?: string;
|
|
10
|
+
storeId: string;
|
|
11
|
+
ownerCognitoUserId: string;
|
|
12
|
+
ownerCognitoUserEmail: string;
|
|
13
|
+
ownerCognitoUserName: string;
|
|
14
|
+
externalCustomerId: string;
|
|
15
|
+
variantType: SubscriptionVariantType;
|
|
16
|
+
details: SubscriptionItem[];
|
|
17
|
+
totalAmount: number;
|
|
18
|
+
startedAt: number;
|
|
19
|
+
endedAt?: number;
|
|
20
|
+
autoRenew: boolean;
|
|
21
|
+
contract: Contract;
|
|
22
|
+
};
|
|
23
|
+
export interface SubscriptionItem {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
amount: number;
|
|
27
|
+
planId: string;
|
|
28
|
+
}
|
|
29
|
+
export interface SubscriptionVariantOption {
|
|
30
|
+
type: SubscriptionVariantType;
|
|
31
|
+
name: string;
|
|
32
|
+
}
|
|
33
|
+
export interface SubscriptionProductOption {
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
variant: {
|
|
37
|
+
[key in SubscriptionVariantType]: {
|
|
38
|
+
amount: number;
|
|
39
|
+
description?: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
planId: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface SubscriptionOption {
|
|
46
|
+
products: SubscriptionProductOption[];
|
|
47
|
+
variants: SubscriptionVariantOption[];
|
|
48
|
+
}
|
|
49
|
+
export declare type SubscribeAndGetPaymentUrlRequest = {
|
|
50
|
+
ip?: string;
|
|
51
|
+
storeId: string;
|
|
52
|
+
ownerCognitoUserId: string;
|
|
53
|
+
externalCustomerId: string;
|
|
54
|
+
variantType: SubscriptionVariantType;
|
|
55
|
+
subscriptionProductIds: string[];
|
|
56
|
+
startedAt: number | null;
|
|
57
|
+
autoRenew: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* 付款成功後的跳轉網址
|
|
60
|
+
* 以MyPay為例
|
|
61
|
+
* 可在產生付款網址時,決定returnUrl
|
|
62
|
+
* 若不填寫,則以MyPay特約店家後台設定的為主
|
|
63
|
+
*/
|
|
64
|
+
successReturnUrl?: string;
|
|
65
|
+
/**
|
|
66
|
+
* 付款失敗後的跳轉網址
|
|
67
|
+
* 以MyPay為例
|
|
68
|
+
* 可在產生付款網址時,決定returnUrl
|
|
69
|
+
* 若不填寫,則以MyPay特約店家後台設定的為主
|
|
70
|
+
*/
|
|
71
|
+
failureReturnUrl?: string;
|
|
72
|
+
};
|
|
73
|
+
export declare type SubscribeGetPaymentUrlResponse = {
|
|
74
|
+
payUrl: string;
|
|
75
|
+
};
|
|
76
|
+
export declare type EnableAutoRenewAndGetPaymentUrlRequest = {
|
|
77
|
+
subscriptionId: string;
|
|
78
|
+
ip?: string;
|
|
79
|
+
/**
|
|
80
|
+
* 付款成功後的跳轉網址
|
|
81
|
+
* 以MyPay為例
|
|
82
|
+
* 可在產生付款網址時,決定returnUrl
|
|
83
|
+
* 若不填寫,則以MyPay特約店家後台設定的為主
|
|
84
|
+
*/
|
|
85
|
+
successReturnUrl?: string;
|
|
86
|
+
/**
|
|
87
|
+
* 付款失敗後的跳轉網址
|
|
88
|
+
* 以MyPay為例
|
|
89
|
+
* 可在產生付款網址時,決定returnUrl
|
|
90
|
+
* 若不填寫,則以MyPay特約店家後台設定的為主
|
|
91
|
+
*/
|
|
92
|
+
failureReturnUrl?: string;
|
|
93
|
+
};
|
|
94
|
+
export declare type GetSubscriptionStatusRequest = {
|
|
95
|
+
storeId: string;
|
|
96
|
+
};
|
|
97
|
+
export declare type GetSubscriptionStatusResponse = {
|
|
98
|
+
currentSubscription: Subscription;
|
|
99
|
+
originalSubscription: Subscription;
|
|
100
|
+
upcomingSubscription: Subscription;
|
|
101
|
+
/** 反查 Posky 原加值服務是否已經付費2023年的發票。若沒有綁定Posky store_no 那一律回傳false */
|
|
102
|
+
isSubscribeInvoice2023: boolean;
|
|
103
|
+
};
|
|
104
|
+
export declare type StopSubscriptionRequest = {
|
|
105
|
+
storeId: string;
|
|
106
|
+
subscriptionId: string;
|
|
107
|
+
};
|
|
108
|
+
export declare type StopSubscriptionResponse = Subscription;
|
|
109
|
+
export declare type DeleteSubscriptionRequest = {
|
|
110
|
+
subscriptionId: string;
|
|
111
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscriptionVariantType = void 0;
|
|
4
|
+
var SubscriptionVariantType;
|
|
5
|
+
(function (SubscriptionVariantType) {
|
|
6
|
+
SubscriptionVariantType["month"] = "M";
|
|
7
|
+
SubscriptionVariantType["year"] = "Y";
|
|
8
|
+
})(SubscriptionVariantType = exports.SubscriptionVariantType || (exports.SubscriptionVariantType = {}));
|
|
9
|
+
//# sourceMappingURL=subscription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/lambda/subscription.ts"],"names":[],"mappings":";;;AAEA,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,sCAAW,CAAA;IACX,qCAAU,CAAA;AACZ,CAAC,EAHW,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,QAGlC"}
|
package/models/contract.d.ts
CHANGED
|
@@ -15,9 +15,9 @@ export declare type ContractCore = {
|
|
|
15
15
|
name: string;
|
|
16
16
|
note?: string;
|
|
17
17
|
startedAt: number;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
planId
|
|
18
|
+
endedAt: number;
|
|
19
|
+
/** planId, planIds 二選一填 */
|
|
20
|
+
planId?: string;
|
|
21
21
|
planIds?: string[];
|
|
22
22
|
storeId: string;
|
|
23
23
|
ownerCognitoUserId: string;
|
|
@@ -28,5 +28,5 @@ export declare type Contract = {
|
|
|
28
28
|
createdAt: number;
|
|
29
29
|
endedAt: number;
|
|
30
30
|
plan: Plan;
|
|
31
|
-
plans
|
|
31
|
+
plans: Plan[];
|
|
32
32
|
} & ContractCore;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trusted-solutions/sdit.models",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.2",
|
|
4
4
|
"description": "TODO: Give a short introduction of your project. Let this section explain the objectives or the motivation behind this project.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|