import * as Sequelize from 'sequelize';
import { DataTypes, Model, Optional } from 'sequelize';
export interface ActiveUserAttributes {
	id?: string | null;
	email?: string | null;
	username?: string | null;
	first_name?: string | null;
	last_name?: string | null;
	primary_role_name?: string | null;
	last_login_at?: Date | null;
	created_at?: Date | null;
}
export type ActiveUserPk = 'id';
export type ActiveUserId = ActiveUser[ActiveUserPk];
export type ActiveUserOptionalAttributes =
	| 'id'
	| 'email'
	| 'username'
	| 'first_name'
	| 'last_name'
	| 'primary_role_name'
	| 'last_login_at'
	| 'created_at';
export type ActiveUserCreationAttributes = Optional<ActiveUserAttributes, ActiveUserOptionalAttributes>;
export class ActiveUser extends Model<ActiveUserAttributes> implements ActiveUserAttributes {
	id?: string;
	declare email?: string | null;
	declare username?: string | null;
	declare first_name?: string | null;
	declare last_name?: string | null;
	declare primary_role_name?: string | null;
	declare last_login_at?: Date | null;
	declare created_at?: Date | null;
	static initModel(sequelize: Sequelize.Sequelize): typeof ActiveUser {
		return ActiveUser.init(
			{
				id: {
					type: DataTypes.UUID,
					allowNull: true,
					primaryKey: true,
				},
				email: {
					type: DataTypes.TEXT,
					allowNull: true,
				},
				username: {
					type: DataTypes.TEXT,
					allowNull: true,
				},
				first_name: {
					type: DataTypes.STRING(100),
					allowNull: true,
				},
				last_name: {
					type: DataTypes.STRING(100),
					allowNull: true,
				},
				primary_role_name: {
					type: DataTypes.STRING(50),
					allowNull: true,
				},
				last_login_at: {
					type: DataTypes.DATE,
					allowNull: true,
				},
				created_at: {
					type: DataTypes.DATE,
					allowNull: true,
				},
			},
			{
				sequelize,
				tableName: 'active_users',
				schema: 'public',
				timestamps: false,
			},
		);
	}
}
