diff --git a/packages/core/src/models/content.model.ts b/packages/core/src/models/content.model.ts new file mode 100644 index 0000000..9cb156e --- /dev/null +++ b/packages/core/src/models/content.model.ts @@ -0,0 +1,40 @@ +import { Timestamp } from 'firebase/firestore'; + +interface IContent { + id: string; + creatorUserId: string; + contentUrl: string; // remote resource of file/media + createdDate: Timestamp; + + // visitCount +} + +// ? persist length of clip for easier viewing for others... +// ?they have to load it anyway and will get metadata anyway? +export class AudioClip implements IContent { + constructor( + public id: string, + public creatorUserId: string, + public contentUrl: string, + public createdDate: Timestamp = Timestamp.now(), + ) {} +} + +export class Link implements IContent { + constructor( + public id: string, + public creatorUserId: string, + public contentUrl: string, + public createdDate: Timestamp = Timestamp.now(), + ) {} +} + +export class Image implements IContent { + constructor( + public id: string, + public creatorUserId: string, + public contentUrl: string, + public thumbnailUrl?: string, + public createdDate: Timestamp = Timestamp.now(), + ) {} +} diff --git a/packages/core/src/models/conversation.model.ts b/packages/core/src/models/conversation.model.ts new file mode 100644 index 0000000..cc7004f --- /dev/null +++ b/packages/core/src/models/conversation.model.ts @@ -0,0 +1,22 @@ +import { FieldValue, serverTimestamp, Timestamp } from 'firebase/firestore'; +export default class Conversation { + constructor( + public id: string, + public name: string, + + public createdByUserId: string, + + public lastUpdatedDate, + + public createdDate, + ) {} +} + +export class Member { + constructor( + public id: string, + public userId: string, + public role: 'admin' | 'regular', + public joinedDate = serverTimestamp(), + ) {} +}