feat: add data access and feature libraries for return process, including models, schemas, and routes

This commit is contained in:
Lorenz Hilpert
2025-03-20 21:25:20 +01:00
parent fbd5414e47
commit db7da0699e
91 changed files with 1477 additions and 67 deletions

View File

@@ -1,3 +1,4 @@
export * from './lib/response-args.schema';
export * from './lib/entity-cotnainer';
export * from './lib/entity-container.schema';
export * from './lib/result';

View File

@@ -1,6 +1,6 @@
import { z } from 'zod';
const EntityContainerSchema = z.object({
const _EntityContainerSchema = z.object({
id: z.number(),
uId: z.string().optional(),
displayLabel: z.string().optional(),
@@ -8,8 +8,8 @@ const EntityContainerSchema = z.object({
selected: z.boolean().optional(),
});
export function EntityContainer<T>(data: z.ZodType<T>) {
return EntityContainerSchema.extend({
export function EntityContainerSchema<T>(data: z.ZodType<T>) {
return _EntityContainerSchema.extend({
data: data.optional(),
});
}

View File

@@ -0,0 +1,7 @@
export interface EntityContainer<T> {
id: number;
displayName?: string;
data?: T;
enabled?: boolean;
selected?: boolean;
}