addded payment records

This commit is contained in:
CHIEFSOFT\ameye
2025-08-30 10:24:39 -04:00
parent a604aeba8a
commit 477d97e045
3 changed files with 67 additions and 18 deletions
+6 -15
View File
@@ -61,6 +61,12 @@ class Payments(db.Model):
return pay_data
@classmethod
def get_member_payments_by_member_id(cls, member_id):
member_payments = cls.query.filter_by(member_id=str(member_id))
if not member_payments:
return None
return member_payments
def to_dict(self):
return {
@@ -81,18 +87,3 @@ class Payments(db.Model):
def __repr__(self):
return f'<Payments {self.id}>'
'''
id SERIAL,
uid uuid DEFAULT uuid_generate_v4(),
member_id INT REFERENCES members(id),
option_name VARCHAR(100) REFERENCES subscription_options(option_name),
option_type VARCHAR(25),
payment_uid VARCHAR(100) UNIQUE NOT NULL,
amount INT DEFAULT 0,
status INT DEFAULT 1,
added timestamp without time zone DEFAULT now(),
sub_start timestamp without time zone,
next_billing timestamp without time zone,
sub_stop timestamp without time zone
'''