handling stripe disputes/chargeback where renter disputes the charge through their credit card company or bank

This commit is contained in:
jackiettran
2026-01-08 17:23:55 -05:00
parent 5248c3dc39
commit 3042a9007f
9 changed files with 1119 additions and 1 deletions

View File

@@ -71,7 +71,7 @@ const Rental = sequelize.define("Rental", {
allowNull: false,
},
payoutStatus: {
type: DataTypes.ENUM("pending", "completed", "failed"),
type: DataTypes.ENUM("pending", "completed", "failed", "on_hold"),
allowNull: true,
},
payoutProcessedAt: {
@@ -94,6 +94,43 @@ const Rental = sequelize.define("Rental", {
bankDepositFailureCode: {
type: DataTypes.STRING,
},
// Dispute tracking fields (for tracking Stripe payment disputes/chargebacks)
stripeDisputeStatus: {
type: DataTypes.ENUM("open", "won", "lost", "warning_closed"),
allowNull: true,
},
stripeDisputeId: {
type: DataTypes.STRING,
allowNull: true,
},
stripeDisputeReason: {
type: DataTypes.STRING,
allowNull: true,
},
stripeDisputeAmount: {
type: DataTypes.INTEGER,
allowNull: true,
},
stripeDisputeCreatedAt: {
type: DataTypes.DATE,
allowNull: true,
},
stripeDisputeEvidenceDueBy: {
type: DataTypes.DATE,
allowNull: true,
},
stripeDisputeClosedAt: {
type: DataTypes.DATE,
allowNull: true,
},
stripeDisputeLost: {
type: DataTypes.BOOLEAN,
defaultValue: false,
},
stripeDisputeLostAmount: {
type: DataTypes.INTEGER,
allowNull: true,
},
// Refund tracking fields
refundAmount: {
type: DataTypes.DECIMAL(10, 2),