channel.model.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import { BaseModel, BooleanField, IntField, Model, ManyToOne, StringField } from 'warthog';
  2. import { Block } from '../block/block.model';
  3. @Model({ api: {} })
  4. export class Channel extends BaseModel {
  5. @StringField({
  6. description: `The title of the Channel`,
  7. })
  8. title!: string;
  9. @StringField({
  10. description: `The description of a Channel`,
  11. })
  12. description!: string;
  13. @StringField({
  14. description: `Url for Channel's cover (background) photo. Recommended ratio: 16:9.`,
  15. })
  16. coverPhotoUrl!: string;
  17. @StringField({
  18. description: `Channel's avatar photo.`,
  19. })
  20. avatarPhotoUrl!: string;
  21. @BooleanField({
  22. description: `Flag signaling whether a channel is public.`,
  23. })
  24. isPublic!: boolean;
  25. @BooleanField({
  26. description: `Flag signaling whether a channel is curated/verified.`,
  27. })
  28. isCurated!: boolean;
  29. @IntField({
  30. nullable: true,
  31. description: `The primary langauge of the channel's content`,
  32. })
  33. languageId?: number;
  34. @ManyToOne(() => Block, (param: Block) => param.channels, {
  35. skipGraphQLField: true,
  36. })
  37. happenedIn!: Block;
  38. constructor(init?: Partial<Channel>) {
  39. super();
  40. Object.assign(this, init);
  41. }
  42. }