restructuring for rental requests. started double blind reviews

This commit is contained in:
jackiettran
2025-08-22 20:18:22 -04:00
parent 022c0b9c06
commit 5d85f77a19
15 changed files with 1305 additions and 1403 deletions

View File

@@ -39,6 +39,12 @@ const Rental = sequelize.define('Rental', {
type: DataTypes.DATE,
allowNull: false
},
startTime: {
type: DataTypes.STRING
},
endTime: {
type: DataTypes.STRING
},
totalAmount: {
type: DataTypes.DECIMAL(10, 2),
allowNull: false
@@ -61,6 +67,50 @@ const Rental = sequelize.define('Rental', {
notes: {
type: DataTypes.TEXT
},
// Renter's review of the item (existing fields renamed for clarity)
itemRating: {
type: DataTypes.INTEGER,
validate: {
min: 1,
max: 5
}
},
itemReview: {
type: DataTypes.TEXT
},
itemReviewSubmittedAt: {
type: DataTypes.DATE
},
itemReviewVisible: {
type: DataTypes.BOOLEAN,
defaultValue: false
},
// Owner's review of the renter
renterRating: {
type: DataTypes.INTEGER,
validate: {
min: 1,
max: 5
}
},
renterReview: {
type: DataTypes.TEXT
},
renterReviewSubmittedAt: {
type: DataTypes.DATE
},
renterReviewVisible: {
type: DataTypes.BOOLEAN,
defaultValue: false
},
// Private messages (always visible to recipient)
itemPrivateMessage: {
type: DataTypes.TEXT
},
renterPrivateMessage: {
type: DataTypes.TEXT
},
// Legacy fields for backwards compatibility
rating: {
type: DataTypes.INTEGER,
validate: {