feat/mobile-dynamic-plan-code #143

Merged
amit merged 2 commits from feat/mobile-dynamic-plan-code into main 2026-12-04 05:23:59 +00:00
2 changed files with 3 additions and 1 deletions
Showing only changes of commit 6291c325eb - Show all commits

View File

@ -31,6 +31,7 @@ export interface ModuleResponse extends ModuleSummary {
release_version: string | null;
expected_release_date: string | null;
release_notes: string | null;
plan_code?: string | null;
metadata: Record<string, unknown>;
created_by: string | null;
updated_by: string | null;

View File

@ -224,6 +224,7 @@ export function toModuleIndexItem(module: ModuleResponse): ModuleIndexItem {
const visual = MODULE_VISUALS[module.code.toLowerCase()];
const metadataIcon = readMetadataString(module, "icon");
const metadataColor = readMetadataString(module, "color");
const apiPlanCode = asNonBlankString(module.plan_code);
const metadataPlanCode = readMetadataString(module, "plan_code");
const metadataIsDefaultFree = readMetadataBoolean(module, "is_default_free");
@ -241,7 +242,7 @@ export function toModuleIndexItem(module: ModuleResponse): ModuleIndexItem {
icon: metadataIcon ?? visual?.icon ?? "folder-outline",
color: metadataColor ?? visual?.color ?? "#4F46E5",
isDefaultFree: metadataIsDefaultFree ?? visual?.isDefaultFree ?? false,
planCode: metadataPlanCode ?? visual?.planCode ?? "",
planCode: apiPlanCode ?? metadataPlanCode ?? visual?.planCode ?? "",
};
}