mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-11-04 03:24:04 +00:00 
			
		
		
		
	Ready to create the notification
This commit is contained in:
		@@ -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;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user