creating rough models to make everythigg work
This commit is contained in:
@@ -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(),
|
||||||
|
) {}
|
||||||
|
}
|
||||||
@@ -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(),
|
||||||
|
) {}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user