All files / app/models/user user-dto.ts

100% Statements 8/8
100% Branches 0/0
100% Functions 1/1
100% Lines 8/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73      1x                                   174x 174x 174x 174x 174x 174x 174x                                                                                          
/**
 * The data transfer object for {@link User}
 */
export class UserDto {
  /**
   * Creates an instance of this class.
   * @param username   -  Username
   * @param email      -  Email
   * @param isBetaUser -  Whether or not the user has access to the beta version
   * @param createdAt  -  When the user was created
   * @param updatedAt  -  When the user was last updated
   * @param deletedAt  -  When the user was deleted
   */
  constructor(
      id: number,
      username: string,
      email: string,
      isBetaUser: boolean,
      createdAt: Date,
      updatedAt: Date,
      deletedAt: Date) {
    this.id = id;
    this.username = username;
    this.email = email;
    this.isBetaUser = isBetaUser;
    this.createdAt = createdAt;
    this.updatedAt = updatedAt;
    this.deletedAt = deletedAt;
  }
 
  /**
   * Primary key.
   */
  public id: number;
 
  /**
   * Username (not email).
   *
   * Is unique
   */
  public username: string;
 
  /**
   * Email of the user.
   *
   * Is not allowed to be null or empty
   */
  public email: string;
 
  /**
   * Whether or not the user has access to the beta build.
   *
   * The default value is false and is never updated by a client request.
   */
  public isBetaUser: boolean;
 
  // Timestamps
  /**
   * The date and time the user was created
   */
  public createdAt: Date;
 
  /**
   * The date and time the user was updated
   */
  public updatedAt: Date;
 
  /**
   * The date and time the user was deleted
   */
  public deletedAt: Date;
}