From 407a5a3c6c1d6d4c170d7646f921bb6f2fb2f380 Mon Sep 17 00:00:00 2001 From: jw255 Date: Sat, 3 Mar 2018 16:18:01 +0000 Subject: now compiles. also added stubs for database testing --- coverage/project-code/src/db/model/Project.ts.html | 290 --------------------- 1 file changed, 290 deletions(-) delete mode 100644 coverage/project-code/src/db/model/Project.ts.html (limited to 'coverage/project-code/src/db/model/Project.ts.html') diff --git a/coverage/project-code/src/db/model/Project.ts.html b/coverage/project-code/src/db/model/Project.ts.html deleted file mode 100644 index b6270dc..0000000 --- a/coverage/project-code/src/db/model/Project.ts.html +++ /dev/null @@ -1,290 +0,0 @@ - - -
-| 1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 | -1x -1x - -1x -1x - - -1x - - - -1x - - -1x - - - -1x - - -1x - - - -1x - - - -1x - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | import { default as ContributorGroup } from './ContributorGroup';
-import { default as File } from './File';
-import { BelongsTo, BelongsToMany, Column, CreatedAt, ForeignKey,
- Model, PrimaryKey, Table, UpdatedAt } from 'sequelize-typescript';
-import { default as User } from './User';
-import { default as UserJoinsProject } from './UserJoinsProject';
-
-@Table
-export default class Project extends Model<Project> {
-
- @PrimaryKey
- @Column
- public name: string = '';
-
- @BelongsToMany(() => User, () => UserJoinsProject)
- public contributors: User[] = [];
-
- @ForeignKey(() => File)
- @Column
- public rootFolderId: string = '';
-
- @BelongsTo(() => File)
- public rootFolder: File = new File();
-
- @CreatedAt
- @Column
- public creationDate: Date = new Date();
-
- @UpdatedAt
- @Column
- public lastActivity: Date = new Date();
-
- public getAccessLevel(user: User): ContributorGroup {
- throw new Error(`unimplemented, ${this}`);
- }
-
- public getUserInfo(user: User): UserInfo {
- return {
- username: user.username,
- access_level: this.getAccessLevel(user)
- .toString()
- };
- }
-
- public getProjectFullInfo(): ProjectFullInfo {
- return {
- project_name: this.name,
- users: this.contributors
- .map<UserInfo>(
- (u: User) => this.getUserInfo(u)
- ),
- public_metadata: {
- creation_date: this.creationDate
- },
- // TODO: Check if we have anything to use these for yet?
- private_metadata: {},
- admin_metadata: {}
- };
- }
-}
-
-interface Metadata {}
-
-interface UserInfo {
- username: string;
- access_level: string;
-}
-
-export interface ProjectFullInfo {
- project_name: string;
- users: UserInfo[];
- public_metadata: Metadata;
- private_metadata?: Metadata;
- admin_metadata?: Metadata;
-}
- |