const { DataTypes } = require('sequelize'); const sequelize = require('../config/database'); const ItemRequestResponse = sequelize.define('ItemRequestResponse', { id: { type: DataTypes.UUID, defaultValue: DataTypes.UUIDV4, primaryKey: true }, itemRequestId: { type: DataTypes.UUID, allowNull: false, references: { model: 'ItemRequests', key: 'id' } }, responderId: { type: DataTypes.UUID, allowNull: false, references: { model: 'Users', key: 'id' } }, message: { type: DataTypes.TEXT, allowNull: false }, offerPricePerHour: { type: DataTypes.DECIMAL(10, 2) }, offerPricePerDay: { type: DataTypes.DECIMAL(10, 2) }, offerPricePerWeek: { type: DataTypes.DECIMAL(10, 2) }, offerPricePerMonth: { type: DataTypes.DECIMAL(10, 2) }, availableStartDate: { type: DataTypes.DATE }, availableEndDate: { type: DataTypes.DATE }, existingItemId: { type: DataTypes.UUID, allowNull: true, references: { model: 'Items', key: 'id' } }, status: { type: DataTypes.ENUM('pending', 'accepted', 'declined', 'expired'), defaultValue: 'pending' }, contactInfo: { type: DataTypes.STRING } }); module.exports = ItemRequestResponse;