@molecule/api-resource-payment 1.0.0
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/LICENSE +115 -0
- package/dist/__tests__/index.test.d.ts +5 -0
- package/dist/__tests__/index.test.d.ts.map +1 -0
- package/dist/__tests__/index.test.js +85 -0
- package/dist/__tests__/index.test.js.map +1 -0
- package/dist/__tests__/planService.test.d.ts +5 -0
- package/dist/__tests__/planService.test.d.ts.map +1 -0
- package/dist/__tests__/planService.test.js +166 -0
- package/dist/__tests__/planService.test.js.map +1 -0
- package/dist/__tests__/plans.test.d.ts +5 -0
- package/dist/__tests__/plans.test.d.ts.map +1 -0
- package/dist/__tests__/plans.test.js +296 -0
- package/dist/__tests__/plans.test.js.map +1 -0
- package/dist/__tests__/recordService.test.d.ts +5 -0
- package/dist/__tests__/recordService.test.d.ts.map +1 -0
- package/dist/__tests__/recordService.test.js +214 -0
- package/dist/__tests__/recordService.test.js.map +1 -0
- package/dist/__tests__/resource.test.d.ts +5 -0
- package/dist/__tests__/resource.test.d.ts.map +1 -0
- package/dist/__tests__/resource.test.js +56 -0
- package/dist/__tests__/resource.test.js.map +1 -0
- package/dist/__tests__/schema.test.d.ts +5 -0
- package/dist/__tests__/schema.test.d.ts.map +1 -0
- package/dist/__tests__/schema.test.js +275 -0
- package/dist/__tests__/schema.test.js.map +1 -0
- package/dist/__tests__/utilities.test.d.ts +5 -0
- package/dist/__tests__/utilities.test.d.ts.map +1 -0
- package/dist/__tests__/utilities.test.js +59 -0
- package/dist/__tests__/utilities.test.js.map +1 -0
- package/dist/browser-guard.d.ts +2 -0
- package/dist/browser-guard.d.ts.map +1 -0
- package/dist/browser-guard.js +19 -0
- package/dist/browser-guard.js.map +1 -0
- package/dist/i18n.d.ts +10 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +18 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.d.ts +96 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +96 -0
- package/dist/index.js.map +1 -0
- package/dist/planService.d.ts +9 -0
- package/dist/planService.d.ts.map +1 -0
- package/dist/planService.js +53 -0
- package/dist/planService.js.map +1 -0
- package/dist/plans.d.ts +34 -0
- package/dist/plans.d.ts.map +1 -0
- package/dist/plans.js +167 -0
- package/dist/plans.js.map +1 -0
- package/dist/recordService.d.ts +33 -0
- package/dist/recordService.d.ts.map +1 -0
- package/dist/recordService.js +162 -0
- package/dist/recordService.js.map +1 -0
- package/dist/resource.d.ts +4 -0
- package/dist/resource.d.ts.map +1 -0
- package/dist/resource.js +22 -0
- package/dist/resource.js.map +1 -0
- package/dist/schema.d.ts +58 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +38 -0
- package/dist/schema.js.map +1 -0
- package/dist/types.d.ts +83 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/dist/utilities.d.ts +8 -0
- package/dist/utilities.d.ts.map +1 -0
- package/dist/utilities.js +25 -0
- package/dist/utilities.js.map +1 -0
- package/package.json +54 -0
- package/setup/payments.sql +22 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work.
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
|
+
form, that is based on (or derived from) the Work and for which the
|
|
41
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
42
|
+
represent, as a whole, an original work of authorship.
|
|
43
|
+
|
|
44
|
+
"Contribution" shall mean any work of authorship, including the
|
|
45
|
+
original version of the Work and any modifications or additions
|
|
46
|
+
to that Work, that is intentionally submitted to the Licensor for
|
|
47
|
+
inclusion in the Work by the copyright owner or by an individual or
|
|
48
|
+
Legal Entity authorized to submit on behalf of the copyright owner.
|
|
49
|
+
|
|
50
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
51
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
52
|
+
subsequently incorporated within the Work.
|
|
53
|
+
|
|
54
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
55
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
56
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
57
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
58
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
59
|
+
Work and such Derivative Works in Source or Object form.
|
|
60
|
+
|
|
61
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
62
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
63
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
64
|
+
patent license to make, have made, use, offer to sell, sell, import,
|
|
65
|
+
and otherwise transfer the Work.
|
|
66
|
+
|
|
67
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
68
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
69
|
+
modifications, and in Source or Object form, provided that You
|
|
70
|
+
meet the following conditions:
|
|
71
|
+
|
|
72
|
+
(a) You must give any other recipients of the Work or
|
|
73
|
+
Derivative Works a copy of this License; and
|
|
74
|
+
|
|
75
|
+
(b) You must cause any modified files to carry prominent notices
|
|
76
|
+
stating that You changed the files; and
|
|
77
|
+
|
|
78
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
79
|
+
that You distribute, all copyright, patent, trademark, and
|
|
80
|
+
attribution notices from the Source form of the Work,
|
|
81
|
+
excluding those notices that do not pertain to any part of
|
|
82
|
+
the Derivative Works; and
|
|
83
|
+
|
|
84
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
85
|
+
distribution, then any Derivative Works that You distribute must
|
|
86
|
+
include a readable copy of the attribution notices contained
|
|
87
|
+
within such NOTICE file.
|
|
88
|
+
|
|
89
|
+
5. Submission of Contributions.
|
|
90
|
+
|
|
91
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
92
|
+
names, trademarks, service marks, or product names of the Licensor.
|
|
93
|
+
|
|
94
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
95
|
+
agreed to in writing, Licensor provides the Work on an "AS IS" BASIS,
|
|
96
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.
|
|
97
|
+
|
|
98
|
+
8. Limitation of Liability. In no event and under no legal theory shall
|
|
99
|
+
any Contributor be liable to You for damages.
|
|
100
|
+
|
|
101
|
+
9. Accepting Warranty or Additional Liability.
|
|
102
|
+
|
|
103
|
+
Copyright 2026 Molecule Dev, Inc.
|
|
104
|
+
|
|
105
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
106
|
+
you may not use this file except in compliance with the License.
|
|
107
|
+
You may obtain a copy of the License at
|
|
108
|
+
|
|
109
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
110
|
+
|
|
111
|
+
Unless required by applicable law or agreed to in writing, software
|
|
112
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
113
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
114
|
+
See the License for the specific language governing permissions and
|
|
115
|
+
limitations under the License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/index.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for the Payment resource package exports.
|
|
3
|
+
*/
|
|
4
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
5
|
+
// Mock @molecule/api-database
|
|
6
|
+
vi.mock('@molecule/api-database', () => ({
|
|
7
|
+
query: vi.fn(),
|
|
8
|
+
}));
|
|
9
|
+
// Mock @molecule/api-bond (recordService uses getLogger and getAnalytics from api-bond)
|
|
10
|
+
vi.mock('@molecule/api-bond', () => ({
|
|
11
|
+
getAnalytics: () => ({
|
|
12
|
+
identify: vi.fn().mockResolvedValue(undefined),
|
|
13
|
+
track: vi.fn().mockResolvedValue(undefined),
|
|
14
|
+
page: vi.fn().mockResolvedValue(undefined),
|
|
15
|
+
}),
|
|
16
|
+
getLogger: () => ({
|
|
17
|
+
info: vi.fn(),
|
|
18
|
+
warn: vi.fn(),
|
|
19
|
+
error: vi.fn(),
|
|
20
|
+
debug: vi.fn(),
|
|
21
|
+
trace: vi.fn(),
|
|
22
|
+
}),
|
|
23
|
+
get: vi.fn(),
|
|
24
|
+
set: vi.fn(),
|
|
25
|
+
getAll: vi.fn(),
|
|
26
|
+
}));
|
|
27
|
+
// Mock the i18n module to avoid dynamic import of unbuilt locale packages
|
|
28
|
+
vi.mock('../i18n.js', () => ({
|
|
29
|
+
i18nRegistered: true,
|
|
30
|
+
}));
|
|
31
|
+
import * as PaymentModule from '../index.js';
|
|
32
|
+
describe('Payment package exports', () => {
|
|
33
|
+
it('should export resource', () => {
|
|
34
|
+
expect(PaymentModule.resource).toBeDefined();
|
|
35
|
+
expect(PaymentModule.resource.name).toBe('Payment');
|
|
36
|
+
expect(PaymentModule.resource.tableName).toBe('payments');
|
|
37
|
+
});
|
|
38
|
+
it('should export plans', () => {
|
|
39
|
+
expect(PaymentModule.plans).toBeDefined();
|
|
40
|
+
expect(typeof PaymentModule.plans).toBe('object');
|
|
41
|
+
});
|
|
42
|
+
it('should export individual plan definitions', () => {
|
|
43
|
+
expect(PaymentModule.stripeMonthly).toBeDefined();
|
|
44
|
+
expect(PaymentModule.stripeYearly).toBeDefined();
|
|
45
|
+
expect(PaymentModule.appleMonthly).toBeDefined();
|
|
46
|
+
expect(PaymentModule.appleYearly).toBeDefined();
|
|
47
|
+
expect(PaymentModule.googleMonthly).toBeDefined();
|
|
48
|
+
expect(PaymentModule.googleYearly).toBeDefined();
|
|
49
|
+
});
|
|
50
|
+
it('should export getPeriodTime utility', () => {
|
|
51
|
+
expect(PaymentModule.getPeriodTime).toBeDefined();
|
|
52
|
+
expect(typeof PaymentModule.getPeriodTime).toBe('function');
|
|
53
|
+
});
|
|
54
|
+
it('should export types namespace', () => {
|
|
55
|
+
expect(PaymentModule.types).toBeDefined();
|
|
56
|
+
});
|
|
57
|
+
it('should export propsSchema', () => {
|
|
58
|
+
expect(PaymentModule.propsSchema).toBeDefined();
|
|
59
|
+
expect(PaymentModule.propsSchema.safeParse).toBeDefined();
|
|
60
|
+
});
|
|
61
|
+
it('should export createPropsSchema', () => {
|
|
62
|
+
expect(PaymentModule.createPropsSchema).toBeDefined();
|
|
63
|
+
expect(PaymentModule.createPropsSchema.safeParse).toBeDefined();
|
|
64
|
+
});
|
|
65
|
+
it('should export updatePropsSchema', () => {
|
|
66
|
+
expect(PaymentModule.updatePropsSchema).toBeDefined();
|
|
67
|
+
expect(PaymentModule.updatePropsSchema.safeParse).toBeDefined();
|
|
68
|
+
});
|
|
69
|
+
it('should export planService', () => {
|
|
70
|
+
expect(PaymentModule.planService).toBeDefined();
|
|
71
|
+
expect(typeof PaymentModule.planService.findPlan).toBe('function');
|
|
72
|
+
expect(typeof PaymentModule.planService.findPlanByProductId).toBe('function');
|
|
73
|
+
expect(typeof PaymentModule.planService.getDefaultPlan).toBe('function');
|
|
74
|
+
expect(typeof PaymentModule.planService.getAllPlans).toBe('function');
|
|
75
|
+
});
|
|
76
|
+
it('should export paymentRecordService', () => {
|
|
77
|
+
expect(PaymentModule.paymentRecordService).toBeDefined();
|
|
78
|
+
expect(typeof PaymentModule.paymentRecordService.store).toBe('function');
|
|
79
|
+
expect(typeof PaymentModule.paymentRecordService.findByTransaction).toBe('function');
|
|
80
|
+
expect(typeof PaymentModule.paymentRecordService.findByCustomerData).toBe('function');
|
|
81
|
+
expect(typeof PaymentModule.paymentRecordService.findByUserId).toBe('function');
|
|
82
|
+
expect(typeof PaymentModule.paymentRecordService.deleteByUserId).toBe('function');
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
//# sourceMappingURL=index.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../src/__tests__/index.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAEjD,8BAA8B;AAC9B,EAAE,CAAC,IAAI,CAAC,wBAAwB,EAAE,GAAG,EAAE,CAAC,CAAC;IACvC,KAAK,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,CAAA;QACxD,MAAM,CAAC,OAAO,aAAa,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QACxE,MAAM,CAAC,OAAO,aAAa,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QACpF,MAAM,CAAC,OAAO,aAAa,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QACrF,MAAM,CAAC,OAAO,aAAa,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QAC/E,MAAM,CAAC,OAAO,aAAa,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IACnF,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planService.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/planService.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for the planService (PlanService bond implementation).
|
|
3
|
+
*/
|
|
4
|
+
import { describe, expect, it } from 'vitest';
|
|
5
|
+
import { appleMonthly, appleYearly, googleMonthly, googleYearly, plans, registerPlans, stripeMonthly, stripeYearly, } from '../plans.js';
|
|
6
|
+
import { planService } from '../planService.js';
|
|
7
|
+
describe('planService.findPlan', () => {
|
|
8
|
+
it('should find the default plan by empty string key', () => {
|
|
9
|
+
const result = planService.findPlan('');
|
|
10
|
+
expect(result).not.toBeNull();
|
|
11
|
+
expect(result.planKey).toBe('');
|
|
12
|
+
expect(result.title).toBe('Free');
|
|
13
|
+
});
|
|
14
|
+
it('should find stripeMonthly by key', () => {
|
|
15
|
+
const result = planService.findPlan('stripeMonthly');
|
|
16
|
+
expect(result).not.toBeNull();
|
|
17
|
+
expect(result).toBe(stripeMonthly);
|
|
18
|
+
});
|
|
19
|
+
it('should find stripeYearly by key', () => {
|
|
20
|
+
const result = planService.findPlan('stripeYearly');
|
|
21
|
+
expect(result).not.toBeNull();
|
|
22
|
+
expect(result).toBe(stripeYearly);
|
|
23
|
+
});
|
|
24
|
+
it('should find appleMonthly by key', () => {
|
|
25
|
+
const result = planService.findPlan('appleMonthly');
|
|
26
|
+
expect(result).not.toBeNull();
|
|
27
|
+
expect(result).toBe(appleMonthly);
|
|
28
|
+
});
|
|
29
|
+
it('should find appleYearly by key', () => {
|
|
30
|
+
const result = planService.findPlan('appleYearly');
|
|
31
|
+
expect(result).not.toBeNull();
|
|
32
|
+
expect(result).toBe(appleYearly);
|
|
33
|
+
});
|
|
34
|
+
it('should find googleMonthly by key', () => {
|
|
35
|
+
const result = planService.findPlan('googleMonthly');
|
|
36
|
+
expect(result).not.toBeNull();
|
|
37
|
+
expect(result).toBe(googleMonthly);
|
|
38
|
+
});
|
|
39
|
+
it('should find googleYearly by key', () => {
|
|
40
|
+
const result = planService.findPlan('googleYearly');
|
|
41
|
+
expect(result).not.toBeNull();
|
|
42
|
+
expect(result).toBe(googleYearly);
|
|
43
|
+
});
|
|
44
|
+
it('should return null for a nonexistent plan key', () => {
|
|
45
|
+
const result = planService.findPlan('nonexistent');
|
|
46
|
+
expect(result).toBeNull();
|
|
47
|
+
});
|
|
48
|
+
it('should return null for undefined-like keys', () => {
|
|
49
|
+
const result = planService.findPlan('undefined');
|
|
50
|
+
expect(result).toBeNull();
|
|
51
|
+
});
|
|
52
|
+
it('should be case-sensitive', () => {
|
|
53
|
+
const result = planService.findPlan('STRIPEMONTHLY');
|
|
54
|
+
expect(result).toBeNull();
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
describe('planService.findPlanByProductId', () => {
|
|
58
|
+
it('should find stripeMonthly by productId', () => {
|
|
59
|
+
const result = planService.findPlanByProductId(stripeMonthly.platformProductId);
|
|
60
|
+
expect(result).not.toBeNull();
|
|
61
|
+
expect(result.planKey).toBe('stripeMonthly');
|
|
62
|
+
});
|
|
63
|
+
it('should find appleMonthly by productId', () => {
|
|
64
|
+
const result = planService.findPlanByProductId('molecule_monthly_early_adopter');
|
|
65
|
+
expect(result).not.toBeNull();
|
|
66
|
+
expect(result.planKey).toBe('appleMonthly');
|
|
67
|
+
});
|
|
68
|
+
it('should find appleYearly by productId', () => {
|
|
69
|
+
const result = planService.findPlanByProductId('molecule_yearly_early_adopter');
|
|
70
|
+
expect(result).not.toBeNull();
|
|
71
|
+
expect(result.planKey).toBe('appleYearly');
|
|
72
|
+
});
|
|
73
|
+
it('should find googleMonthly by productId', () => {
|
|
74
|
+
const result = planService.findPlanByProductId('monthly_early_adopter');
|
|
75
|
+
expect(result).not.toBeNull();
|
|
76
|
+
expect(result.planKey).toBe('googleMonthly');
|
|
77
|
+
});
|
|
78
|
+
it('should find googleYearly by productId', () => {
|
|
79
|
+
const result = planService.findPlanByProductId('yearly_early_adopter');
|
|
80
|
+
expect(result).not.toBeNull();
|
|
81
|
+
expect(result.planKey).toBe('googleYearly');
|
|
82
|
+
});
|
|
83
|
+
it('should return null for a nonexistent productId', () => {
|
|
84
|
+
const result = planService.findPlanByProductId('nonexistent_product');
|
|
85
|
+
expect(result).toBeNull();
|
|
86
|
+
});
|
|
87
|
+
it('should return null for an empty string productId', () => {
|
|
88
|
+
// The default (free) plan's platformProductId is '' — but an EMPTY
|
|
89
|
+
// platform identifier from a provider must never resolve to a plan
|
|
90
|
+
// grant. Matching '' against the free plan was an accident of the old
|
|
91
|
+
// `===` comparison; findPlanByProductId now explicitly rejects empty
|
|
92
|
+
// input and empty platformProductId values.
|
|
93
|
+
const result = planService.findPlanByProductId('');
|
|
94
|
+
expect(result).toBeNull();
|
|
95
|
+
});
|
|
96
|
+
it('should find a plan by a registered platform PRICE id', () => {
|
|
97
|
+
registerPlans({
|
|
98
|
+
customPro: {
|
|
99
|
+
planKey: 'customPro',
|
|
100
|
+
platformKey: 'stripe',
|
|
101
|
+
platformProductId: '',
|
|
102
|
+
platformPriceIds: ['price_custom_pro_monthly'],
|
|
103
|
+
alias: 'monthly',
|
|
104
|
+
period: 'month',
|
|
105
|
+
price: '$12',
|
|
106
|
+
autoRenews: true,
|
|
107
|
+
title: 'Pro',
|
|
108
|
+
titleKey: '',
|
|
109
|
+
description: 'Pro',
|
|
110
|
+
descriptionKey: '',
|
|
111
|
+
capabilities: { premium: true },
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
const result = planService.findPlanByProductId('price_custom_pro_monthly');
|
|
115
|
+
expect(result).not.toBeNull();
|
|
116
|
+
expect(result.planKey).toBe('customPro');
|
|
117
|
+
// An empty platformProductId on the registered plan must not match ''.
|
|
118
|
+
expect(planService.findPlanByProductId('')).toBeNull();
|
|
119
|
+
delete plans.customPro;
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
describe('planService.getDefaultPlan', () => {
|
|
123
|
+
it('should return the default (free) plan', () => {
|
|
124
|
+
const result = planService.getDefaultPlan();
|
|
125
|
+
expect(result).not.toBeNull();
|
|
126
|
+
expect(result.planKey).toBe('');
|
|
127
|
+
expect(result.title).toBe('Free');
|
|
128
|
+
expect(result.capabilities.premium).toBe(false);
|
|
129
|
+
});
|
|
130
|
+
it('should return the same plan as findPlan with empty string', () => {
|
|
131
|
+
const defaultPlan = planService.getDefaultPlan();
|
|
132
|
+
const foundPlan = planService.findPlan('');
|
|
133
|
+
expect(defaultPlan).toBe(foundPlan);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
describe('planService.getAllPlans', () => {
|
|
137
|
+
it('should return all plans', () => {
|
|
138
|
+
const result = planService.getAllPlans();
|
|
139
|
+
expect(result).toHaveLength(7);
|
|
140
|
+
});
|
|
141
|
+
it('should return an array', () => {
|
|
142
|
+
const result = planService.getAllPlans();
|
|
143
|
+
expect(Array.isArray(result)).toBe(true);
|
|
144
|
+
});
|
|
145
|
+
it('should contain the default plan', () => {
|
|
146
|
+
const result = planService.getAllPlans();
|
|
147
|
+
const defaultPlan = result.find((p) => p.planKey === '');
|
|
148
|
+
expect(defaultPlan).toBeDefined();
|
|
149
|
+
});
|
|
150
|
+
it('should contain all platform plans', () => {
|
|
151
|
+
const result = planService.getAllPlans();
|
|
152
|
+
const planKeys = result.map((p) => p.planKey);
|
|
153
|
+
expect(planKeys).toContain('stripeMonthly');
|
|
154
|
+
expect(planKeys).toContain('stripeYearly');
|
|
155
|
+
expect(planKeys).toContain('appleMonthly');
|
|
156
|
+
expect(planKeys).toContain('appleYearly');
|
|
157
|
+
expect(planKeys).toContain('googleMonthly');
|
|
158
|
+
expect(planKeys).toContain('googleYearly');
|
|
159
|
+
});
|
|
160
|
+
it('should return plans that match the plans record', () => {
|
|
161
|
+
const result = planService.getAllPlans();
|
|
162
|
+
const planValues = Object.values(plans);
|
|
163
|
+
expect(result).toEqual(planValues);
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
//# sourceMappingURL=planService.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planService.test.js","sourceRoot":"","sources":["../../src/__tests__/planService.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EACL,YAAY,EACZ,WAAW,EACX,aAAa,EACb,YAAY,EACZ,KAAK,EACL,aAAa,EACb,aAAa,EACb,YAAY,GACb,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,MAAM,GAAG,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;QACvC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;QAC7B,MAAM,CAAC,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