2018-09-13 09:23:57 +02:00
|
|
|
import { BaseModel } from '../base/base-model';
|
2018-07-04 17:51:31 +02:00
|
|
|
|
2018-10-16 12:41:46 +02:00
|
|
|
/**
|
|
|
|
* The content every personal note has.
|
|
|
|
*/
|
|
|
|
export interface PersonalNoteContent {
|
|
|
|
/**
|
|
|
|
* Users can star content to mark as favorite.
|
|
|
|
*/
|
|
|
|
star: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Users can save their notes.
|
|
|
|
*/
|
|
|
|
note: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* All notes are assigned to their object (given by collection string and id)
|
|
|
|
*/
|
|
|
|
export interface PersonalNotesFormat {
|
|
|
|
[collectionString: string]: {
|
|
|
|
[id: number]: PersonalNoteContent;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The base personal note object.
|
|
|
|
*/
|
|
|
|
export interface PersonalNoteObject {
|
|
|
|
/**
|
|
|
|
* Every personal note object has an id.
|
|
|
|
*/
|
|
|
|
id: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The user for the object.
|
|
|
|
*/
|
|
|
|
user_id: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The actual notes arranged in a specific format.
|
|
|
|
*/
|
|
|
|
notes: PersonalNotesFormat;
|
|
|
|
}
|
|
|
|
|
2018-07-12 14:11:31 +02:00
|
|
|
/**
|
|
|
|
* Representation of users personal note.
|
|
|
|
* @ignore
|
|
|
|
*/
|
2018-10-16 12:41:46 +02:00
|
|
|
export class PersonalNote extends BaseModel<PersonalNote> implements PersonalNoteObject {
|
2018-08-29 13:21:25 +02:00
|
|
|
public id: number;
|
|
|
|
public user_id: number;
|
2018-10-16 12:41:46 +02:00
|
|
|
public notes: PersonalNotesFormat;
|
2018-07-04 17:51:31 +02:00
|
|
|
|
2018-09-04 11:33:28 +02:00
|
|
|
public constructor(input: any) {
|
2018-09-10 11:15:12 +02:00
|
|
|
super('users/personal-note', input);
|
2018-07-04 17:51:31 +02:00
|
|
|
}
|
|
|
|
|
2018-09-13 09:23:57 +02:00
|
|
|
public getTitle(): string {
|
|
|
|
return 'Personal note';
|
2018-09-13 07:57:38 +02:00
|
|
|
}
|
2018-07-04 17:51:31 +02:00
|
|
|
}
|