Open
Description
From @infomiho:
I feel like the updateUserStripePaymentDetails method is doing too much, it's used for:
updating subscriptionPlan
updating datePaid
incrementing the credits
updating subscriptionStatus
I'd recommend that we refactor it into multiple smaller methods that could be very specific about what they are updating:updateSubscriptionPlan
updateCreditsAmount
updateDatePaid
etc.
There are way to make this composable, so we only have one DB insert, we compose the data object for multiple updates and then execute the insert:
updateUserStripePaymentDetails([
createDatePaidUpdate(datePaid),
createSubscriptionStatusUpdate(subscriptionStatus),
])
Metadata
Metadata
Assignees
Labels
No labels