diff options
| author | Tom Harley | 2018-02-20 16:21:30 +0000 |
|---|---|---|
| committer | Tom Harley | 2018-02-20 16:21:30 +0000 |
| commit | eba2d2c0b0293e9dd146a377a85ff6c31e4b96cb (patch) | |
| tree | 8351e174ee8ac7249f61286dd52bccd46f147a31 /src/db/model/ContributorGroup.ts | |
| parent | minor fixes (diff) | |
| parent | Merge branch 'trh/yarn' into 'master' (diff) | |
| download | medicine-eba2d2c0b0293e9dd146a377a85ff6c31e4b96cb.tar.gz medicine-eba2d2c0b0293e9dd146a377a85ff6c31e4b96cb.zip | |
Merge branch ‘master’ into trh/payload-checker
Diffstat (limited to 'src/db/model/ContributorGroup.ts')
| -rw-r--r-- | src/db/model/ContributorGroup.ts | 73 |
1 files changed, 38 insertions, 35 deletions
diff --git a/src/db/model/ContributorGroup.ts b/src/db/model/ContributorGroup.ts index 0fe859d..6bbcf4a 100644 --- a/src/db/model/ContributorGroup.ts +++ b/src/db/model/ContributorGroup.ts @@ -1,51 +1,54 @@ -import {Table, Model, Column, AllowNull, HasMany} from 'sequelize-typescript'; +import { AllowNull, Column, DataType, HasMany, Model, Table + } from 'sequelize-typescript'; import { default as UserJoinsProject } from './UserJoinsProject'; @Table export default class ContributorGroup extends Model<ContributorGroup> { - @AllowNull - @Column - name: string; + @AllowNull + @Column(DataType.TEXT) + public name: string | null = null; - // "Error: Foreign key for "ContributorGroup" is missing on "UserJoinsProject"." - @HasMany(() => UserJoinsProject, 'contributorGroupId') - uses: UserJoinsProject[]; + /* "Error: Foreign key for "ContributorGroup" + * is missing on "UserJoinsProject"." */ + @HasMany(() => UserJoinsProject, 'contributorGroupId') + public uses: UserJoinsProject[] = []; - @Column - canCreateFiles: boolean; + @Column + public canCreateFiles: boolean = false; - @Column - canDeleteFiles: boolean; + @Column + public canDeleteFiles: boolean = false; - @Column - canViewFiles: boolean; + @Column + public canViewFiles: boolean = false; - @Column - canAddUsers: boolean; + @Column + public canAddUsers: boolean = false; - @Column - canRemoveUsers: boolean; + @Column + public canRemoveUsers: boolean = false; - @Column - canEditUserPermissions: boolean; + @Column + public canEditUserPermissions: boolean = false; - @Column - description: string; + @AllowNull + @Column(DataType.TEXT) + public description: string | null = null; - @Column - isInternal: boolean; + @Column + public isInternal: boolean = true; - getGroupFullInfo(): GroupFullInfo { - return { - role: this.name, - description: this.description, - internal: this.isInternal - }; - } + public getContributorGroupFullInfo(): ContributorGroupFullInfo { + return { + role: `${this.name}`, + description: `${this.description}`, + internal: this.isInternal + }; + } } -type GroupFullInfo = { - role: string, - description: string, - internal: boolean -}; +export interface ContributorGroupFullInfo { + role: string; + description: string; + internal: boolean; +} |
