percent_completed

This commit is contained in:
CHIEFSOFT\ameye
2026-05-20 20:42:31 -04:00
parent 1c43454dea
commit 5e5edf27b2
4 changed files with 40 additions and 7 deletions
+36 -1
View File
@@ -1448,4 +1448,39 @@ merms_panel=>
merms_panel=>
merms_panel=>
merms_panel=>
merms_panel=>
merms_panel=>
ALTER TABLE subscription_options ADD country_code VARCHAR(3);
UPDATE subscription_options SET country_code ='US';
merms_panel=# \d subscription_options
Table "public.subscription_options"
Column | Type | Collation | Nullable | Default
-------------------+-----------------------------+-----------+----------+--------------------------------------------------
id | integer | | not null | nextval('subscription_options_id_seq'::regclass)
uid | uuid | | | uuid_generate_v4()
display_name | character varying(25) | | not null |
option_name | character varying(100) | | not null |
monthly | integer | | | 0
status | integer | | | 1
added | timestamp without time zone | | | now()
updated | timestamp without time zone | | | now()
stripe_product_id | character varying(100) | | |
stripe_price_id | character varying(100) | | |
Indexes:
"subscription_options_display_name_key" UNIQUE CONSTRAINT, btree (display_name)
"subscription_options_id_key" UNIQUE CONSTRAINT, btree (id)
"subscription_options_option_name_key" UNIQUE CONSTRAINT, btree (option_name)
Referenced by:
TABLE "members" CONSTRAINT "members_option_name_fkey" FOREIGN KEY (option_name) REFERENCES subscription_options(option_name)
TABLE "payments" CONSTRAINT "payments_option_name_fkey" FOREIGN KEY (option_name) REFERENCES subscription_options(option_name)
TABLE "payments_session" CONSTRAINT "payments_session_option_name_fkey" FOREIGN KEY (option_name) REFERENCES subscription_options(option_name)
TABLE "subscription_options_items" CONSTRAINT "subscription_options_items_option_name_fkey" FOREIGN KEY (option_name) REFERENCES subscription_options(option_name)
+2 -2
View File
@@ -100,8 +100,8 @@ class SubscriptionService(BaseService):
price_create_result = StripeIntegration.create_product(t.display_name, t.monthly)
logger.info(f"Inside Stripe_Product ===== : {price_create_result}")
if price_create_result:
SubscriptionOptions.set_stripe_product_id(t.uid,price_create_result['product_id'])
SubscriptionOptions.set_stripe_price_id(t.uid,price_create_result['price_id'])
SubscriptionOptions.set_stripe_product_id(t.uid,price_create_result['product_id']) # only relevant if it is USA
SubscriptionOptions.set_stripe_price_id(t.uid,price_create_result['price_id']) # only relevant if it is USA
res_options.append({
'option_id': t.id,
-4
View File
@@ -1,8 +1,4 @@
#
from datetime import datetime, timezone
from app.extensions import db
from app.models.charge import Charge
from sqlalchemy.orm import relationship
from sqlalchemy.sql import func
+2
View File
@@ -17,6 +17,7 @@ class SubscriptionOptions(db.Model):
updated = db.Column(db.DateTime(timezone=False), server_default=func.now(), onupdate=func.now())
stripe_product_id = db.Column(db.String(100), nullable=True)
stripe_price_id = db.Column(db.String(100), nullable=True)
country_code = db.Column(db.String(3), nullable=False)
@classmethod
@@ -64,6 +65,7 @@ class SubscriptionOptions(db.Model):
"display_name": self.display_name,
"status": self.status,
"monthly": self.monthly,
"country_code": self.country_code,
"stripe_product_id": self.stripe_product_id,
"stripe_price_id": self.stripe_price_id,
"added": self.added.isoformat() if self.added else None,