Browse Source

organization page models

Vincent GUFFON 3 years ago
parent
commit
6bb552768a

+ 1 - 1
models/Core/Country.ts

@@ -1,4 +1,4 @@
-import {Str, Model, Uid, Attr} from '@vuex-orm/core'
+import {Str, Model, Uid} from '@vuex-orm/core'
 
 export class Country extends Model {
   static entity = 'countries'

+ 14 - 0
models/Network/Network.ts

@@ -0,0 +1,14 @@
+import {Str, Model, Uid, Attr} from '@vuex-orm/core'
+
+export class Network extends Model {
+  static entity = 'networks'
+
+  @Uid()
+  id!: number | string | null
+
+  @Str('')
+  name!: string
+
+  @Attr(null)
+  networkOrganizationId!: number | null
+}

+ 18 - 0
models/Network/NetworkOrganization.ts

@@ -0,0 +1,18 @@
+import {Str, Model, Uid, HasOne} from '@vuex-orm/core'
+import {Network} from "~/models/Network/Network";
+
+export class NetworkOrganization extends Model {
+  static entity = 'network_organizations'
+
+  @Uid()
+  id!: number | string | null
+
+  @HasOne(() => Network, 'networkOrganizationId')
+  network!: Network | null
+
+  @Str('')
+  startDate!: string
+
+  @Str('')
+  category!: string
+}

+ 9 - 0
models/Organization/Organization.ts

@@ -33,6 +33,9 @@ export class Organization extends Model {
   @Str('', { nullable: true })
   description!: string
 
+  @Attr([])
+  typeOfPractices!: []
+
   @Str('', { nullable: true })
   otherPractice!: string
 
@@ -66,6 +69,9 @@ export class Organization extends Model {
   @Str('', { nullable: true })
   twitter!: string
 
+  @Str('', { nullable: true })
+  youtube!: string
+
   @Str('', { nullable: true })
   facebook!: string
 
@@ -113,4 +119,7 @@ export class Organization extends Model {
 
   @Num(0, { nullable: true })
   pedagogicBudget!: number
+
+  @Str('', { nullable: true })
+  logo!: string
 }

+ 17 - 0
models/Organization/OrganizationArticle.ts

@@ -0,0 +1,17 @@
+import {Str, Model, Uid} from '@vuex-orm/core'
+
+export class OrganizationArticle extends Model {
+  static entity = 'organization_articles'
+
+  @Uid()
+  id!: number | string | null
+
+  @Str('')
+  title!: string
+
+  @Str('')
+  link!: string
+
+  @Str('')
+  date!: string
+}

+ 14 - 0
models/Organization/TypeOfPractice.ts

@@ -0,0 +1,14 @@
+import {Str, Model, Uid} from '@vuex-orm/core'
+
+export class TypeOfPractice extends Model {
+  static entity = 'type_of_practices'
+
+  @Uid()
+  id!: number | string | null
+
+  @Str('')
+  name!: string
+
+  @Str('')
+  category!: string
+}