think/packages/domains/src/models/document.ts

42 lines
734 B
TypeScript
Raw Normal View History

2022-03-12 02:31:03 +00:00
import { IUser } from './user';
import { IWiki } from './wiki';
2022-03-11 05:57:55 +00:00
/**
*
*/
export enum DocumentStatus {
2022-03-12 02:31:03 +00:00
private = 'private',
public = 'public',
2022-03-11 05:57:55 +00:00
}
/**
*
*/
export interface IDocument {
id: string;
2022-03-12 02:31:03 +00:00
wikiId: IWiki['id'];
2022-03-11 05:57:55 +00:00
isWikiHome: boolean;
2022-03-12 02:31:03 +00:00
createUserId: IUser['id'];
2022-03-11 05:57:55 +00:00
createUser: IUser;
2022-03-12 02:31:03 +00:00
parentDocumentId?: IDocument['id'];
2022-03-11 05:57:55 +00:00
title: string;
content: string;
status: DocumentStatus;
views: number;
sharePassword?: string;
createdAt: Date;
updatedAt: Date;
children?: IDocument[];
}
/**
*
*/
export interface IAuthority {
id: string;
2022-03-12 02:31:03 +00:00
documentId: IDocument['id'];
userId: IUser['id'];
2022-03-11 05:57:55 +00:00
readable: boolean;
editable: boolean;
}