{"version":3,"sources":["../src/models/user.model.ts"],"sourcesContent":["import { DateTime } from \"luxon\";\nimport { CryptoHelper } from \"../helpers/crypto.helper\";\n\nexport type User = {\n  id: number;\n  username: string;\n  password: string | undefined;\n  email: string;\n  isBlocked: boolean;\n  loginAttempts: number;\n  emailConfirmedAt: Date | undefined;\n  termsAcceptedAt: Date | undefined;\n};\n\nexport const createUser = (\n  email: string,\n  username?: string,\n  password?: string\n): User => {\n  if (!username) {\n    const unixNow = DateTime.now().toUnixInteger();\n    username = `u${unixNow}`;\n  }\n\n  if (password) {\n    password = CryptoHelper.cryptPassword(password);\n  }\n\n  const user: User = {\n    id: 0,\n    username,\n    password,\n    email,\n    isBlocked: true,\n    loginAttempts: 0,\n    emailConfirmedAt: undefined,\n    termsAcceptedAt: undefined,\n  };\n\n  return user;\n};\n"],"mappings":";;;;;;;;;;AAAA,SAAS,gBAAgB;AAAzB,IAca;AAdb;AAAA;AAAA;AACA;AAaO,IAAM,aAAa,CACxB,OACA,UACA,aACS;AACT,UAAI,CAAC,UAAU;AACb,cAAM,UAAU,SAAS,IAAI,EAAE,cAAc;AAC7C,mBAAW,IAAI,OAAO;AAAA,MACxB;AAEA,UAAI,UAAU;AACZ,mBAAW,aAAa,cAAc,QAAQ;AAAA,MAChD;AAEA,YAAM,OAAa;AAAA,QACjB,IAAI;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,QACA,WAAW;AAAA,QACX,eAAe;AAAA,QACf,kBAAkB;AAAA,QAClB,iBAAiB;AAAA,MACnB;AAEA,aAAO;AAAA,IACT;AAAA;AAAA;","names":[]}