Skip to content

Commit

Permalink
feat(common-general): add game and short user models
Browse files Browse the repository at this point in the history
  • Loading branch information
albertodigioacchino committed Jan 14, 2021
1 parent 55717e9 commit ae15d31
Show file tree
Hide file tree
Showing 7 changed files with 478 additions and 1 deletion.
449 changes: 449 additions & 0 deletions packages/common/package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
},
"devDependencies": {
"typescript": "4.1.3"
},
"dependencies": {
"firebase": "^8.2.1"
}
}
5 changes: 5 additions & 0 deletions packages/common/src/CreatedAt.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import fb from "firebase";

export interface CreatedAt {
createdAt: fb.firestore.Timestamp | fb.firestore.FieldValue;
}
2 changes: 2 additions & 0 deletions packages/common/src/firebaseCollections.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export enum FirebaseCollections {
Users = 'users',
DynamicData = 'dynamicData',
Games = 'games',
Decks = 'decks'
}
10 changes: 10 additions & 0 deletions packages/common/src/game.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {CreatedAt} from "./CreatedAt";
import {ShortUser} from "./user";

export interface Game extends CreatedAt {
scenarioTitle: string;
scenarioContent: string;
scenarioCardId: string | null;
deckId: string;
facilitator: ShortUser,
}
6 changes: 5 additions & 1 deletion packages/common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {FirebaseDocs} from "./firebaseDocs";
import {DevOpsMaturitiesDoc} from "./devOpsMaturitiesDoc";
import {GameRolesDoc} from "./gameRolesDoc";
import {Card, CardTypes, CardTags} from "./card";
import {Game} from "./game";
import {ShortUser} from "./user";

export {
FirebaseCollections,
Expand All @@ -14,6 +16,8 @@ export {
export type {
DevOpsMaturitiesDoc,
GameRolesDoc,
Card
Card,
Game,
ShortUser
};

4 changes: 4 additions & 0 deletions packages/common/src/user.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

export interface ShortUser {
id: string;
}

0 comments on commit ae15d31

Please sign in to comment.