import { IEngineSchema, MetaBy, MetaPermissions } from '@seed/engine/EngineSchema'; import { Field, InputType, ObjectType } from 'type-graphql'; import { CountryCodesComponentEnum } from '@seed/services/geolocation/components/countries'; import { TranslatableComponent } from '@src/__components/components'; import { CurrencyCodesComponentEnum } from '../country.components'; @InputType() @ObjectType() export class CountryBaseSchema { @Field(() => TranslatableComponent) countryName: TranslatableComponent; @Field(() => CountryCodesComponentEnum) countryCode: CountryCodesComponentEnum; @Field(() => [CurrencyCodesComponentEnum]) currencyCodes: CurrencyCodesComponentEnum[]; } @ObjectType() export class CountryDBInterfaceSchema extends CountryBaseSchema {} @ObjectType() export class CountryDBSchema extends CountryDBInterfaceSchema {} @ObjectType({ implements: IEngineSchema }) export class CountrySchema extends CountryDBSchema implements IEngineSchema { _id: string; organisationId?: string | undefined; by?: MetaBy | undefined; permissions: MetaPermissions; createdAt: Date; updatedAt: Date; }