MAI CALL - step 5

This commit is contained in:
2026-05-16 15:42:52 +01:00
parent f10a346356
commit d5ab1e5463
5 changed files with 85 additions and 2 deletions
+4
View File
@@ -1,8 +1,12 @@
import { router } from '../trpc';
import { pingRouter } from './ping';
import { workstationRouter } from './workstation';
import { userRouter } from './user';
export const appRouter = router({
ping: pingRouter,
workstation: workstationRouter,
user: userRouter,
});
export type AppRouter = typeof appRouter;
+11
View File
@@ -0,0 +1,11 @@
import { protectedProcedure, router } from '../trpc';
export const userRouter = router({
listOperators: protectedProcedure.query(({ ctx }) => {
return ctx.db.user.findMany({
where: { role: 'OPERATOR' },
select: { id: true, email: true },
orderBy: { email: 'asc' },
});
}),
});
+9
View File
@@ -0,0 +1,9 @@
import { protectedProcedure, router } from '../trpc';
export const workstationRouter = router({
list: protectedProcedure.query(({ ctx }) => {
return ctx.db.workstation.findMany({
orderBy: [{ area: 'asc' }, { code: 'asc' }],
});
}),
});
+2 -2
View File
@@ -1,4 +1,4 @@
export { prisma, type DbClient } from './client';
export { tenantScoped, type TenantScopedClient } from './tenant-extension';
export { Prisma, UserRole } from '@prisma/client';
export type { User, Tenant, Workstation, DomainEvent } from '@prisma/client';
export { Prisma, UserRole, MaintenanceRequestStatus } from '@prisma/client';
export type { User, Tenant, Workstation, DomainEvent, MaintenanceRequest } from '@prisma/client';