fix(billing): use tier_id instead of tier_code for feature limit endpoints
Some checks failed
Some checks failed
Tier codes are not unique across platforms (e.g., "essential" exists for OMS, marketplace, and loyalty). Using tier_code caused feature limits to be saved to the wrong tier. Switched to tier_id (unique PK) in routes, service, and frontend JS. Added comprehensive unit and integration tests including cross-platform isolation regression tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -273,7 +273,7 @@ function adminSubscriptionTiers() {
|
||||
|
||||
try {
|
||||
// Load tier's current feature limits
|
||||
const data = await apiClient.get(`/admin/subscriptions/features/tiers/${tier.code}/limits`);
|
||||
const data = await apiClient.get(`/admin/subscriptions/features/tiers/${tier.id}/limits`);
|
||||
// data is TierFeatureLimitEntry[]: [{feature_code, limit_value, enabled}]
|
||||
this.selectedFeatures = [];
|
||||
for (const entry of (data || [])) {
|
||||
@@ -327,7 +327,7 @@ function adminSubscriptionTiers() {
|
||||
}));
|
||||
|
||||
await apiClient.put(
|
||||
`/admin/subscriptions/features/tiers/${this.selectedTierForFeatures.code}/limits`,
|
||||
`/admin/subscriptions/features/tiers/${this.selectedTierForFeatures.id}/limits`,
|
||||
entries
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user