From a637a745bf8c6d27892cc8a19f4400352b286603 Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Sat, 23 Nov 2024 18:16:56 -0800 Subject: [PATCH] undo backend changes, might not be needed at all --- backend/btrixcloud/models.py | 3 --- backend/btrixcloud/orgs.py | 3 +-- backend/btrixcloud/subs.py | 9 ++------- backend/test/test_org_subs.py | 5 ----- 4 files changed, 3 insertions(+), 17 deletions(-) diff --git a/backend/btrixcloud/models.py b/backend/btrixcloud/models.py index 585707b3f2..15d1a6ec47 100644 --- a/backend/btrixcloud/models.py +++ b/backend/btrixcloud/models.py @@ -1181,7 +1181,6 @@ class S3Storage(BaseModel): PAUSED_PAYMENT_FAILED = "paused_payment_failed" ACTIVE = "active" -TRIALING = "trialing" REASON_PAUSED = "subscriptionPaused" REASON_CANCELED = "subscriptionCanceled" @@ -1232,8 +1231,6 @@ class SubscriptionCreate(BaseModel): planId: str firstAdminInviteEmail: EmailStr - - futureCancelDate: Optional[datetime] = None quotas: Optional[OrgQuotas] = None diff --git a/backend/btrixcloud/orgs.py b/backend/btrixcloud/orgs.py index ebe5c2cb2a..74fb63ea91 100644 --- a/backend/btrixcloud/orgs.py +++ b/backend/btrixcloud/orgs.py @@ -67,7 +67,6 @@ PAUSED_PAYMENT_FAILED, REASON_PAUSED, ACTIVE, - TRIALING, DeletedResponse, UpdatedResponse, AddedResponse, @@ -479,7 +478,7 @@ async def update_subscription_data( if update.status == PAUSED_PAYMENT_FAILED: query["readOnly"] = True query["readOnlyReason"] = REASON_PAUSED - elif update.status in (ACTIVE, TRIALING): + elif update.status == ACTIVE: query["readOnly"] = False query["readOnlyReason"] = "" diff --git a/backend/btrixcloud/subs.py b/backend/btrixcloud/subs.py index 282ab3e1d9..5cb4d779ec 100644 --- a/backend/btrixcloud/subs.py +++ b/backend/btrixcloud/subs.py @@ -67,10 +67,7 @@ async def create_new_subscription( ) -> dict[str, Any]: """create org for new subscription""" subscription = Subscription( - subId=create.subId, - status=create.status, - planId=create.planId, - futureCancelDate=create.futureCancelDate, + subId=create.subId, status=create.status, planId=create.planId ) new_org = await self.org_ops.create_org( @@ -98,9 +95,7 @@ async def import_subscription( ) -> dict[str, Any]: """import subscription to existing org""" subscription = Subscription( - subId=sub_import.subId, - status=sub_import.status, - planId=sub_import.planId, + subId=sub_import.subId, status=sub_import.status, planId=sub_import.planId ) await self.org_ops.add_subscription_to_org(subscription, sub_import.oid) diff --git a/backend/test/test_org_subs.py b/backend/test/test_org_subs.py index fa04b27c9a..9d795d1abe 100644 --- a/backend/test/test_org_subs.py +++ b/backend/test/test_org_subs.py @@ -438,7 +438,6 @@ def test_subscription_events_log(admin_auth_headers, non_default_org_id): "status": "active", "planId": "basic", "firstAdminInviteEmail": "test-user@example.com", - "futureCancelDate": None, "quotas": { "maxConcurrentCrawls": 1, "maxPagesPerCrawl": 100, @@ -455,7 +454,6 @@ def test_subscription_events_log(admin_auth_headers, non_default_org_id): "status": "active", "planId": "basic", "firstAdminInviteEmail": "test-user@example.com", - "futureCancelDate": None, "quotas": { "maxConcurrentCrawls": 1, "maxPagesPerCrawl": 100, @@ -524,7 +522,6 @@ def test_subscription_events_log_filter_sub_id(admin_auth_headers): "status": "active", "planId": "basic", "firstAdminInviteEmail": "test-user@example.com", - "futureCancelDate": None, "quotas": { "maxConcurrentCrawls": 1, "maxPagesPerCrawl": 100, @@ -586,7 +583,6 @@ def test_subscription_events_log_filter_oid(admin_auth_headers): "status": "active", "planId": "basic", "firstAdminInviteEmail": "test-user@example.com", - "futureCancelDate": None, "quotas": { "maxConcurrentCrawls": 1, "maxPagesPerCrawl": 100, @@ -682,7 +678,6 @@ def test_subscription_events_log_filter_status(admin_auth_headers): "status": "active", "planId": "basic", "firstAdminInviteEmail": "test-user@example.com", - "futureCancelDate": None, "quotas": { "maxConcurrentCrawls": 1, "maxPagesPerCrawl": 100,