import {Model} from '../../orm/src/model/Model.ts' import {Type} from '../../orm/src/db/types.ts' import {Field} from '../../orm/src/model/Field.ts' import LoginAttemptModel from './LoginAttempt.model.ts' import {Relation} from '../../orm/src/model/relation/decorators.ts' export default class UserModel extends Model { protected static table = 'daton_users' protected static key = 'user_id' protected static readonly CREATED_AT = 'created_at' protected static readonly UPDATED_AT = 'updated_at' @Field(Type.int) protected user_id?: number @Field(Type.varchar) protected first_name!: String @Field(Type.varchar) protected last_name!: String @Field(Type.bool) protected active!: Boolean @Relation() public login_attempts() { return this.has_many(LoginAttemptModel) } }