From 9d2cb42e4bba2b56938ddfa0328aaa8b967732e7 Mon Sep 17 00:00:00 2001 From: Dave Smith-Hayes Date: Mon, 18 Mar 2024 22:30:56 -0400 Subject: [PATCH] Add basic models for the show. --- app/src/model/Category.ts | 6 ++++++ app/src/model/Channel.ts | 19 +++++++++++++++++++ app/src/model/Episode.ts | 13 +++++++++++++ app/src/model/Image.ts | 8 ++++++++ app/src/model/User.ts | 6 ++++++ 5 files changed, 52 insertions(+) create mode 100644 app/src/model/Category.ts create mode 100644 app/src/model/Channel.ts create mode 100644 app/src/model/Episode.ts create mode 100644 app/src/model/Image.ts create mode 100644 app/src/model/User.ts diff --git a/app/src/model/Category.ts b/app/src/model/Category.ts new file mode 100644 index 0000000..20cb743 --- /dev/null +++ b/app/src/model/Category.ts @@ -0,0 +1,6 @@ +type Category = { + name: string, + categories?: Category[] +}; + +export default Category; diff --git a/app/src/model/Channel.ts b/app/src/model/Channel.ts new file mode 100644 index 0000000..9610bd9 --- /dev/null +++ b/app/src/model/Channel.ts @@ -0,0 +1,19 @@ +import Category from './Category'; +import Image from './Image'; +import Episode from './Episode'; + +type Channel = { + name: string, + description: string, + link: URL, + language: string, + copyright: string, + explicit: boolean, + category: Category, + + image: Image, + + episodes: Episode[], +}; + +export default Channel; diff --git a/app/src/model/Episode.ts b/app/src/model/Episode.ts new file mode 100644 index 0000000..3d30efa --- /dev/null +++ b/app/src/model/Episode.ts @@ -0,0 +1,13 @@ +import Image from './Image'; + +type Episode = { + title: string, + link: URL, + duration: string, + description: string, + explicit: boolean, + + image: Image, +}; + +export default Episode; diff --git a/app/src/model/Image.ts b/app/src/model/Image.ts new file mode 100644 index 0000000..2d61d22 --- /dev/null +++ b/app/src/model/Image.ts @@ -0,0 +1,8 @@ +type Image = { + title: string, + url: URL, + width?: number, + height?: number +}; + +export default Image; diff --git a/app/src/model/User.ts b/app/src/model/User.ts new file mode 100644 index 0000000..3fc5596 --- /dev/null +++ b/app/src/model/User.ts @@ -0,0 +1,6 @@ +type User = { + name: string, + email: string, +}; + +export default User;