1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-09-18 21:28:47 +00:00

Ready to create the notification

This commit is contained in:
2020-03-24 08:07:50 +01:00
parent edc68a0275
commit e6c610a3c0
2 changed files with 143 additions and 4 deletions

View File

@@ -48,7 +48,7 @@ export enum NotifEventVisibility {
export interface NotifBuilder {
id ?: number,
timeCreate: number,
timeCreate ?: number,
seen ?: boolean,
fromUserID: number,
destUserID ?: number,
@@ -61,7 +61,8 @@ export interface NotifBuilder {
}
export class Notif implements NotifBuilder {
id ?: number; timeCreate: number;
id ?: number;
timeCreate ?: number;
seen ?: boolean;
fromUserID: number;
destUserID ?: number;
@@ -79,4 +80,38 @@ export class Notif implements NotifBuilder {
}
}
}
get hasId() : boolean {
return this.id > 0
}
get hasSeen() : boolean {
return this.seen === true || this.seen === false
}
get hasFromUserID() : boolean {
return this.fromUserID > 0
}
get hasDestUserID() : boolean {
return this.destUserID > 0
}
get hasType() : boolean {
return this.type != null && this.type != undefined
}
get hasOnElemID() : boolean {
return this.onElemID > 0
}
get hasOnElemType() : boolean {
return this.onElemType != null && this.onElemType != undefined
}
get hasTimeCreate() : boolean {
return this.timeCreate != null
&& this.timeCreate != undefined
&& this.timeCreate > 0;
}
}