Conversation
| @@ -0,0 +1 @@ | |||
| ALTER TABLE orgs ADD COLUMN cached_plan_display_name TEXT; | |||
There was a problem hiding this comment.
- Can we call this
billing_plan_display_name? It's nice to prefix withbilling_planandcachedfeels redundant (I think it's understood that this gets synced from Orb) - Could we also include the unique name or ID of the plan from Orb? E.g.
billing_plan_idorbilling_plan_name? - Consider using
NOT NULL DEFAULT ''to avoid handling pointers (null plan name and empty plan name is effectively the same, no need for additional states).
There was a problem hiding this comment.
- ok
- ok
null plan name and empty plan name is effectively the same, no need for additional states
I want to be able to distinguish between two as there are states when there will be no plan - for example when org is just created or when org subscription ended. In these cases plan name will be empty and thus we will know that there is no plan and avoid calling orb to fetch plan name again and again on each call to GetOrganization API. Otherwise if the plan name is null then this means that its not cached yet.
There was a problem hiding this comment.
Okay, so it's to build a bridge for old rows, which won't initially have the plan stored? It's ugly but makes sense. It definitely needs a docstring about that difference though, it's not easy to guess that null means not loaded and "" means no plan.
| PaymentCustomerID: org.PaymentCustomerID, | ||
| BillingEmail: org.BillingEmail, | ||
| CreatedByUserID: org.CreatedByUserID, | ||
| CachedPlanDisplayName: &sub.Plan.DisplayName, |
There was a problem hiding this comment.
Is it guaranteed to have a display name? If it may be empty (e.g. in case we forgot to set one in Orb), it should perhaps fall back to the unique name or ID instead (so it doesn't look like no plan is assigned).
There was a problem hiding this comment.
Plan display name is not set in orb at all, its generated logically as per product requirement here -https://github.com/rilldata/rill/blob/main/admin/billing/orb.go#L636
|
lint job failing with looks like |
Fixes https://github.com/rilldata/rill-private-issues/issues/973