@lssm/example.saas-boilerplate 1.41.0 → 1.42.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.
Files changed (122) hide show
  1. package/.turbo/turbo-build$colon$bundle.log +113 -0
  2. package/.turbo/turbo-build.log +109 -35
  3. package/CHANGELOG.md +46 -0
  4. package/LICENSE +21 -0
  5. package/README.md +3 -0
  6. package/dist/billing/billing.entity.d.ts +61 -0
  7. package/dist/billing/billing.entity.d.ts.map +1 -0
  8. package/dist/billing/billing.entity.js +122 -1
  9. package/dist/billing/billing.entity.js.map +1 -0
  10. package/dist/billing/billing.enum.d.ts +16 -0
  11. package/dist/billing/billing.enum.d.ts.map +1 -0
  12. package/dist/billing/billing.enum.js +27 -1
  13. package/dist/billing/billing.enum.js.map +1 -0
  14. package/dist/billing/billing.event.d.ts +86 -0
  15. package/dist/billing/billing.event.d.ts.map +1 -0
  16. package/dist/billing/billing.event.js +153 -1
  17. package/dist/billing/billing.event.js.map +1 -0
  18. package/dist/billing/billing.handler.d.ts +82 -0
  19. package/dist/billing/billing.handler.d.ts.map +1 -0
  20. package/dist/billing/billing.handler.js +58 -1
  21. package/dist/billing/billing.handler.js.map +1 -0
  22. package/dist/billing/billing.operations.d.ts +166 -0
  23. package/dist/billing/billing.operations.d.ts.map +1 -0
  24. package/dist/billing/billing.operations.js +181 -0
  25. package/dist/billing/billing.operations.js.map +1 -0
  26. package/dist/billing/billing.presentation.d.ts +15 -0
  27. package/dist/billing/billing.presentation.d.ts.map +1 -0
  28. package/dist/billing/billing.presentation.js +59 -1
  29. package/dist/billing/billing.presentation.js.map +1 -0
  30. package/dist/billing/billing.schema.d.ts +201 -0
  31. package/dist/billing/billing.schema.d.ts.map +1 -0
  32. package/dist/billing/billing.schema.js +214 -1
  33. package/dist/billing/billing.schema.js.map +1 -0
  34. package/dist/billing/index.d.ts +8 -0
  35. package/dist/billing/index.js +9 -1
  36. package/dist/dashboard/dashboard.presentation.d.ts +15 -0
  37. package/dist/dashboard/dashboard.presentation.d.ts.map +1 -0
  38. package/dist/dashboard/dashboard.presentation.js +55 -1
  39. package/dist/dashboard/dashboard.presentation.js.map +1 -0
  40. package/dist/dashboard/index.d.ts +2 -0
  41. package/dist/dashboard/index.js +3 -1
  42. package/dist/docs/index.d.ts +1 -0
  43. package/dist/docs/index.js +1 -1
  44. package/dist/docs/saas-boilerplate.docblock.d.ts +1 -0
  45. package/dist/docs/saas-boilerplate.docblock.js +56 -5
  46. package/dist/docs/saas-boilerplate.docblock.js.map +1 -0
  47. package/dist/example.d.ts +37 -0
  48. package/dist/example.d.ts.map +1 -0
  49. package/dist/example.js +46 -1
  50. package/dist/example.js.map +1 -0
  51. package/dist/handlers/index.d.ts +3 -0
  52. package/dist/handlers/index.js +4 -1
  53. package/dist/index.d.ts +42 -0
  54. package/dist/index.d.ts.map +1 -0
  55. package/dist/index.js +69 -1
  56. package/dist/index.js.map +1 -0
  57. package/dist/presentations/index.d.ts +17 -0
  58. package/dist/presentations/index.d.ts.map +1 -0
  59. package/dist/presentations/index.js +17 -1
  60. package/dist/presentations/index.js.map +1 -0
  61. package/dist/project/index.d.ts +8 -0
  62. package/dist/project/index.js +9 -1
  63. package/dist/project/project.entity.d.ts +40 -0
  64. package/dist/project/project.entity.d.ts.map +1 -0
  65. package/dist/project/project.entity.js +85 -1
  66. package/dist/project/project.entity.js.map +1 -0
  67. package/dist/project/project.enum.d.ts +16 -0
  68. package/dist/project/project.enum.d.ts.map +1 -0
  69. package/dist/project/project.enum.js +26 -1
  70. package/dist/project/project.enum.js.map +1 -0
  71. package/dist/project/project.event.d.ts +92 -0
  72. package/dist/project/project.event.d.ts.map +1 -0
  73. package/dist/project/project.event.js +165 -1
  74. package/dist/project/project.event.js.map +1 -0
  75. package/dist/project/project.handler.d.ts +72 -0
  76. package/dist/project/project.handler.d.ts.map +1 -0
  77. package/dist/project/project.handler.js +82 -1
  78. package/dist/project/project.handler.js.map +1 -0
  79. package/dist/project/project.operations.d.ts +419 -0
  80. package/dist/project/project.operations.d.ts.map +1 -0
  81. package/dist/project/project.operations.js +260 -0
  82. package/dist/project/project.operations.js.map +1 -0
  83. package/dist/project/project.presentation.d.ts +15 -0
  84. package/dist/project/project.presentation.d.ts.map +1 -0
  85. package/dist/project/project.presentation.js +65 -1
  86. package/dist/project/project.presentation.js.map +1 -0
  87. package/dist/project/project.schema.d.ts +235 -0
  88. package/dist/project/project.schema.d.ts.map +1 -0
  89. package/dist/project/project.schema.js +215 -1
  90. package/dist/project/project.schema.js.map +1 -0
  91. package/dist/saas-boilerplate.feature.d.ts +12 -0
  92. package/dist/saas-boilerplate.feature.d.ts.map +1 -0
  93. package/dist/saas-boilerplate.feature.js +201 -1
  94. package/dist/saas-boilerplate.feature.js.map +1 -0
  95. package/dist/settings/index.d.ts +3 -0
  96. package/dist/settings/index.js +4 -1
  97. package/dist/settings/settings.entity.d.ts +37 -0
  98. package/dist/settings/settings.entity.d.ts.map +1 -0
  99. package/dist/settings/settings.entity.js +78 -1
  100. package/dist/settings/settings.entity.js.map +1 -0
  101. package/dist/settings/settings.enum.d.ts +10 -0
  102. package/dist/settings/settings.enum.d.ts.map +1 -0
  103. package/dist/settings/settings.enum.js +21 -1
  104. package/dist/settings/settings.enum.js.map +1 -0
  105. package/dist/shared/mock-data.d.ts +86 -0
  106. package/dist/shared/mock-data.d.ts.map +1 -0
  107. package/dist/shared/mock-data.js +138 -1
  108. package/dist/shared/mock-data.js.map +1 -0
  109. package/package.json +54 -44
  110. package/src/billing/billing.event.ts +24 -9
  111. package/src/billing/{billing.contracts.ts → billing.operations.ts} +82 -10
  112. package/src/billing/billing.presentation.ts +14 -5
  113. package/src/billing/index.ts +1 -1
  114. package/src/dashboard/dashboard.presentation.ts +14 -5
  115. package/src/project/index.ts +1 -1
  116. package/src/project/project.event.ts +32 -12
  117. package/src/project/{project.contracts.ts → project.operations.ts} +98 -13
  118. package/src/project/project.presentation.ts +14 -5
  119. package/src/saas-boilerplate.feature.ts +35 -34
  120. package/tsconfig.tsbuildinfo +1 -1
  121. package/dist/billing/billing.contracts.js +0 -1
  122. package/dist/project/project.contracts.js +0 -1
