refactor(onboarding): restructure onboarding routes and components
- Removed obsolete onboarding routes: complete, create-complex, index, verify-email, and verify. - Introduced new setup stepper page for onboarding process. - Created a multi-step setup component to handle complex creation with validation. - Added new schemas for complex creation and plan features. - Implemented detailed steps for complex name, location, plan selection, and court setup. - Enhanced error handling and user feedback during the onboarding process.
This commit is contained in:
@@ -1,23 +1,24 @@
|
||||
import { db } from '@/lib/prisma';
|
||||
import { parsePlanRules } from '@/modules/plan/services/plan-rules.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
|
||||
export async function listPlansHandler(c: AppContext) {
|
||||
const plans = await db.plan.findMany({
|
||||
select: {
|
||||
code: true,
|
||||
name: true,
|
||||
price: true,
|
||||
},
|
||||
orderBy: {
|
||||
price: 'asc',
|
||||
},
|
||||
});
|
||||
|
||||
return c.json(
|
||||
plans.map((plan) => ({
|
||||
code: plan.code,
|
||||
name: plan.name,
|
||||
price: Number(plan.price),
|
||||
}))
|
||||
plans.map((plan) => {
|
||||
const rules = parsePlanRules(plan.rules);
|
||||
return {
|
||||
code: plan.code,
|
||||
name: plan.name,
|
||||
price: Number(plan.price),
|
||||
features: rules.features,
|
||||
limits: rules.limits,
|
||||
};
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user