percent_completed
This commit is contained in:
+36
-1
@@ -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)
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user