@lssm/example.saas-boilerplate 0.0.0-canary-20251217054315 → 0.0.0-canary-20251217060433

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.
@@ -0,0 +1,69 @@
1
+
2
+ $ tsdown
3
+ ℹ tsdown v0.17.4 powered by rolldown v1.0.0-beta.53
4
+ ℹ config file: /Users/tboutron/Documents/clients/lssm/monorepo-lssm/packages/contractspec/packages/examples/saas-boilerplate/tsdown.config.js (unrun)
5
+ ℹ entry: src/example.ts, src/index.ts, src/saas-boilerplate.feature.ts, src/billing/billing.contracts.ts, src/billing/billing.entity.ts, src/billing/billing.enum.ts, src/billing/billing.event.ts, src/billing/billing.handler.ts, src/billing/billing.presentation.ts, src/billing/billing.schema.ts, src/billing/index.ts, src/dashboard/dashboard.presentation.ts, src/dashboard/index.ts, src/docs/index.ts, src/docs/saas-boilerplate.docblock.ts, src/handlers/index.ts, src/presentations/index.ts, src/project/index.ts, src/project/project.contracts.ts, src/project/project.entity.ts, src/project/project.enum.ts, src/project/project.event.ts, src/project/project.handler.ts, src/project/project.presentation.ts, src/project/project.schema.ts, src/settings/index.ts, src/settings/settings.entity.ts, src/settings/settings.enum.ts, src/shared/mock-data.ts
6
+ ℹ target: esnext
7
+ ℹ tsconfig: tsconfig.json
8
+ ℹ Build start
9
+ ℹ Cleaning 66 files
10
+ ℹ dist/index.js  5.04 kB │ gzip: 1.28 kB
11
+ ℹ dist/docs/saas-boilerplate.docblock.js  3.46 kB │ gzip: 1.38 kB
12
+ ℹ dist/project/project.contracts.js  2.78 kB │ gzip: 0.94 kB
13
+ ℹ dist/billing/billing.schema.js  2.73 kB │ gzip: 0.70 kB
14
+ ℹ dist/billing/billing.entity.js  2.57 kB │ gzip: 0.94 kB
15
+ ℹ dist/project/project.schema.js  2.57 kB │ gzip: 0.59 kB
16
+ ℹ dist/shared/mock-data.js  2.06 kB │ gzip: 0.78 kB
17
+ ℹ dist/saas-boilerplate.feature.js  2.00 kB │ gzip: 0.52 kB
18
+ ℹ dist/project/index.js  1.87 kB │ gzip: 0.50 kB
19
+ ℹ dist/billing/index.js  1.87 kB │ gzip: 0.51 kB
20
+ ℹ dist/billing/billing.contracts.js  1.86 kB │ gzip: 0.69 kB
21
+ ℹ dist/project/project.event.js  1.80 kB │ gzip: 0.45 kB
22
+ ℹ dist/billing/billing.event.js  1.65 kB │ gzip: 0.49 kB
23
+ ℹ dist/project/project.entity.js  1.64 kB │ gzip: 0.67 kB
24
+ ℹ dist/settings/settings.entity.js  1.49 kB │ gzip: 0.63 kB
25
+ ℹ dist/project/project.handler.js  1.43 kB │ gzip: 0.65 kB
26
+ ℹ dist/project/project.presentation.js  0.84 kB │ gzip: 0.38 kB
27
+ ℹ dist/billing/billing.presentation.js  0.77 kB │ gzip: 0.32 kB
28
+ ℹ dist/presentations/index.js  0.76 kB │ gzip: 0.25 kB
29
+ ℹ dist/billing/billing.handler.js  0.72 kB │ gzip: 0.42 kB
30
+ ℹ dist/dashboard/dashboard.presentation.js  0.71 kB │ gzip: 0.33 kB
31
+ ℹ dist/handlers/index.js  0.64 kB │ gzip: 0.23 kB
32
+ ℹ dist/example.js  0.63 kB │ gzip: 0.38 kB
33
+ ℹ dist/billing/billing.enum.js  0.29 kB │ gzip: 0.22 kB
34
+ ℹ dist/project/project.enum.js  0.24 kB │ gzip: 0.17 kB
35
+ ℹ dist/settings/settings.enum.js  0.21 kB │ gzip: 0.18 kB
36
+ ℹ dist/settings/index.js  0.21 kB │ gzip: 0.13 kB
37
+ ℹ dist/dashboard/index.js  0.17 kB │ gzip: 0.11 kB
38
+ ℹ dist/docs/index.js  0.04 kB │ gzip: 0.06 kB
39
+ ℹ dist/project/project.contracts.d.ts 10.87 kB │ gzip: 0.84 kB
40
+ ℹ dist/project/project.schema.d.ts  6.08 kB │ gzip: 0.73 kB
41
+ ℹ dist/billing/billing.schema.d.ts  5.20 kB │ gzip: 0.76 kB
42
+ ℹ dist/index.d.ts  4.98 kB │ gzip: 1.03 kB
43
+ ℹ dist/billing/billing.contracts.d.ts  4.49 kB │ gzip: 0.74 kB
44
+ ℹ dist/billing/billing.entity.d.ts  2.61 kB │ gzip: 0.49 kB
45
+ ℹ dist/project/project.event.d.ts  2.50 kB │ gzip: 0.41 kB
46
+ ℹ dist/billing/billing.event.d.ts  2.33 kB │ gzip: 0.46 kB
47
+ ℹ dist/billing/billing.handler.d.ts  2.07 kB │ gzip: 0.69 kB
48
+ ℹ dist/billing/index.d.ts  1.90 kB │ gzip: 0.42 kB
49
+ ℹ dist/project/project.handler.d.ts  1.89 kB │ gzip: 0.51 kB
50
+ ℹ dist/project/index.d.ts  1.87 kB │ gzip: 0.40 kB
51
+ ℹ dist/shared/mock-data.d.ts  1.64 kB │ gzip: 0.48 kB
52
+ ℹ dist/project/project.entity.d.ts  1.54 kB │ gzip: 0.39 kB
53
+ ℹ dist/settings/settings.entity.d.ts  1.46 kB │ gzip: 0.34 kB
54
+ ℹ dist/example.d.ts  1.13 kB │ gzip: 0.46 kB
55
+ ℹ dist/presentations/index.d.ts  0.86 kB │ gzip: 0.26 kB
56
+ ℹ dist/handlers/index.d.ts  0.58 kB │ gzip: 0.20 kB
57
+ ℹ dist/project/project.enum.d.ts  0.56 kB │ gzip: 0.27 kB
58
+ ℹ dist/billing/billing.enum.d.ts  0.56 kB │ gzip: 0.28 kB
59
+ ℹ dist/dashboard/dashboard.presentation.d.ts  0.43 kB │ gzip: 0.21 kB
60
+ ℹ dist/project/project.presentation.d.ts  0.43 kB │ gzip: 0.21 kB
61
+ ℹ dist/billing/billing.presentation.d.ts  0.42 kB │ gzip: 0.20 kB
62
+ ℹ dist/saas-boilerplate.feature.d.ts  0.35 kB │ gzip: 0.23 kB
63
+ ℹ dist/settings/settings.enum.d.ts  0.24 kB │ gzip: 0.17 kB
64
+ ℹ dist/settings/index.d.ts  0.19 kB │ gzip: 0.11 kB
65
+ ℹ dist/dashboard/index.d.ts  0.16 kB │ gzip: 0.10 kB
66
+ ℹ dist/docs/index.d.ts  0.01 kB │ gzip: 0.03 kB
67
+ ℹ dist/docs/saas-boilerplate.docblock.d.ts  0.01 kB │ gzip: 0.03 kB
68
+ ℹ 58 files, total: 100.44 kB
69
+ ✔ Build complete in 8911ms
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @lssm/example.saas-boilerplate
2
2
 
