- Changed worktree setup command from npm to pnpm for improved package management. - Added SupportModule to app.module.ts and router.config.ts for better support case handling. - Refactored OrderEventsService to utilize OrderUpdateEventPayload for improved type safety. - Updated InvoicesList component to use INVOICE_STATUS for status filtering and improved type definitions. - Enhanced SimActions and SimDetailsCard components to utilize SimStatus for better state management. - Refactored Subscription components to leverage new utility functions for status handling and billing cycle labels. - Improved SupportCasesView with better state management and error handling. - Updated API query keys to include support cases for better data retrieval.
19 lines
489 B
TypeScript
19 lines
489 B
TypeScript
import { SIM_STATUS } from "./contract";
|
|
import type { SimStatus } from "./schema";
|
|
|
|
export function canManageActiveSim(status: SimStatus): boolean {
|
|
return status === SIM_STATUS.ACTIVE;
|
|
}
|
|
|
|
export function canReissueEsim(status: SimStatus): boolean {
|
|
return canManageActiveSim(status);
|
|
}
|
|
|
|
export function canCancelSim(status: SimStatus): boolean {
|
|
return canManageActiveSim(status);
|
|
}
|
|
|
|
export function canTopUpSim(status: SimStatus): boolean {
|
|
return canManageActiveSim(status);
|
|
}
|