FRE-5353 Home Title: Dashboard widget + tier gating
- Add hometitle API routes: properties CRUD, changes, alerts, scan - Implement Premium tier gating with 402 responses for non-Premium users - Enforce max 5 properties per Premium subscription (0 for Free/Basic, 3 for Plus) - Build DashboardPage with PropertyCard, AddPropertyForm, AlertsList components - Add dashboard CSS styles with responsive design - Register hometitle routes under /hometitle prefix with auth middleware Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -4,6 +4,10 @@ import { voiceprintRoutes } from './voiceprint.routes';
|
||||
import { spamshieldRoutes } from './spamshield.routes';
|
||||
import { darkwatchRoutes } from './darkwatch.routes';
|
||||
import { reportRoutes } from './report.routes';
|
||||
import { subscriptionRoutes } from './subscription.routes';
|
||||
import { deviceRoutes } from './device.routes';
|
||||
import { notificationRoutes } from './notifications.routes';
|
||||
import { hometitleRoutes } from './hometitle.routes';
|
||||
|
||||
export async function routes(fastify: FastifyInstance) {
|
||||
// Authenticated routes group
|
||||
@@ -148,4 +152,31 @@ export async function routes(fastify: FastifyInstance) {
|
||||
},
|
||||
{ prefix: '/reports' }
|
||||
);
|
||||
|
||||
// Subscription routes
|
||||
fastify.register(
|
||||
async (subscriptionRouter) => {
|
||||
await subscriptionRoutes(subscriptionRouter);
|
||||
},
|
||||
{ prefix: '/billing' }
|
||||
);
|
||||
|
||||
// Device routes
|
||||
fastify.register(
|
||||
async (deviceRouter) => {
|
||||
await deviceRoutes(deviceRouter);
|
||||
},
|
||||
{ prefix: '/api/v1' }
|
||||
);
|
||||
|
||||
// Home Title service routes
|
||||
fastify.register(
|
||||
async (hometitleRouter) => {
|
||||
hometitleRouter.addHook('onRequest', async (request: FastifyRequest, reply: FastifyReply) => {
|
||||
await fastify.requireAuth(request as AuthRequest);
|
||||
});
|
||||
await hometitleRoutes(hometitleRouter);
|
||||
},
|
||||
{ prefix: '/hometitle' }
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user