refund and delayed charge

This commit is contained in:
jackiettran
2025-09-04 16:44:47 -04:00
parent b59fc07fc3
commit b22e4fa910
19 changed files with 1255 additions and 594 deletions

View File

@@ -43,18 +43,10 @@ const Rental = sequelize.define("Rental", {
type: DataTypes.DECIMAL(10, 2),
allowNull: false,
},
baseRentalAmount: {
type: DataTypes.DECIMAL(10, 2),
allowNull: false,
},
platformFee: {
type: DataTypes.DECIMAL(10, 2),
allowNull: false,
},
processingFee: {
type: DataTypes.DECIMAL(10, 2),
allowNull: false,
},
payoutAmount: {
type: DataTypes.DECIMAL(10, 2),
allowNull: false,
@@ -83,6 +75,28 @@ const Rental = sequelize.define("Rental", {
stripeTransferId: {
type: DataTypes.STRING,
},
// Refund tracking fields
refundAmount: {
type: DataTypes.DECIMAL(10, 2),
},
refundProcessedAt: {
type: DataTypes.DATE,
},
refundReason: {
type: DataTypes.TEXT,
},
stripeRefundId: {
type: DataTypes.STRING,
},
cancelledBy: {
type: DataTypes.ENUM("renter", "owner"),
},
cancelledAt: {
type: DataTypes.DATE,
},
stripePaymentMethodId: {
type: DataTypes.STRING,
},
deliveryMethod: {
type: DataTypes.ENUM("pickup", "delivery"),
defaultValue: "pickup",