module.exports = (sequelize, DataTypes) => {
	const RefreshTokens = sequelize.define(
		'RefreshTokens',
		{
			id: {
				type: DataTypes.UUID,
				defaultValue: DataTypes.UUIDV4,
				primaryKey: true,
				allowNull: false,
			},
			user_id: {
				type: DataTypes.UUID,
				allowNull: false,
			},
			user_type: {
				type: DataTypes.STRING,
				allowNull: false,
			},
			token: {
				type: DataTypes.STRING,
				allowNull: false,
			},
			expiration: {
				type: DataTypes.DATE,
				allowNull: false,
			},
		},
		{
			tableName: 'refresh_tokens',
			timestamps: false,
		},
	);

	return RefreshTokens;
};
