39 lines
980 B
TypeScript
39 lines
980 B
TypeScript
import { IEngineSchema, MetaBy, MetaPermissions } from '@seed/engine/EngineSchema';
|
|
import { GraphQLJSONObject } from 'graphql-type-json';
|
|
import { InputType, ObjectType, Field, Int } from 'type-graphql';
|
|
|
|
@InputType()
|
|
@ObjectType()
|
|
export class PageBaseSchema {
|
|
@Field()
|
|
title: string;
|
|
|
|
@Field({ nullable: true })
|
|
label?: string;
|
|
|
|
@Field(() => GraphQLJSONObject, { nullable: true })
|
|
content?: any;
|
|
|
|
@Field(() => Int, { nullable: true })
|
|
position?: number;
|
|
|
|
@Field({ nullable: true })
|
|
toComplete?: boolean;
|
|
}
|
|
|
|
@ObjectType()
|
|
export class PageDBInterfaceSchema extends PageBaseSchema {}
|
|
|
|
@ObjectType()
|
|
export class PageDBSchema extends PageDBInterfaceSchema {}
|
|
|
|
@ObjectType({ implements: IEngineSchema })
|
|
export class PageSchema extends PageDBSchema implements IEngineSchema {
|
|
_id: string;
|
|
organisationId?: string | undefined;
|
|
by?: MetaBy | undefined;
|
|
permissions: MetaPermissions;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
}
|