3
- ## 0.0.0-canary-20251217054315
3
+ ## 0.0.0-canary-20251217060433
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -9,44 +9,10 @@
9
9
  ### Patch Changes
10
10
 
11
11
  - Updated dependencies [66a5dfd]
12
- - @lssm/lib.bus@0.0.0-canary-20251217054315
13
- - @lssm/lib.contracts@0.0.0-canary-20251217054315
14
- - @lssm/lib.identity-rbac@0.0.0-canary-20251217054315
15
- - @lssm/lib.jobs@0.0.0-canary-20251217054315
16
- - @lssm/lib.schema@0.0.0-canary-20251217054315
17
- - @lssm/module.audit-trail@0.0.0-canary-20251217054315
18
- - @lssm/module.notifications@0.0.0-canary-20251217054315
19
-
20
- ## 1.42.0
21
-
22
- ### Minor Changes
23
-
24
- - 66a5dfd: initial release
25
-
26
- ### Patch Changes
27
-
28
- - Updated dependencies [66a5dfd]
29
- - @lssm/lib.bus@1.42.0
30
- - @lssm/lib.contracts@1.42.0
31
- - @lssm/lib.identity-rbac@1.42.0
32
- - @lssm/lib.jobs@1.42.0
33
- - @lssm/lib.schema@1.42.0
34
- - @lssm/module.audit-trail@1.42.0
35
- - @lssm/module.notifications@1.42.0
36
-
37
- ## 0.0.0-canary-20251217053014
38
-
39
- ### Minor Changes
40
-
41
- - 66a5dfd: initial release
42
-
43
- ### Patch Changes
44
-
45
- - Updated dependencies [66a5dfd]
46
- - @lssm/lib.bus@0.0.0-canary-20251217053014
47
- - @lssm/lib.contracts@0.0.0-canary-20251217053014
48
- - @lssm/lib.identity-rbac@0.0.0-canary-20251217053014
49
- - @lssm/lib.jobs@0.0.0-canary-20251217053014
50
- - @lssm/lib.schema@0.0.0-canary-20251217053014
51
- - @lssm/module.audit-trail@0.0.0-canary-20251217053014
52
- - @lssm/module.notifications@0.0.0-canary-20251217053014
12
+ - @lssm/lib.bus@0.0.0-canary-20251217060433
13
+ - @lssm/lib.contracts@0.0.0-canary-20251217060433
14
+ - @lssm/lib.identity-rbac@0.0.0-canary-20251217060433
15
+ - @lssm/lib.jobs@0.0.0-canary-20251217060433
16
+ - @lssm/lib.schema@0.0.0-canary-20251217060433
17
+ - @lssm/module.audit-trail@0.0.0-canary-20251217060433
18
+ - @lssm/module.notifications@0.0.0-canary-20251217060433
@@ -0,0 +1,165 @@
1
+ import * as _lssm_lib_schema45 from "@lssm/lib.schema";
2
+ import * as _lssm_lib_contracts0 from "@lssm/lib.contracts";
3
+
4
+ //#region src/billing/billing.contracts.d.ts
5
+ /**
6
+ * Get subscription status.
7
+ */
8
+ declare const GetSubscriptionContract: _lssm_lib_contracts0.ContractSpec<_lssm_lib_schema45.AnySchemaModel, _lssm_lib_schema45.SchemaModel<{
9
+ id: {
10
+ type: _lssm_lib_schema45.FieldType<string, string>;
11
+ isOptional: false;
12
+ };
13
+ organizationId: {
14
+ type: _lssm_lib_schema45.FieldType<string, string>;
15
+ isOptional: false;
16
+ };
17
+ planId: {
18
+ type: _lssm_lib_schema45.FieldType<string, string>;
19
+ isOptional: false;
20
+ };
21
+ planName: {
22
+ type: _lssm_lib_schema45.FieldType<string, string>;
23
+ isOptional: false;
24
+ };
25
+ status: {
26
+ type: _lssm_lib_schema45.EnumType<[string, string, string, string, string]>;
27
+ isOptional: false;
28
+ };
29
+ currentPeriodStart: {
30
+ type: _lssm_lib_schema45.FieldType<Date, string>;
31
+ isOptional: false;
32
+ };
33
+ currentPeriodEnd: {
34
+ type: _lssm_lib_schema45.FieldType<Date, string>;
35
+ isOptional: false;
36
+ };
37
+ trialEndsAt: {
38
+ type: _lssm_lib_schema45.FieldType<Date, string>;
39
+ isOptional: true;
40
+ };
41
+ cancelAtPeriodEnd: {
42
+ type: _lssm_lib_schema45.FieldType<boolean, boolean>;
43
+ isOptional: false;
44
+ };
45
+ }>, undefined>;
46
+ /**
47
+ * Record feature usage.
48
+ */
49
+ declare const RecordUsageContract: _lssm_lib_contracts0.ContractSpec<_lssm_lib_schema45.SchemaModel<{
50
+ feature: {
51
+ type: _lssm_lib_schema45.FieldType<string, string>;
52
+ isOptional: false;
53
+ };
54
+ quantity: {
55
+ type: _lssm_lib_schema45.FieldType<number, number>;
56
+ isOptional: false;
57
+ };
58
+ sourceId: {
59
+ type: _lssm_lib_schema45.FieldType<string, string>;
60
+ isOptional: true;
61
+ };
62
+ sourceType: {
63
+ type: _lssm_lib_schema45.FieldType<string, string>;
64
+ isOptional: true;
65
+ };
66
+ metadata: {
67
+ type: _lssm_lib_schema45.FieldType<Record<string, unknown>, Record<string, unknown>>;
68
+ isOptional: true;
69
+ };
70
+ }>, _lssm_lib_schema45.SchemaModel<{
71
+ recorded: {
72
+ type: _lssm_lib_schema45.FieldType<boolean, boolean>;
73
+ isOptional: false;
74
+ };
75
+ currentUsage: {
76
+ type: _lssm_lib_schema45.FieldType<number, number>;
77
+ isOptional: false;
78
+ };
79
+ limit: {
80
+ type: _lssm_lib_schema45.FieldType<number, number>;
81
+ isOptional: true;
82
+ };
83
+ limitReached: {
84
+ type: _lssm_lib_schema45.FieldType<boolean, boolean>;
85
+ isOptional: false;
86
+ };
87
+ }>, {
88
+ name: string;
89
+ version: number;
90
+ when: string;
91
+ payload: _lssm_lib_schema45.SchemaModel<{
92
+ feature: {
93
+ type: _lssm_lib_schema45.FieldType<string, string>;
94
+ isOptional: false;
95
+ };
96
+ quantity: {
97
+ type: _lssm_lib_schema45.FieldType<number, number>;
98
+ isOptional: false;
99
+ };
100
+ }>;
101
+ }[]>;
102
+ /**
103
+ * Get usage summary.
104
+ */
105
+ declare const GetUsageSummaryContract: _lssm_lib_contracts0.ContractSpec<_lssm_lib_schema45.SchemaModel<{
106
+ billingPeriod: {
107
+ type: _lssm_lib_schema45.FieldType<string, string>;
108
+ isOptional: true;
109
+ };
110
+ }>, _lssm_lib_schema45.SchemaModel<{
111
+ billingPeriod: {
112
+ type: _lssm_lib_schema45.FieldType<string, string>;
113
+ isOptional: false;
114
+ };
115
+ usage: {
116
+ type: _lssm_lib_schema45.SchemaModel<{
117
+ feature: {
118
+ type: _lssm_lib_schema45.FieldType<string, string>;
119
+ isOptional: false;
120
+ };
121
+ used: {
122
+ type: _lssm_lib_schema45.FieldType<number, number>;
123
+ isOptional: false;
124
+ };
125
+ limit: {
126
+ type: _lssm_lib_schema45.FieldType<number, number>;
127
+ isOptional: true;
128
+ };
129
+ unit: {
130
+ type: _lssm_lib_schema45.FieldType<string, string>;
131
+ isOptional: true;
132
+ };
133
+ percentage: {
134
+ type: _lssm_lib_schema45.FieldType<number, number>;
135
+ isOptional: true;
136
+ };
137
+ }>;
138
+ isArray: true;
139
+ isOptional: false;
140
+ };
141
+ }>, undefined>;
142
+ /**
143
+ * Check feature access.
144
+ */
145
+ declare const CheckFeatureAccessContract: _lssm_lib_contracts0.ContractSpec<_lssm_lib_schema45.SchemaModel<{
146
+ feature: {
147
+ type: _lssm_lib_schema45.FieldType<string, string>;
148
+ isOptional: false;
149
+ };
150
+ }>, _lssm_lib_schema45.SchemaModel<{
151
+ hasAccess: {
152
+ type: _lssm_lib_schema45.FieldType<boolean, boolean>;
153
+ isOptional: false;
154
+ };
155
+ reason: {
156
+ type: _lssm_lib_schema45.EnumType<[string, string, string, string]>;
157
+ isOptional: true;
158
+ };
159
+ upgradeUrl: {
160
+ type: _lssm_lib_schema45.FieldType<string, string>;
161
+ isOptional: true;
162
+ };
163
+ }>, undefined>;
164
+ //#endregion
165
+ export { CheckFeatureAccessContract, GetSubscriptionContract, GetUsageSummaryContract, RecordUsageContract };
@@ -0,0 +1,60 @@
1
+ import * as _lssm_lib_schema128 from "@lssm/lib.schema";
2
+
3
+ //#region src/billing/billing.entity.d.ts
4
+ /**
5
+ * Subscription status enum for entities.
6
+ */
7
+ declare const SubscriptionStatusEnum: _lssm_lib_schema128.EntityEnumDef;
8
+ /**
9
+ * Subscription entity - organization subscription info.
10
+ */
11
+ declare const SubscriptionEntity: _lssm_lib_schema128.EntitySpec<{
12
+ id: _lssm_lib_schema128.EntityScalarField;
13
+ organizationId: _lssm_lib_schema128.EntityScalarField;
14
+ planId: _lssm_lib_schema128.EntityScalarField;
15
+ planName: _lssm_lib_schema128.EntityScalarField;
16
+ status: _lssm_lib_schema128.EntityEnumField;
17
+ currentPeriodStart: _lssm_lib_schema128.EntityScalarField;
18
+ currentPeriodEnd: _lssm_lib_schema128.EntityScalarField;
19
+ trialEndsAt: _lssm_lib_schema128.EntityScalarField;
20
+ cancelAtPeriodEnd: _lssm_lib_schema128.EntityScalarField;
21
+ canceledAt: _lssm_lib_schema128.EntityScalarField;
22
+ stripeSubscriptionId: _lssm_lib_schema128.EntityScalarField;
23
+ stripeCustomerId: _lssm_lib_schema128.EntityScalarField;
24
+ metadata: _lssm_lib_schema128.EntityScalarField;
25
+ createdAt: _lssm_lib_schema128.EntityScalarField;
26
+ updatedAt: _lssm_lib_schema128.EntityScalarField;
27
+ }>;
28
+ /**
29
+ * BillingUsage entity - track feature usage.
30
+ */
31
+ declare const BillingUsageEntity: _lssm_lib_schema128.EntitySpec<{
32
+ id: _lssm_lib_schema128.EntityScalarField;
33
+ organizationId: _lssm_lib_schema128.EntityScalarField;
34
+ feature: _lssm_lib_schema128.EntityScalarField;
35
+ quantity: _lssm_lib_schema128.EntityScalarField;
36
+ unit: _lssm_lib_schema128.EntityScalarField;
37
+ billingPeriod: _lssm_lib_schema128.EntityScalarField;
38
+ recordedAt: _lssm_lib_schema128.EntityScalarField;
39
+ sourceId: _lssm_lib_schema128.EntityScalarField;
40
+ sourceType: _lssm_lib_schema128.EntityScalarField;
41
+ metadata: _lssm_lib_schema128.EntityScalarField;
42
+ }>;
43
+ /**
44
+ * UsageLimit entity - feature usage limits per plan.
45
+ */
46
+ declare const UsageLimitEntity: _lssm_lib_schema128.EntitySpec<{
47
+ id: _lssm_lib_schema128.EntityScalarField;
48
+ planId: _lssm_lib_schema128.EntityScalarField;
49
+ organizationId: _lssm_lib_schema128.EntityScalarField;
50
+ feature: _lssm_lib_schema128.EntityScalarField;
51
+ limit: _lssm_lib_schema128.EntityScalarField;
52
+ resetPeriod: _lssm_lib_schema128.EntityScalarField;
53
+ isSoftLimit: _lssm_lib_schema128.EntityScalarField;
54
+ overage: _lssm_lib_schema128.EntityScalarField;
55
+ overageRate: _lssm_lib_schema128.EntityScalarField;
56
+ createdAt: _lssm_lib_schema128.EntityScalarField;
57
+ updatedAt: _lssm_lib_schema128.EntityScalarField;
58
+ }>;
59
+ //#endregion
60
+ export { BillingUsageEntity, SubscriptionEntity, SubscriptionStatusEnum, UsageLimitEntity };
@@ -0,0 +1,15 @@
1
+ import * as _lssm_lib_schema269 from "@lssm/lib.schema";
2
+
3
+ //#region src/billing/billing.enum.d.ts
4
+
5
+ /**
6
+ * Subscription status enum for contract schemas.
7
+ * Note: Entity enum is defined separately in billing.entity.ts
8
+ */
9
+ declare const SubscriptionStatusSchemaEnum: _lssm_lib_schema269.EnumType<[string, string, string, string, string]>;
10
+ /**
11
+ * Feature access reason enum.
12
+ */
13
+ declare const FeatureAccessReasonEnum: _lssm_lib_schema269.EnumType<[string, string, string, string]>;
14
+ //#endregion
15
+ export { FeatureAccessReasonEnum, SubscriptionStatusSchemaEnum };
@@ -0,0 +1,85 @@
1
+ import * as _lssm_lib_schema86 from "@lssm/lib.schema";
2
+ import * as _lssm_lib_contracts3 from "@lssm/lib.contracts";
3
+
4
+ //#region src/billing/billing.event.d.ts
5
+ /**
6
+ * Event: Feature usage has been recorded.
7
+ */
8
+ declare const UsageRecordedEvent: _lssm_lib_contracts3.EventSpec<_lssm_lib_schema86.SchemaModel<{
9
+ organizationId: {
10
+ type: _lssm_lib_schema86.FieldType<string, string>;
11
+ isOptional: false;
12
+ };
13
+ feature: {
14
+ type: _lssm_lib_schema86.FieldType<string, string>;
15
+ isOptional: false;
16
+ };
17
+ quantity: {
18
+ type: _lssm_lib_schema86.FieldType<number, number>;
19
+ isOptional: false;
20
+ };
21
+ billingPeriod: {
22
+ type: _lssm_lib_schema86.FieldType<string, string>;
23
+ isOptional: false;
24
+ };
25
+ recordedAt: {
26
+ type: _lssm_lib_schema86.FieldType<Date, string>;
27
+ isOptional: false;
28
+ };
29
+ }>>;
30
+ /**
31
+ * Event: Usage limit has been reached for a feature.
32
+ */
33
+ declare const UsageLimitReachedEvent: _lssm_lib_contracts3.EventSpec<_lssm_lib_schema86.SchemaModel<{
34
+ organizationId: {
35
+ type: _lssm_lib_schema86.FieldType<string, string>;
36
+ isOptional: false;
37
+ };
38
+ feature: {
39
+ type: _lssm_lib_schema86.FieldType<string, string>;
40
+ isOptional: false;
41
+ };
42
+ limit: {
43
+ type: _lssm_lib_schema86.FieldType<number, number>;
44
+ isOptional: false;
45
+ };
46
+ currentUsage: {
47
+ type: _lssm_lib_schema86.FieldType<number, number>;
48
+ isOptional: false;
49
+ };
50
+ reachedAt: {
51
+ type: _lssm_lib_schema86.FieldType<Date, string>;
52
+ isOptional: false;
53
+ };
54
+ }>>;
55
+ /**
56
+ * Event: Subscription status has changed.
57
+ */
58
+ declare const SubscriptionChangedEvent: _lssm_lib_contracts3.EventSpec<_lssm_lib_schema86.SchemaModel<{
59
+ organizationId: {
60
+ type: _lssm_lib_schema86.FieldType<string, string>;
61
+ isOptional: false;
62
+ };
63
+ previousPlan: {
64
+ type: _lssm_lib_schema86.FieldType<string, string>;
65
+ isOptional: true;
66
+ };
67
+ newPlan: {
68
+ type: _lssm_lib_schema86.FieldType<string, string>;
69
+ isOptional: false;
70
+ };
71
+ previousStatus: {
72
+ type: _lssm_lib_schema86.FieldType<string, string>;
73
+ isOptional: true;
74
+ };
75
+ newStatus: {
76
+ type: _lssm_lib_schema86.FieldType<string, string>;
77
+ isOptional: false;
78
+ };
79
+ changedAt: {
80
+ type: _lssm_lib_schema86.FieldType<Date, string>;
81
+ isOptional: false;
82
+ };
83
+ }>>;
84
+ //#endregion
85
+ export { SubscriptionChangedEvent, UsageLimitReachedEvent, UsageRecordedEvent };
@@ -0,0 +1,81 @@
1
+ //#region src/billing/billing.handler.d.ts
2
+ interface Subscription {
3
+ id: string;
4
+ organizationId: string;
5
+ planId: string;
6
+ planName: string;
7
+ status: 'ACTIVE' | 'TRIALING' | 'PAST_DUE' | 'CANCELED' | 'UNPAID';
8
+ currentPeriodStart: Date;
9
+ currentPeriodEnd: Date;
10
+ limits: {
11
+ projects: number;
12
+ users: number;
13
+ storage: number;
14
+ apiCalls: number;
15
+ };
16
+ usage: {
17
+ projects: number;
18
+ users: number;
19
+ storage: number;
20
+ apiCalls: number;
21
+ };
22
+ }
23
+ interface UsageSummary {
24
+ organizationId: string;
25
+ period: string;
26
+ apiCalls: {
27
+ total: number;
28
+ limit: number;
29
+ percentUsed: number;
30
+ };
31
+ storage: {
32
+ totalGb: number;
33
+ limitGb: number;
34
+ percentUsed: number;
35
+ };
36
+ activeProjects: number;
37
+ activeUsers: number;
38
+ breakdown: {
39
+ date: string;
40
+ apiCalls: number;
41
+ storageGb: number;
42
+ }[];
43
+ }
44
+ interface RecordUsageInput {
45
+ metric: string;
46
+ quantity: number;
47
+ timestamp?: Date;
48
+ metadata?: Record<string, unknown>;
49
+ }
50
+ interface CheckFeatureAccessInput {
51
+ feature: string;
52
+ }
53
+ interface CheckFeatureAccessOutput {
54
+ allowed: boolean;
55
+ reason?: 'PLAN_LIMIT' | 'FEATURE_NOT_INCLUDED' | 'QUOTA_EXCEEDED' | 'SUBSCRIPTION_INACTIVE';
56
+ currentUsage?: number;
57
+ limit?: number;
58
+ }
59
+ /**
60
+ * Mock handler for GetSubscriptionContract.
61
+ */
62
+ declare function mockGetSubscriptionHandler(): Promise<Subscription>;
63
+ /**
64
+ * Mock handler for GetUsageSummaryContract.
65
+ */
66
+ declare function mockGetUsageSummaryHandler(input: {
67
+ period?: string;
68
+ }): Promise<UsageSummary>;
69
+ /**
70
+ * Mock handler for RecordUsageContract.
71
+ */
72
+ declare function mockRecordUsageHandler(input: RecordUsageInput): Promise<{
73
+ recorded: boolean;
74
+ newTotal: number;
75
+ }>;
76
+ /**
77
+ * Mock handler for CheckFeatureAccessContract.
78
+ */
79
+ declare function mockCheckFeatureAccessHandler(input: CheckFeatureAccessInput): Promise<CheckFeatureAccessOutput>;
80
+ //#endregion
81
+ export { CheckFeatureAccessInput, CheckFeatureAccessOutput, RecordUsageInput, Subscription, UsageSummary, mockCheckFeatureAccessHandler, mockGetSubscriptionHandler, mockGetUsageSummaryHandler, mockRecordUsageHandler };
@@ -0,0 +1,14 @@
1
+ import { PresentationDescriptorV2 } from "@lssm/lib.contracts";
2
+
3
+ //#region src/billing/billing.presentation.d.ts
4
+
5
+ /**
6
+ * Presentation for subscription overview.
7
+ */
8
+ declare const SubscriptionPresentation: PresentationDescriptorV2;
9
+ /**
10
+ * Presentation for usage dashboard.
11
+ */
12
+ declare const UsageDashboardPresentation: PresentationDescriptorV2;
13
+ //#endregion
14
+ export { SubscriptionPresentation, UsageDashboardPresentation };