UNPKG

882 BTypeScriptView Raw
1/** @module data */
2import { IChangeable } from './IChangeable';
3/**
4 * Interface for data objects that can track their changes, including logical deletion.
5 *
6 * @see [[IChangeable]]
7 *
8 * ### Example ###
9 *
10 * export class MyData implements IStringIdentifiable, ITrackable {
11 * public id: string;
12 * public field1: string;
13 * public field2: number;
14 * ...
15 * public change_time: Date;
16 * public create_time: Date;
17 * public deleted: boolean;
18 * }
19 */
20export interface ITrackable extends IChangeable {
21 /** The UTC time at which the object was created. */
22 create_time: Date;
23 /** The UTC time at which the object was last changed (created, updated, or deleted). */
24 change_time: Date;
25 /** The logical deletion flag. True when object is deleted and null or false otherwise */
26 deleted?: boolean;
27}