@@ -0,0 +1,86 @@
1
+ //#region src/shared/mock-data.d.ts
2
+ /**
3
+ * Shared mock data for saas-boilerplate handlers.
4
+ */
5
+ declare const MOCK_PROJECTS: ({
6
+ id: string;
7
+ name: string;
8
+ description: string;
9
+ slug: string;
10
+ organizationId: string;
11
+ createdBy: string;
12
+ status: "ACTIVE";
13
+ isPublic: boolean;
14
+ tags: string[];
15
+ createdAt: Date;
16
+ updatedAt: Date;
17
+ } | {
18
+ id: string;
19
+ name: string;
20
+ description: string;
21
+ slug: string;
22
+ organizationId: string;
23
+ createdBy: string;
24
+ status: "DRAFT";
25
+ isPublic: boolean;
26
+ tags: string[];
27
+ createdAt: Date;
28
+ updatedAt: Date;
29
+ } | {
30
+ id: string;
31
+ name: string;
32
+ description: string;
33
+ slug: string;
34
+ organizationId: string;
35
+ createdBy: string;
36
+ status: "ARCHIVED";
37
+ isPublic: boolean;
38
+ tags: string[];
39
+ createdAt: Date;
40
+ updatedAt: Date;
41
+ })[];
42
+ declare const MOCK_SUBSCRIPTION: {
43
+ id: string;
44
+ organizationId: string;
45
+ planId: string;
46
+ planName: string;
47
+ status: "ACTIVE";
48
+ currentPeriodStart: Date;
49
+ currentPeriodEnd: Date;
50
+ limits: {
51
+ projects: number;
52
+ users: number;
53
+ storage: number;
54
+ apiCalls: number;
55
+ };
56
+ usage: {
57
+ projects: number;
58
+ users: number;
59
+ storage: number;
60
+ apiCalls: number;
61
+ };
62
+ };
63
+ declare const MOCK_USAGE_SUMMARY: {
64
+ organizationId: string;
65
+ period: string;
66
+ apiCalls: {
67
+ total: number;
68
+ limit: number;
69
+ percentUsed: number;
70
+ };
71
+ storage: {
72
+ totalGb: number;
73
+ limitGb: number;
74
+ percentUsed: number;
75
+ };
76
+ activeProjects: number;
77
+ activeUsers: number;
78
+ breakdown: {
79
+ date: string;
80
+ apiCalls: number;
81
+ storageGb: number;
82
+ }[];
83
+ };
84
+ //#endregion
85
+ export { MOCK_PROJECTS, MOCK_SUBSCRIPTION, MOCK_USAGE_SUMMARY };
86
+ //# sourceMappingURL=mock-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-data.d.ts","names":[],"sources":["../../src/shared/mock-data.ts"],"sourcesContent":[],"mappings":";;AAMA;;cAAa;;;;;;EAyDA,SAAA,EAAA,MAAA;EAwBA,MAAA,EAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAxBA;;;;;;sBAoBZ;oBAAA;;;;;;;;;;;;;;cAIY"}
@@ -1 +1,138 @@
1
- const e=[{id:`proj-1`,name:`Marketing Website`,description:`Main company website redesign project`,slug:`marketing-website`,organizationId:`demo-org`,createdBy:`user-1`,status:`ACTIVE`,isPublic:!1,tags:[`marketing`,`website`,`redesign`],createdAt:new Date(`2024-01-15T10:00:00Z`),updatedAt:new Date(`2024-03-20T14:30:00Z`)},{id:`proj-2`,name:`Mobile App v2`,description:`Next generation mobile application`,slug:`mobile-app-v2`,organizationId:`demo-org`,createdBy:`user-2`,status:`ACTIVE`,isPublic:!1,tags:[`mobile`,`app`,`v2`],createdAt:new Date(`2024-02-01T09:00:00Z`),updatedAt:new Date(`2024-04-05T11:15:00Z`)},{id:`proj-3`,name:`API Integration`,description:`Third-party API integration project`,slug:`api-integration`,organizationId:`demo-org`,createdBy:`user-1`,status:`DRAFT`,isPublic:!1,tags:[`api`,`integration`],createdAt:new Date(`2024-03-10T08:00:00Z`),updatedAt:new Date(`2024-03-10T08:00:00Z`)},{id:`proj-4`,name:`Analytics Dashboard`,description:`Internal analytics and reporting dashboard`,slug:`analytics-dashboard`,organizationId:`demo-org`,createdBy:`user-3`,status:`ARCHIVED`,isPublic:!0,tags:[`analytics`,`dashboard`,`reporting`],createdAt:new Date(`2023-10-01T12:00:00Z`),updatedAt:new Date(`2024-02-28T16:45:00Z`)}],t={id:`sub-1`,organizationId:`demo-org`,planId:`pro`,planName:`Professional`,status:`ACTIVE`,currentPeriodStart:new Date(`2024-04-01T00:00:00Z`),currentPeriodEnd:new Date(`2024-05-01T00:00:00Z`),limits:{projects:25,users:10,storage:50,apiCalls:1e5},usage:{projects:4,users:5,storage:12.5,apiCalls:45230}},n={organizationId:`demo-org`,period:`current_month`,apiCalls:{total:45230,limit:1e5,percentUsed:45.23},storage:{totalGb:12.5,limitGb:50,percentUsed:25},activeProjects:4,activeUsers:5,breakdown:[{date:`2024-04-01`,apiCalls:3200,storageGb:12.1},{date:`2024-04-02`,apiCalls:2800,storageGb:12.2},{date:`2024-04-03`,apiCalls:4100,storageGb:12.3},{date:`2024-04-04`,apiCalls:3600,storageGb:12.4},{date:`2024-04-05`,apiCalls:3800,storageGb:12.5}]};export{e as MOCK_PROJECTS,t as MOCK_SUBSCRIPTION,n as MOCK_USAGE_SUMMARY};
1
+ //#region src/shared/mock-data.ts
2
+ /**
3
+ * Shared mock data for saas-boilerplate handlers.
4
+ */
5
+ const MOCK_PROJECTS = [
6
+ {
7
+ id: "proj-1",
8
+ name: "Marketing Website",
9
+ description: "Main company website redesign project",
10
+ slug: "marketing-website",
11
+ organizationId: "demo-org",
12
+ createdBy: "user-1",
13
+ status: "ACTIVE",
14
+ isPublic: false,
15
+ tags: [
16
+ "marketing",
17
+ "website",
18
+ "redesign"
19
+ ],
20
+ createdAt: /* @__PURE__ */ new Date("2024-01-15T10:00:00Z"),
21
+ updatedAt: /* @__PURE__ */ new Date("2024-03-20T14:30:00Z")
22
+ },
23
+ {
24
+ id: "proj-2",
25
+ name: "Mobile App v2",
26
+ description: "Next generation mobile application",
27
+ slug: "mobile-app-v2",
28
+ organizationId: "demo-org",
29
+ createdBy: "user-2",
30
+ status: "ACTIVE",
31
+ isPublic: false,
32
+ tags: [
33
+ "mobile",
34
+ "app",
35
+ "v2"
36
+ ],
37
+ createdAt: /* @__PURE__ */ new Date("2024-02-01T09:00:00Z"),
38
+ updatedAt: /* @__PURE__ */ new Date("2024-04-05T11:15:00Z")
39
+ },
40
+ {
41
+ id: "proj-3",
42
+ name: "API Integration",
43
+ description: "Third-party API integration project",
44
+ slug: "api-integration",
45
+ organizationId: "demo-org",
46
+ createdBy: "user-1",
47
+ status: "DRAFT",
48
+ isPublic: false,
49
+ tags: ["api", "integration"],
50
+ createdAt: /* @__PURE__ */ new Date("2024-03-10T08:00:00Z"),
51
+ updatedAt: /* @__PURE__ */ new Date("2024-03-10T08:00:00Z")
52
+ },
53
+ {
54
+ id: "proj-4",
55
+ name: "Analytics Dashboard",
56
+ description: "Internal analytics and reporting dashboard",
57
+ slug: "analytics-dashboard",
58
+ organizationId: "demo-org",
59
+ createdBy: "user-3",
60
+ status: "ARCHIVED",
61
+ isPublic: true,
62
+ tags: [
63
+ "analytics",
64
+ "dashboard",
65
+ "reporting"
66
+ ],
67
+ createdAt: /* @__PURE__ */ new Date("2023-10-01T12:00:00Z"),
68
+ updatedAt: /* @__PURE__ */ new Date("2024-02-28T16:45:00Z")
69
+ }
70
+ ];
71
+ const MOCK_SUBSCRIPTION = {
72
+ id: "sub-1",
73
+ organizationId: "demo-org",
74
+ planId: "pro",
75
+ planName: "Professional",
76
+ status: "ACTIVE",
77
+ currentPeriodStart: /* @__PURE__ */ new Date("2024-04-01T00:00:00Z"),
78
+ currentPeriodEnd: /* @__PURE__ */ new Date("2024-05-01T00:00:00Z"),
79
+ limits: {
80
+ projects: 25,
81
+ users: 10,
82
+ storage: 50,
83
+ apiCalls: 1e5
84
+ },
85
+ usage: {
86
+ projects: 4,
87
+ users: 5,
88
+ storage: 12.5,
89
+ apiCalls: 45230
90
+ }
91
+ };
92
+ const MOCK_USAGE_SUMMARY = {
93
+ organizationId: "demo-org",
94
+ period: "current_month",
95
+ apiCalls: {
96
+ total: 45230,
97
+ limit: 1e5,
98
+ percentUsed: 45.23
99
+ },
100
+ storage: {
101
+ totalGb: 12.5,
102
+ limitGb: 50,
103
+ percentUsed: 25
104
+ },
105
+ activeProjects: 4,
106
+ activeUsers: 5,
107
+ breakdown: [
108
+ {
109
+ date: "2024-04-01",
110
+ apiCalls: 3200,
111
+ storageGb: 12.1
112
+ },
113
+ {
114
+ date: "2024-04-02",
115
+ apiCalls: 2800,
116
+ storageGb: 12.2
117
+ },
118
+ {
119
+ date: "2024-04-03",
120
+ apiCalls: 4100,
121
+ storageGb: 12.3
122
+ },
123
+ {
124
+ date: "2024-04-04",
125
+ apiCalls: 3600,
126
+ storageGb: 12.4
127
+ },
128
+ {
129
+ date: "2024-04-05",
130
+ apiCalls: 3800,
131
+ storageGb: 12.5
132
+ }
133
+ ]
134
+ };
135
+
136
+ //#endregion
137
+ export { MOCK_PROJECTS, MOCK_SUBSCRIPTION, MOCK_USAGE_SUMMARY };
138
+ //# sourceMappingURL=mock-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-data.js","names":[],"sources":["../../src/shared/mock-data.ts"],"sourcesContent":["/**\n * Shared mock data for saas-boilerplate handlers.\n */\n\n// ============ Project Mock Data ============\n\nexport const MOCK_PROJECTS = [\n {\n id: 'proj-1',\n name: 'Marketing Website',\n description: 'Main company website redesign project',\n slug: 'marketing-website',\n organizationId: 'demo-org',\n createdBy: 'user-1',\n status: 'ACTIVE' as const,\n isPublic: false,\n tags: ['marketing', 'website', 'redesign'],\n createdAt: new Date('2024-01-15T10:00:00Z'),\n updatedAt: new Date('2024-03-20T14:30:00Z'),\n },\n {\n id: 'proj-2',\n name: 'Mobile App v2',\n description: 'Next generation mobile application',\n slug: 'mobile-app-v2',\n organizationId: 'demo-org',\n createdBy: 'user-2',\n status: 'ACTIVE' as const,\n isPublic: false,\n tags: ['mobile', 'app', 'v2'],\n createdAt: new Date('2024-02-01T09:00:00Z'),\n updatedAt: new Date('2024-04-05T11:15:00Z'),\n },\n {\n id: 'proj-3',\n name: 'API Integration',\n description: 'Third-party API integration project',\n slug: 'api-integration',\n organizationId: 'demo-org',\n createdBy: 'user-1',\n status: 'DRAFT' as const,\n isPublic: false,\n tags: ['api', 'integration'],\n createdAt: new Date('2024-03-10T08:00:00Z'),\n updatedAt: new Date('2024-03-10T08:00:00Z'),\n },\n {\n id: 'proj-4',\n name: 'Analytics Dashboard',\n description: 'Internal analytics and reporting dashboard',\n slug: 'analytics-dashboard',\n organizationId: 'demo-org',\n createdBy: 'user-3',\n status: 'ARCHIVED' as const,\n isPublic: true,\n tags: ['analytics', 'dashboard', 'reporting'],\n createdAt: new Date('2023-10-01T12:00:00Z'),\n updatedAt: new Date('2024-02-28T16:45:00Z'),\n },\n];\n\n// ============ Subscription Mock Data ============\n\nexport const MOCK_SUBSCRIPTION = {\n id: 'sub-1',\n organizationId: 'demo-org',\n planId: 'pro',\n planName: 'Professional',\n status: 'ACTIVE' as const,\n currentPeriodStart: new Date('2024-04-01T00:00:00Z'),\n currentPeriodEnd: new Date('2024-05-01T00:00:00Z'),\n limits: {\n projects: 25,\n users: 10,\n storage: 50, // GB\n apiCalls: 100000,\n },\n usage: {\n projects: 4,\n users: 5,\n storage: 12.5,\n apiCalls: 45230,\n },\n};\n\n// ============ Usage Summary Mock Data ============\n\nexport const MOCK_USAGE_SUMMARY = {\n organizationId: 'demo-org',\n period: 'current_month',\n apiCalls: {\n total: 45230,\n limit: 100000,\n percentUsed: 45.23,\n },\n storage: {\n totalGb: 12.5,\n limitGb: 50,\n percentUsed: 25,\n },\n activeProjects: 4,\n activeUsers: 5,\n breakdown: [\n { date: '2024-04-01', apiCalls: 3200, storageGb: 12.1 },\n { date: '2024-04-02', apiCalls: 2800, storageGb: 12.2 },\n { date: '2024-04-03', apiCalls: 4100, storageGb: 12.3 },\n { date: '2024-04-04', apiCalls: 3600, storageGb: 12.4 },\n { date: '2024-04-05', apiCalls: 3800, storageGb: 12.5 },\n ],\n};\n"],"mappings":";;;;AAMA,MAAa,gBAAgB;CAC3B;EACE,IAAI;EACJ,MAAM;EACN,aAAa;EACb,MAAM;EACN,gBAAgB;EAChB,WAAW;EACX,QAAQ;EACR,UAAU;EACV,MAAM;GAAC;GAAa;GAAW;GAAW;EAC1C,2BAAW,IAAI,KAAK,uBAAuB;EAC3C,2BAAW,IAAI,KAAK,uBAAuB;EAC5C;CACD;EACE,IAAI;EACJ,MAAM;EACN,aAAa;EACb,MAAM;EACN,gBAAgB;EAChB,WAAW;EACX,QAAQ;EACR,UAAU;EACV,MAAM;GAAC;GAAU;GAAO;GAAK;EAC7B,2BAAW,IAAI,KAAK,uBAAuB;EAC3C,2BAAW,IAAI,KAAK,uBAAuB;EAC5C;CACD;EACE,IAAI;EACJ,MAAM;EACN,aAAa;EACb,MAAM;EACN,gBAAgB;EAChB,WAAW;EACX,QAAQ;EACR,UAAU;EACV,MAAM,CAAC,OAAO,cAAc;EAC5B,2BAAW,IAAI,KAAK,uBAAuB;EAC3C,2BAAW,IAAI,KAAK,uBAAuB;EAC5C;CACD;EACE,IAAI;EACJ,MAAM;EACN,aAAa;EACb,MAAM;EACN,gBAAgB;EAChB,WAAW;EACX,QAAQ;EACR,UAAU;EACV,MAAM;GAAC;GAAa;GAAa;GAAY;EAC7C,2BAAW,IAAI,KAAK,uBAAuB;EAC3C,2BAAW,IAAI,KAAK,uBAAuB;EAC5C;CACF;AAID,MAAa,oBAAoB;CAC/B,IAAI;CACJ,gBAAgB;CAChB,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,oCAAoB,IAAI,KAAK,uBAAuB;CACpD,kCAAkB,IAAI,KAAK,uBAAuB;CAClD,QAAQ;EACN,UAAU;EACV,OAAO;EACP,SAAS;EACT,UAAU;EACX;CACD,OAAO;EACL,UAAU;EACV,OAAO;EACP,SAAS;EACT,UAAU;EACX;CACF;AAID,MAAa,qBAAqB;CAChC,gBAAgB;CAChB,QAAQ;CACR,UAAU;EACR,OAAO;EACP,OAAO;EACP,aAAa;EACd;CACD,SAAS;EACP,SAAS;EACT,SAAS;EACT,aAAa;EACd;CACD,gBAAgB;CAChB,aAAa;CACb,WAAW;EACT;GAAE,MAAM;GAAc,UAAU;GAAM,WAAW;GAAM;EACvD;GAAE,MAAM;GAAc,UAAU;GAAM,WAAW;GAAM;EACvD;GAAE,MAAM;GAAc,UAAU;GAAM,WAAW;GAAM;EACvD;GAAE,MAAM;GAAc,UAAU;GAAM,WAAW;GAAM;EACvD;GAAE,MAAM;GAAc,UAAU;GAAM,WAAW;GAAM;EACxD;CACF"}
package/package.json CHANGED
@@ -1,44 +1,46 @@
1
1
  {
2
2
  "name": "@lssm/example.saas-boilerplate",
3
- "version": "1.41.0",
3
+ "version": "1.42.2",
4
4
  "description": "SaaS Boilerplate - Users, Orgs, Projects, Billing, Settings",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "exports": {
9
- ".": "./src/index.ts",
10
- "./billing": "./src/billing/index.ts",
11
- "./billing/billing.contracts": "./src/billing/billing.contracts.ts",
12
- "./billing/billing.entity": "./src/billing/billing.entity.ts",
13
- "./billing/billing.enum": "./src/billing/billing.enum.ts",
14
- "./billing/billing.event": "./src/billing/billing.event.ts",
15
- "./billing/billing.handler": "./src/billing/billing.handler.ts",
16
- "./billing/billing.presentation": "./src/billing/billing.presentation.ts",
17
- "./billing/billing.schema": "./src/billing/billing.schema.ts",
18
- "./dashboard": "./src/dashboard/index.ts",
19
- "./dashboard/dashboard.presentation": "./src/dashboard/dashboard.presentation.ts",
20
- "./docs": "./src/docs/index.ts",
21
- "./docs/saas-boilerplate.docblock": "./src/docs/saas-boilerplate.docblock.ts",
22
- "./example": "./src/example.ts",
23
- "./handlers": "./src/handlers/index.ts",
24
- "./presentations": "./src/presentations/index.ts",
25
- "./project": "./src/project/index.ts",
26
- "./project/project.contracts": "./src/project/project.contracts.ts",
27
- "./project/project.entity": "./src/project/project.entity.ts",
28
- "./project/project.enum": "./src/project/project.enum.ts",
29
- "./project/project.event": "./src/project/project.event.ts",
30
- "./project/project.handler": "./src/project/project.handler.ts",
31
- "./project/project.presentation": "./src/project/project.presentation.ts",
32
- "./project/project.schema": "./src/project/project.schema.ts",
33
- "./saas-boilerplate.feature": "./src/saas-boilerplate.feature.ts",
34
- "./settings": "./src/settings/index.ts",
35
- "./settings/settings.entity": "./src/settings/settings.entity.ts",
36
- "./settings/settings.enum": "./src/settings/settings.enum.ts",
37
- "./shared/mock-data": "./src/shared/mock-data.ts",
9
+ ".": "./dist/index.js",
10
+ "./billing": "./dist/billing/index.js",
11
+ "./billing/billing.entity": "./dist/billing/billing.entity.js",
12
+ "./billing/billing.enum": "./dist/billing/billing.enum.js",
13
+ "./billing/billing.event": "./dist/billing/billing.event.js",
14
+ "./billing/billing.handler": "./dist/billing/billing.handler.js",
15
+ "./billing/billing.operations": "./dist/billing/billing.operations.js",
16
+ "./billing/billing.presentation": "./dist/billing/billing.presentation.js",
17
+ "./billing/billing.schema": "./dist/billing/billing.schema.js",
18
+ "./dashboard": "./dist/dashboard/index.js",
19
+ "./dashboard/dashboard.presentation": "./dist/dashboard/dashboard.presentation.js",
20
+ "./docs": "./dist/docs/index.js",
21
+ "./docs/saas-boilerplate.docblock": "./dist/docs/saas-boilerplate.docblock.js",
22
+ "./example": "./dist/example.js",
23
+ "./handlers": "./dist/handlers/index.js",
24
+ "./presentations": "./dist/presentations/index.js",
25
+ "./project": "./dist/project/index.js",
26
+ "./project/project.entity": "./dist/project/project.entity.js",
27
+ "./project/project.enum": "./dist/project/project.enum.js",
28
+ "./project/project.event": "./dist/project/project.event.js",
29
+ "./project/project.handler": "./dist/project/project.handler.js",
30
+ "./project/project.operations": "./dist/project/project.operations.js",
31
+ "./project/project.presentation": "./dist/project/project.presentation.js",
32
+ "./project/project.schema": "./dist/project/project.schema.js",
33
+ "./saas-boilerplate.feature": "./dist/saas-boilerplate.feature.js",
34
+ "./settings": "./dist/settings/index.js",
35
+ "./settings/settings.entity": "./dist/settings/settings.entity.js",
36
+ "./settings/settings.enum": "./dist/settings/settings.enum.js",
37
+ "./shared/mock-data": "./dist/shared/mock-data.js",
38
38
  "./*": "./*"
39
39
  },
40
40
  "scripts": {
41
- "build": "bun build:bundle && bun build:types",
41
+ "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
42
+ "publish:pkg:canary": "bun publish:pkg --tag canary",
43
+ "build": "bun build:types && bun build:bundle",
42
44
  "build:bundle": "tsdown",
43
45
  "build:types": "tsc --noEmit",
44
46
  "dev": "bun build:bundle --watch",
@@ -49,19 +51,19 @@
49
51
  "test": "bun run"
50
52
  },
51
53
  "dependencies": {
52
- "@lssm/lib.schema": "workspace:*",
53
- "@lssm/lib.contracts": "workspace:*",
54
- "@lssm/lib.bus": "workspace:*",
55
- "@lssm/lib.identity-rbac": "workspace:*",
56
- "@lssm/lib.jobs": "workspace:*",
57
- "@lssm/module.audit-trail": "workspace:*",
58
- "@lssm/module.notifications": "workspace:*",
54
+ "@lssm/lib.schema": "1.42.2",
55
+ "@lssm/lib.contracts": "1.42.2",
56
+ "@lssm/lib.bus": "1.42.2",
57
+ "@lssm/lib.identity-rbac": "1.42.2",
58
+ "@lssm/lib.jobs": "1.42.2",
59
+ "@lssm/module.audit-trail": "1.42.2",
60
+ "@lssm/module.notifications": "1.42.2",
59
61
  "zod": "^4.1.13"
60
62
  },
61
63
  "devDependencies": {
62
- "@lssm/tool.tsdown": "workspace:*",
63
- "@lssm/tool.typescript": "workspace:*",
64
- "tsdown": "^0.17.4",
64
+ "@lssm/tool.tsdown": "1.42.2",
65
+ "@lssm/tool.typescript": "1.42.2",
66
+ "tsdown": "^0.18.3",
65
67
  "typescript": "^5.9.3"
66
68
  },
67
69
  "module": "./dist/index.js",
@@ -69,7 +71,7 @@
69
71
  "exports": {
70
72
  ".": "./dist/index.js",
71
73
  "./billing": "./dist/billing/index.js",
72
- "./billing/billing.contracts": "./dist/billing/billing.contracts.js",
74
+ "./billing/billing.contracts": "./dist/billing/billing.operations.js",
73
75
  "./billing/billing.entity": "./dist/billing/billing.entity.js",
74
76
  "./billing/billing.enum": "./dist/billing/billing.enum.js",
75
77
  "./billing/billing.event": "./dist/billing/billing.event.js",
@@ -84,7 +86,7 @@
84
86
  "./handlers": "./dist/handlers/index.js",
85
87
  "./presentations": "./dist/presentations/index.js",
86
88
  "./project": "./dist/project/index.js",
87
- "./project/project.contracts": "./dist/project/project.contracts.js",
89
+ "./project/project.contracts": "./dist/project/project.operations.js",
88
90
  "./project/project.entity": "./dist/project/project.entity.js",
89
91
  "./project/project.enum": "./dist/project/project.enum.js",
90
92
  "./project/project.event": "./dist/project/project.event.js",
@@ -97,6 +99,14 @@
97
99
  "./settings/settings.enum": "./dist/settings/settings.enum.js",
98
100
  "./shared/mock-data": "./dist/shared/mock-data.js",
99
101
  "./*": "./*"
100
- }
102
+ },
103
+ "registry": "https://registry.npmjs.org/",
104
+ "access": "public"
105
+ },
106
+ "license": "MIT",
107
+ "repository": {
108
+ "type": "git",
109
+ "url": "https://github.com/lssm-tech/contractspec.git",
110
+ "directory": "packages/examples/saas-boilerplate"
101
111
  }
