next billing date

This commit is contained in:
CHIEFSOFT\ameye
2025-08-30 07:16:44 -04:00
parent 57c5e8afc5
commit 9d8aab3585
4 changed files with 77 additions and 25 deletions
+3 -1
View File
@@ -24,6 +24,7 @@ class Members(db.Model):
profile_completed = db.Column(db.DateTime(timezone=False))
stripe_customer_id = db.Column(db.String(100), nullable=True)
option_name = db.Column(db.String(100), nullable=True)
next_billing= db.Column(db.DateTime(timezone=False))
def to_dict(self):
return {
@@ -43,6 +44,7 @@ class Members(db.Model):
"firstname": self.firstname,
"lastname": self.lastname,
'option_name': self.option_name,
"next_billing": self.next_billing,
"stripe_customer_id": self.stripe_customer_id
}
@@ -134,7 +136,7 @@ class Members(db.Model):
member = cls.query.filter_by(id=member_id).first()
if not member:
raise ValueError(f"Member with ID {member_id} does not exist.")
# Update stripe_customer_id
# Update next_billing
member.next_billing = next_billing
return next_billing