import * as Sequelize from 'sequelize';
import { DataTypes, Model, Optional } from 'sequelize';
export interface UserRoleDetailAttributes {
	user_id?: string | null;
	email?: string | null;
	username?: string | null;
	role_id?: string | null;
	role_name?: string | null;
	role_description?: string | null;
	is_primary?: boolean | null;
	assigned_at?: Date | null;
	assigned_by?: string | null;
	assigned_by_email?: string | null;
}
export type UserRoleDetailOptionalAttributes =
	| 'user_id'
	| 'email'
	| 'username'
	| 'role_id'
	| 'role_name'
	| 'role_description'
	| 'is_primary'
	| 'assigned_at'
	| 'assigned_by'
	| 'assigned_by_email';
export type UserRoleDetailCreationAttributes = Optional<UserRoleDetailAttributes, UserRoleDetailOptionalAttributes>;
export class UserRoleDetail extends Model<UserRoleDetailAttributes> implements UserRoleDetailAttributes {
	user_id?: string;
	declare email?: string | null;
	declare username?: string | null;
	declare role_id?: string | null;
	declare role_name?: string | null;
	declare role_description?: string | null;
	declare is_primary?: boolean | null;
	declare assigned_at?: Date | null;
	declare assigned_by?: string | null;
	declare assigned_by_email?: string | null;
	static initModel(sequelize: Sequelize.Sequelize): typeof UserRoleDetail {
		return UserRoleDetail.init(
			{
				user_id: {
					type: DataTypes.UUID,
					allowNull: true,
				},
				email: {
					type: DataTypes.TEXT,
					allowNull: true,
				},
				username: {
					type: DataTypes.TEXT,
					allowNull: true,
				},
				role_id: {
					type: DataTypes.UUID,
					allowNull: true,
				},
				role_name: {
					type: DataTypes.STRING(50),
					allowNull: true,
				},
				role_description: {
					type: DataTypes.TEXT,
					allowNull: true,
				},
				is_primary: {
					type: DataTypes.BOOLEAN,
					allowNull: true,
				},
				assigned_at: {
					type: DataTypes.DATE,
					allowNull: true,
				},
				assigned_by: {
					type: DataTypes.UUID,
					allowNull: true,
				},
				assigned_by_email: {
					type: DataTypes.TEXT,
					allowNull: true,
				},
			},
			{
				sequelize,
				tableName: 'user_role_details',
				schema: 'public',
				timestamps: false,
			},
		);
	}
}
