Problem
The customer subscription responses (GET /api/v1/subscriptions, GET /api/v1/subscriptions/{id}) don't carry a seller company_id. ApiSubscription and ApiSubscriptionLineItem both omit it, even though the underlying Subscription row already has company_id (lnvps_db/src/model.rs).
Why it matters
VAT rates are per seller company: account.tax[] is keyed by company_id, and elsewhere clients match it against a company id to pick the right rate (e.g. VmHostRegion.company_id is documented as "match against account.tax[].company_id for the applicable VAT rate").
The web app just added an "incl. tax" price toggle. For VMs it resolves the correct rate via region.company_id, but subscriptions (IP ranges, DNS, …) expose no company id, so the UI has to fall back to the primary (first) tax entry. That's correct for single-company deployments but wrong once a customer holds subscriptions across multiple companies with different VAT rates.
Proposal
Expose the seller company_id on the subscription response so clients can gross-up prices with the right rate. Either (or both):
interface SubscriptionLineItem {
// ...
company_id: number; // seller company for this line item's VAT rate
}
or, since a subscription is billed by a single company and the value already lives on the Subscription row, the simpler:
interface Subscription {
// ...
company_id: number;
}
Read-only, additive — no breaking change. The subscription-level field is the least duplication; the line-item field mirrors how VM pricing already carries company context. Either lets the client match account.tax[].company_id and drop the primary-rate fallback.
Related: the host CPU arch exposure (#210) followed the same "surface the id the client needs to resolve a per-account value" pattern.
Problem
The customer subscription responses (
GET /api/v1/subscriptions,GET /api/v1/subscriptions/{id}) don't carry a sellercompany_id.ApiSubscriptionandApiSubscriptionLineItemboth omit it, even though the underlyingSubscriptionrow already hascompany_id(lnvps_db/src/model.rs).Why it matters
VAT rates are per seller company:
account.tax[]is keyed bycompany_id, and elsewhere clients match it against a company id to pick the right rate (e.g.VmHostRegion.company_idis documented as "match against account.tax[].company_id for the applicable VAT rate").The web app just added an "incl. tax" price toggle. For VMs it resolves the correct rate via
region.company_id, but subscriptions (IP ranges, DNS, …) expose no company id, so the UI has to fall back to the primary (first) tax entry. That's correct for single-company deployments but wrong once a customer holds subscriptions across multiple companies with different VAT rates.Proposal
Expose the seller
company_idon the subscription response so clients can gross-up prices with the right rate. Either (or both):or, since a subscription is billed by a single company and the value already lives on the
Subscriptionrow, the simpler:Read-only, additive — no breaking change. The subscription-level field is the least duplication; the line-item field mirrors how VM pricing already carries company context. Either lets the client match
account.tax[].company_idand drop the primary-rate fallback.Related: the host CPU arch exposure (#210) followed the same "surface the id the client needs to resolve a per-account value" pattern.