import * as Sequelize from 'sequelize';
import { DataTypes, Model, Optional } from 'sequelize';
export interface ActiveResidentAttributes {
	id?: string | null;
	full_name?: string | null;
	email?: string | null;
	phone?: string | null;
	id_card?: string | null;
	date_of_birth?: string | null;
	full_name_normalized?: string | null;
	email_normalized?: string | null;
	phone_normalized?: string | null;
	id_card_normalized?: string | null;
	emergency_contact_name?: string | null;
	emergency_contact_phone?: string | null;
	emergency_contact_relationship?: string | null;
	status?: 'active' | 'inactive' | 'moved_out' | null;
	version?: number | null;
	deleted_at?: Date | null;
	deleted_by?: string | null;
	created_by?: string | null;
	updated_by?: string | null;
	created_at?: Date | null;
	updated_at?: Date | null;
	user_id?: string | null;
}
export type ActiveResidentPk = 'id';
export type ActiveResidentId = ActiveResident[ActiveResidentPk];
export type ActiveResidentOptionalAttributes =
	| 'id'
	| 'full_name'
	| 'email'
	| 'phone'
	| 'id_card'
	| 'date_of_birth'
	| 'full_name_normalized'
	| 'email_normalized'
	| 'phone_normalized'
	| 'id_card_normalized'
	| 'emergency_contact_name'
	| 'emergency_contact_phone'
	| 'emergency_contact_relationship'
	| 'status'
	| 'version'
	| 'deleted_at'
	| 'deleted_by'
	| 'created_by'
	| 'updated_by'
	| 'created_at'
	| 'updated_at'
	| 'user_id';
export type ActiveResidentCreationAttributes = Optional<ActiveResidentAttributes, ActiveResidentOptionalAttributes>;
export class ActiveResident extends Model<ActiveResidentAttributes> implements ActiveResidentAttributes {
	id?: string;
	declare full_name?: string | null;
	declare email?: string | null;
	declare phone?: string | null;
	declare id_card?: string | null;
	declare date_of_birth?: string | null;
	declare full_name_normalized?: string | null;
	declare email_normalized?: string | null;
	declare phone_normalized?: string | null;
	declare id_card_normalized?: string | null;
	declare emergency_contact_name?: string | null;
	declare emergency_contact_phone?: string | null;
	declare emergency_contact_relationship?: string | null;
	declare status?: 'active' | 'inactive' | 'moved_out' | null;
	declare version?: number | null;
	declare deleted_at?: Date | null;
	declare deleted_by?: string | null;
	declare created_by?: string | null;
	declare updated_by?: string | null;
	declare created_at?: Date | null;
	declare updated_at?: Date | null;
	declare user_id?: string | null;
	static initModel(sequelize: Sequelize.Sequelize): typeof ActiveResident {
		return ActiveResident.init(
			{
				id: {
					type: DataTypes.UUID,
					allowNull: true,
					primaryKey: true,
				},
				full_name: {
					type: DataTypes.STRING(200),
					allowNull: true,
				},
				email: {
					type: DataTypes.STRING(255),
					allowNull: true,
				},
				phone: {
					type: DataTypes.STRING(25),
					allowNull: true,
				},
				id_card: {
					type: DataTypes.STRING(50),
					allowNull: true,
				},
				date_of_birth: {
					type: DataTypes.DATEONLY,
					allowNull: true,
				},
				full_name_normalized: {
					type: DataTypes.STRING(200),
					allowNull: true,
				},
				email_normalized: {
					type: DataTypes.STRING(255),
					allowNull: true,
				},
				phone_normalized: {
					type: DataTypes.STRING(25),
					allowNull: true,
				},
				id_card_normalized: {
					type: DataTypes.STRING(50),
					allowNull: true,
				},
				emergency_contact_name: {
					type: DataTypes.STRING(200),
					allowNull: true,
				},
				emergency_contact_phone: {
					type: DataTypes.STRING(25),
					allowNull: true,
				},
				emergency_contact_relationship: {
					type: DataTypes.STRING(100),
					allowNull: true,
				},
				status: {
					type: DataTypes.ENUM('active', 'inactive', 'moved_out'),
					allowNull: true,
				},
				version: {
					type: DataTypes.INTEGER,
					allowNull: true,
				},
				deleted_at: {
					type: DataTypes.DATE,
					allowNull: true,
				},
				deleted_by: {
					type: DataTypes.UUID,
					allowNull: true,
				},
				created_by: {
					type: DataTypes.UUID,
					allowNull: true,
				},
				updated_by: {
					type: DataTypes.UUID,
					allowNull: true,
				},
				created_at: {
					type: DataTypes.DATE,
					allowNull: true,
				},
				updated_at: {
					type: DataTypes.DATE,
					allowNull: true,
				},
				user_id: {
					type: DataTypes.UUID,
					allowNull: true,
				},
			},
			{
				sequelize,
				tableName: 'active_residents',
				schema: 'public',
				timestamps: false,
			},
		);
	}
}
