t00-multiuser/server/objects/User.ts

41 lines
1.8 KiB
TypeScript
Raw Normal View History

2024-04-18 23:18:49 +01:00
export default class User {
2024-04-21 15:35:47 +01:00
public Id:number;
public Username:string;
public PasswordSalt:string;
public PasswordHash:string;
public CreatedByUserId:number;
public CreatedDatetime:Date;
public LastModifiedByUserId:number;
public LastModifiedDatetime:Date;
public DeletedByUserId:number;
public DeletedDatetime:Date;
public IsDeleted:boolean;
2024-04-18 23:18:49 +01:00
2024-04-21 15:35:47 +01:00
public constructor(id?:number, username?:string, passwordSalt?:string, passwordHash?:string, createdByUserId?:number, createdDateTime?:Date, lastModifiedByUserId?:number, lastModifiedDatetime?:Date, deletedByUserId?:number, deletedDatetime?:Date, isDeleted?:boolean) {
if (typeof(id) == "number" && typeof(username) == "string" && typeof(passwordHash) == "string" && typeof(passwordSalt) == "string" && typeof(createdByUserId) == "number" && createdDateTime instanceof Date && typeof(lastModifiedByUserId) == "number" && lastModifiedDatetime instanceof Date && typeof(deletedByUserId) == "number" && deletedDatetime instanceof Date && typeof(isDeleted) == "boolean") {
this.Id = id;
this.Username = username;
this.PasswordHash = passwordHash;
this.PasswordSalt = passwordSalt;
this.CreatedByUserId = createdByUserId;
this.CreatedDatetime = createdDateTime;
this.LastModifiedByUserId = lastModifiedByUserId;
this.LastModifiedDatetime = lastModifiedDatetime;
this.DeletedByUserId = deletedByUserId;
this.DeletedDatetime = deletedDatetime;
this.IsDeleted = isDeleted;
} else {
this.Id = Number.MIN_VALUE;
this.Username = "";
this.PasswordHash = "";
this.PasswordSalt = "";
this.CreatedByUserId = Number.MIN_VALUE;
this.CreatedDatetime = new Date(0);
this.LastModifiedByUserId = Number.MIN_VALUE;
this.LastModifiedDatetime = new Date(0);
this.DeletedByUserId = Number.MIN_VALUE;
this.DeletedDatetime = new Date(0);
this.IsDeleted = false;
}
2024-04-18 23:18:49 +01:00
}
}