diff --git a/jcloud/api/site.py b/jcloud/api/site.py index da88a71..d9ba45e 100644 --- a/jcloud/api/site.py +++ b/jcloud/api/site.py @@ -970,9 +970,9 @@ def get_plans(name=None, rg=None): out = [] for plan in plans: - if is_paywalled_bench and plan.price_usd == 10: + if is_paywalled_bench and plan.price_cny == 10: continue - if not plan.allow_downgrading_from_other_plan and plan.price_usd == 5: + if not plan.allow_downgrading_from_other_plan and plan.price_cny == 5: continue if not on_dedicated_server and plan.dedicated_server_plan: continue @@ -1341,7 +1341,7 @@ def get_installed_apps(site, query_filters: dict | None = None): ) app_source.update(app_tags if app_tags else {}) app_source.subscription_available = bool( - jingrow.db.exists("Marketplace App Plan", {"price_usd": (">", 0), "app": app.app, "enabled": 1}) + jingrow.db.exists("Marketplace App Plan", {"price_cny": (">", 0), "app": app.app, "enabled": 1}) ) app_source.billing_type = is_prepaid_marketplace_app(app.app) if jingrow.db.exists( @@ -1375,13 +1375,13 @@ def get_installed_apps(site, query_filters: dict | None = None): app_source.plan_info = jingrow.db.get_value( "Marketplace App Plan", subscription.plan, - ["price_usd", "price_cny", "name", "title"], + ["price_cny", "name", "title"], as_dict=True, ) app_source.plans = get_plans_for_app(app.app) - app_source.is_free = app_source.plan_info.price_usd <= 0 + app_source.is_free = app_source.plan_info.price_cny <= 0 else: app_source.subscription = {} diff --git a/jcloud/marketplace/pagetype/marketplace_app_plan/marketplace_app_plan.json b/jcloud/marketplace/pagetype/marketplace_app_plan/marketplace_app_plan.json index 9f8a497..65c79ea 100644 --- a/jcloud/marketplace/pagetype/marketplace_app_plan/marketplace_app_plan.json +++ b/jcloud/marketplace/pagetype/marketplace_app_plan/marketplace_app_plan.json @@ -3,7 +3,6 @@ "allow_rename": 1, "autoname": "format:MARKETPLACE-PLAN-{app}-{###}", "creation": "2021-12-27 14:19:48.420915", - "pagetype": "PageType", "editable_grid": 1, "engine": "InnoDB", "field_order": [ @@ -68,8 +67,7 @@ { "fieldname": "price_usd", "fieldtype": "Currency", - "label": "Price (USD)", - "reqd": 1 + "label": "Price (USD)" }, { "fieldname": "plan_features_section", @@ -103,12 +101,13 @@ ], "index_web_pages_for_search": 1, "links": [], - "modified": "2024-03-21 13:11:26.446979", + "modified": "2025-04-22 12:13:31.623301", "modified_by": "Administrator", "module": "Marketplace", "name": "Marketplace App Plan", "naming_rule": "Expression", "owner": "Administrator", + "pagetype": "PageType", "permissions": [ { "create": 1, @@ -123,6 +122,7 @@ "write": 1 } ], + "row_format": "Dynamic", "sort_field": "modified", "sort_order": "DESC", "states": [] diff --git a/jcloud/marketplace/pagetype/marketplace_app_plan/marketplace_app_plan.py b/jcloud/marketplace/pagetype/marketplace_app_plan/marketplace_app_plan.py index f4f85ad..667e80b 100644 --- a/jcloud/marketplace/pagetype/marketplace_app_plan/marketplace_app_plan.py +++ b/jcloud/marketplace/pagetype/marketplace_app_plan/marketplace_app_plan.py @@ -10,6 +10,27 @@ from jcloud.jcloud.pagetype.site_plan.plan import Plan class MarketplaceAppPlan(Plan): + # begin: auto-generated types + # This code is auto-generated. Do not modify anything in this block. + + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from jcloud.jcloud.pagetype.plan_feature.plan_feature import PlanFeature + from jcloud.marketplace.pagetype.app_plan_version.app_plan_version import AppPlanVersion + from jingrow.core.pagetype.has_role.has_role import HasRole + from jingrow.types import DF + + app: DF.Link + available_on_versions: DF.Table[AppPlanVersion] + enabled: DF.Check + features: DF.Table[PlanFeature] + interval: DF.Literal["Daily", "Monthly", "Yearly"] + price_cny: DF.Currency + price_usd: DF.Currency + roles: DF.Table[HasRole] + title: DF.Data | None + # end: auto-generated types dashboard_fields = ["app", "name", "title", "price_cny", "price_usd", "enabled"] @staticmethod