chore: Docs, define additional client-side relations
This commit is contained in:
@@ -1,22 +1,28 @@
|
||||
import { observable } from "mobx";
|
||||
import Document from "./Document";
|
||||
import User from "./User";
|
||||
import Model from "./base/Model";
|
||||
import Field from "./decorators/Field";
|
||||
import Relation from "./decorators/Relation";
|
||||
|
||||
/**
|
||||
* A subscription represents a request for a user to receive notifications for
|
||||
* a document.
|
||||
* A subscription represents a request for a user to receive notifications for a document.
|
||||
*/
|
||||
class Subscription extends Model {
|
||||
@Field
|
||||
@observable
|
||||
id: string;
|
||||
|
||||
/** The user subscribing */
|
||||
/** The user ID subscribing */
|
||||
userId: string;
|
||||
|
||||
/** The document being subscribed to */
|
||||
/** The user subscribing */
|
||||
@Relation(() => User, { onDelete: "cascade" })
|
||||
user?: User;
|
||||
|
||||
/** The document ID being subscribed to */
|
||||
documentId: string;
|
||||
|
||||
/** The document being subscribed to */
|
||||
@Relation(() => Document, { onDelete: "cascade" })
|
||||
document?: Document;
|
||||
|
||||
/** The event being subscribed to */
|
||||
@Field
|
||||
@observable
|
||||
|
||||
Reference in New Issue
Block a user