102
112
  }
@@ -66,9 +66,14 @@ const SubscriptionChangedPayload = defineSchemaModel({
66
66
  * Event: Feature usage has been recorded.
67
67
  */
68
68
  export const UsageRecordedEvent = defineEvent({
69
- name: 'billing.usage.recorded',
70
- version: 1,
71
- description: 'Feature usage has been recorded.',
69
+ meta: {
70
+ key: 'billing.usage.recorded',
71
+ version: 1,
72
+ description: 'Feature usage has been recorded.',
73
+ stability: 'stable',
74
+ owners: ['@saas-team'],
75
+ tags: ['billing', 'usage', 'recorded'],
76
+ },
72
77
  payload: UsageRecordedPayload,
73
78
  });
74
79
 
@@ -76,9 +81,14 @@ export const UsageRecordedEvent = defineEvent({
76
81
  * Event: Usage limit has been reached for a feature.
77
82
  */
78
83
  export const UsageLimitReachedEvent = defineEvent({
79
- name: 'billing.limit.reached',
80
- version: 1,
81
- description: 'Usage limit has been reached for a feature.',
84
+ meta: {
85
+ key: 'billing.limit.reached',
86
+ version: 1,
87
+ description: 'Usage limit has been reached for a feature.',
88
+ stability: 'stable',
89
+ owners: ['@saas-team'],
90
+ tags: ['billing', 'limit', 'reached'],
91
+ },
82
92
  payload: UsageLimitReachedPayload,
83
93
  });
84
94
 
@@ -86,8 +96,13 @@ export const UsageLimitReachedEvent = defineEvent({
86
96
  * Event: Subscription status has changed.
87
97
  */
88
98
  export const SubscriptionChangedEvent = defineEvent({
89
- name: 'billing.subscription.changed',
90
- version: 1,
91
- description: 'Subscription status has changed.',
99
+ meta: {
100
+ key: 'billing.subscription.changed',
101
+ version: 1,
102
+ description: 'Subscription status has changed.',
103
+ stability: 'stable',
104
+ owners: ['@saas-team'],
105
+ tags: ['billing', 'subscription', 'changed'],
106
+ },
92
107
  payload: SubscriptionChangedPayload,
93
108
  });
@@ -1,13 +1,13 @@
1
1
  import { defineCommand, defineQuery } from '@lssm/lib.contracts';
2
2
  import {
3
- SubscriptionModel,
3
+ CheckFeatureAccessInputModel,
4
+ CheckFeatureAccessOutputModel,
5
+ GetUsageSummaryInputModel,
6
+ GetUsageSummaryOutputModel,
4
7
  RecordUsageInputModel,
5
8
  RecordUsageOutputModel,
9
+ SubscriptionModel,
6
10
  UsageRecordedPayloadModel,
7
- GetUsageSummaryInputModel,
8
- GetUsageSummaryOutputModel,
9
- CheckFeatureAccessInputModel,
10
- CheckFeatureAccessOutputModel,
11
11
  } from './billing.schema';
12
12
 
13
13
  const OWNERS = ['@example.saas-boilerplate'] as const;
@@ -17,7 +17,7 @@ const OWNERS = ['@example.saas-boilerplate'] as const;
17
17
  */
18
18
  export const GetSubscriptionContract = defineQuery({
19
19
  meta: {
20
- name: 'saas.billing.subscription.get',
20
+ key: 'saas.billing.subscription.get',
21
21
  version: 1,
22
22
  stability: 'stable',
23
23
  owners: [...OWNERS],
@@ -33,6 +33,27 @@ export const GetSubscriptionContract = defineQuery({
33
33
  policy: {
34
34
  auth: 'user',
35
35
  },
36
+ acceptance: {
37
+ scenarios: [
38
+ {
39
+ key: 'get-subscription-happy-path',
40
+ given: ['Organization has active subscription'],
41
+ when: ['User requests subscription status'],
42
+ then: ['Subscription details are returned'],
43
+ },
44
+ ],
45
+ examples: [
46
+ {
47
+ key: 'get-basic',
48
+ input: null,
49
+ output: {
50
+ plan: 'pro',
51
+ status: 'active',
52
+ currentPeriodEnd: '2025-02-01T00:00:00Z',
53
+ },
54
+ },
55
+ ],
56
+ },
36
57
  });
37
58
 
38
59
  /**
@@ -40,7 +61,7 @@ export const GetSubscriptionContract = defineQuery({
40
61
  */
41
62
  export const RecordUsageContract = defineCommand({
42
63
  meta: {
43
- name: 'saas.billing.usage.record',
64
+ key: 'saas.billing.usage.record',
44
65
  version: 1,
45
66
  stability: 'stable',
46
67
  owners: [...OWNERS],
@@ -59,13 +80,30 @@ export const RecordUsageContract = defineCommand({
59
80
  sideEffects: {
60
81
  emits: [
61
82
  {
62
- name: 'billing.usage.recorded',
83
+ key: 'billing.usage.recorded',
63
84
  version: 1,
64
85
  when: 'Usage is recorded',
65
86
  payload: UsageRecordedPayloadModel,
66
87
  },
67
88
  ],
68
89
  },
90
+ acceptance: {
91
+ scenarios: [
92
+ {
93
+ key: 'record-usage-happy-path',
94
+ given: ['Organization exists'],
95
+ when: ['System records feature usage'],
96
+ then: ['Usage is recorded'],
97
+ },
98
+ ],
99
+ examples: [
100
+ {
101
+ key: 'record-api-call',
102
+ input: { feature: 'api_calls', quantity: 1, idempotencyKey: 'abc-123' },
103
+ output: { recorded: true, currentUsage: 100 },
104
+ },
105
+ ],
106
+ },
69
107
  });
70
108
 
71
109
  /**
@@ -73,7 +111,7 @@ export const RecordUsageContract = defineCommand({
73
111
  */
74
112
  export const GetUsageSummaryContract = defineQuery({
75
113
  meta: {
76
- name: 'saas.billing.usage.summary',
114
+ key: 'saas.billing.usage.summary',
77
115
  version: 1,
78
116
  stability: 'stable',
79
117
  owners: [...OWNERS],
@@ -89,6 +127,23 @@ export const GetUsageSummaryContract = defineQuery({
89
127
  policy: {
90
128
  auth: 'user',
91
129
  },
130
+ acceptance: {
131
+ scenarios: [
132
+ {
133
+ key: 'get-usage-happy-path',
134
+ given: ['Organization has usage history'],
135
+ when: ['User requests usage summary'],
136
+ then: ['Usage metrics are returned'],
137
+ },
138
+ ],
139
+ examples: [
140
+ {
141
+ key: 'get-current-usage',
142
+ input: { period: 'current' },
143
+ output: { features: [{ name: 'api_calls', used: 100, limit: 1000 }] },
144
+ },
145
+ ],
146
+ },
92
147
  });
93
148
 
94
149
  /**
@@ -96,7 +151,7 @@ export const GetUsageSummaryContract = defineQuery({
96
151
  */
97
152
  export const CheckFeatureAccessContract = defineQuery({
98
153
  meta: {
99
- name: 'saas.billing.feature.check',
154
+ key: 'saas.billing.feature.check',
100
155
  version: 1,
101
156
  stability: 'stable',
102
157
  owners: [...OWNERS],
@@ -112,4 +167,21 @@ export const CheckFeatureAccessContract = defineQuery({
112
167
  policy: {
113
168
  auth: 'user',
114
169
  },
170
+ acceptance: {
171
+ scenarios: [
172
+ {
173
+ key: 'check-access-granted',
174
+ given: ['Organization is on Pro plan'],
175
+ when: ['User checks access to Pro feature'],
176
+ then: ['Access is granted'],
177
+ },
178
+ ],
179
+ examples: [
180
+ {
181
+ key: 'check-advanced-reports',
182
+ input: { feature: 'advanced_reports' },
183
+ output: { hasAccess: true, reason: 'Included in Pro plan' },
184
+ },
185
+ ],
186
+ },
115
187
  });
@@ -1,17 +1,22 @@
1
- import type { PresentationDescriptorV2 } from '@lssm/lib.contracts';
1
+ import type { PresentationSpec } from '@lssm/lib.contracts';
2
+ import { StabilityEnum } from '@lssm/lib.contracts';
2
3
 
3
4
  /**
4
5
  * Presentation for subscription overview.
5
6
  */
6
- export const SubscriptionPresentation: PresentationDescriptorV2 = {
7
+ export const SubscriptionPresentation: PresentationSpec = {
7
8
  meta: {
8
- name: 'saas.billing.subscription',
9
+ key: 'saas.billing.subscription',
9
10
  version: 1,
11
+ title: 'Subscription Status',
10
12
  description:
11
13
  'Subscription status with plan info, limits, and current usage',
12
14
  domain: 'saas-boilerplate',
13
15
  owners: ['@saas-team'],
14
16
  tags: ['billing', 'subscription'],
17
+ stability: StabilityEnum.Beta,
18
+ goal: 'View subscription plan and status',
19
+ context: 'Billing section',
15
20
  },
16
21
  source: {
17
22
  type: 'component',
@@ -27,14 +32,18 @@ export const SubscriptionPresentation: PresentationDescriptorV2 = {
27
32
  /**
28
33
  * Presentation for usage dashboard.
29
34
  */
30
- export const UsageDashboardPresentation: PresentationDescriptorV2 = {
35
+ export const UsageDashboardPresentation: PresentationSpec = {
31
36
  meta: {
32
- name: 'saas.billing.usage',
37
+ key: 'saas.billing.usage',
33
38
  version: 1,
39
+ title: 'Usage Dashboard',
34
40
  description: 'Usage metrics and breakdown by resource type',
35
41
  domain: 'saas-boilerplate',
36
42
  owners: ['@saas-team'],
37
43
  tags: ['billing', 'usage', 'metrics'],
44
+ stability: StabilityEnum.Beta,
45
+ goal: 'Monitor feature usage and limits',
46
+ context: 'Billing section',
38
47
  },
39
48
  source: {
40
49
  type: 'component',
@@ -27,7 +27,7 @@ export {
27
27
  RecordUsageContract,
28
28
  GetUsageSummaryContract,
29
29
  CheckFeatureAccessContract,
30
- } from './billing.contracts';
30
+ } from './billing.operations';
31
31
 
32
32
  // Events
33
33
  export {