diff --git a/apps/bff/src/core/http/exception.filter.ts b/apps/bff/src/core/http/exception.filter.ts index f6d59ac3..1e0baabd 100644 --- a/apps/bff/src/core/http/exception.filter.ts +++ b/apps/bff/src/core/http/exception.filter.ts @@ -232,9 +232,9 @@ export class UnifiedExceptionFilter implements ExceptionFilter { userAgent: typeof userAgentHeader === "string" ? userAgentHeader - : Array.isArray(userAgentHeader) + : (Array.isArray(userAgentHeader) ? userAgentHeader[0] - : undefined, + : undefined), ip: request.ip, }; } diff --git a/apps/bff/src/integrations/freebit/services/freebit-client.service.ts b/apps/bff/src/integrations/freebit/services/freebit-client.service.ts index 053da70c..badf35b4 100644 --- a/apps/bff/src/integrations/freebit/services/freebit-client.service.ts +++ b/apps/bff/src/integrations/freebit/services/freebit-client.service.ts @@ -354,17 +354,17 @@ export class FreebitClientService { const timestamp = this.testTracker.getCurrentTimestamp(); const resultCode = response?.resultCode ? String(response.resultCode) - : error instanceof FreebitError + : (error instanceof FreebitError ? String(error.resultCode || "ERROR") - : "ERROR"; + : "ERROR"); const statusMessage = response?.status?.message || (error instanceof FreebitError ? error.message - : error + : (error ? extractErrorMessage(error) - : "Success"); + : "Success")); await this.testTracker.logApiCall({ timestamp, diff --git a/apps/bff/src/modules/orders/services/checkout.service.ts b/apps/bff/src/modules/orders/services/checkout.service.ts index ea33c38e..d3c12431 100644 --- a/apps/bff/src/modules/orders/services/checkout.service.ts +++ b/apps/bff/src/modules/orders/services/checkout.service.ts @@ -44,7 +44,7 @@ export class CheckoutService { private summarizeSelectionsForLog(selections: OrderSelections): Record { const addons = this.collectAddonRefs(selections); const normalizeBool = (value?: string) => - value === "true" ? true : value === "false" ? false : undefined; + value === "true" ? true : (value === "false" ? false : undefined); return { planSku: selections.planSku, diff --git a/apps/bff/src/modules/orders/services/order-validator.service.ts b/apps/bff/src/modules/orders/services/order-validator.service.ts index 085b3b69..1f49ccd6 100644 --- a/apps/bff/src/modules/orders/services/order-validator.service.ts +++ b/apps/bff/src/modules/orders/services/order-validator.service.ts @@ -84,9 +84,9 @@ export class OrderValidator { const productContainer = products.products?.product; const existing = Array.isArray(productContainer) ? productContainer - : productContainer + : (productContainer ? [productContainer] - : []; + : []); // Check for active Internet products const activeInternetProducts = existing.filter((product: WhmcsProduct) => { diff --git a/apps/bff/src/modules/orders/validators/internet-order.validator.ts b/apps/bff/src/modules/orders/validators/internet-order.validator.ts index 38adee14..4c99d6a8 100644 --- a/apps/bff/src/modules/orders/validators/internet-order.validator.ts +++ b/apps/bff/src/modules/orders/validators/internet-order.validator.ts @@ -77,9 +77,9 @@ export class InternetOrderValidator { const productContainer = products.products?.product; const existing = Array.isArray(productContainer) ? productContainer - : productContainer + : (productContainer ? [productContainer] - : []; + : []); // Check for active Internet products const activeInternetProducts = existing.filter((product: WhmcsProduct) => { diff --git a/apps/bff/src/modules/shared/workflow/workflow-case-manager.service.ts b/apps/bff/src/modules/shared/workflow/workflow-case-manager.service.ts index 9182e686..fe756325 100644 --- a/apps/bff/src/modules/shared/workflow/workflow-case-manager.service.ts +++ b/apps/bff/src/modules/shared/workflow/workflow-case-manager.service.ts @@ -52,9 +52,9 @@ export class WorkflowCaseManager { : null; const opportunityStatus = opportunityId - ? opportunityCreated + ? (opportunityCreated ? "Created new opportunity for this order" - : "Linked to existing opportunity" + : "Linked to existing opportunity") : "No opportunity linked"; const description = this.buildDescription([ diff --git a/apps/bff/src/modules/subscriptions/internet-management/services/internet-cancellation.service.ts b/apps/bff/src/modules/subscriptions/internet-management/services/internet-cancellation.service.ts index 4568ee0d..4c755ffb 100644 --- a/apps/bff/src/modules/subscriptions/internet-management/services/internet-cancellation.service.ts +++ b/apps/bff/src/modules/subscriptions/internet-management/services/internet-cancellation.service.ts @@ -77,9 +77,9 @@ export class InternetCancellationService { const productContainer = productsResponse.products?.product; const products = Array.isArray(productContainer) ? productContainer - : productContainer + : (productContainer ? [productContainer] - : []; + : []); const subscription = products.find( (p: { id?: number | string }) => Number(p.id) === subscriptionId diff --git a/apps/bff/src/modules/subscriptions/sim-management/services/sim-validation.service.ts b/apps/bff/src/modules/subscriptions/sim-management/services/sim-validation.service.ts index fc5e25eb..15d5456c 100644 --- a/apps/bff/src/modules/subscriptions/sim-management/services/sim-validation.service.ts +++ b/apps/bff/src/modules/subscriptions/sim-management/services/sim-validation.service.ts @@ -107,9 +107,9 @@ export class SimValidationService { // Account extraction result extractedAccount, accountSource: extractedAccount - ? subscription.domain + ? (subscription.domain ? "domain field" - : "custom field or order number" + : "custom field or order number") : "NOT FOUND - check fields below", // All custom fields for debugging customFieldKeys: Object.keys(subscription.customFields || {}), diff --git a/apps/bff/src/modules/verification/residence-card.service.ts b/apps/bff/src/modules/verification/residence-card.service.ts index ab43549a..769f893d 100644 --- a/apps/bff/src/modules/verification/residence-card.service.ts +++ b/apps/bff/src/modules/verification/residence-card.service.ts @@ -93,9 +93,9 @@ export class ResidenceCardService { const reviewerNotes = typeof rejectionRaw === "string" && rejectionRaw.trim().length > 0 ? rejectionRaw.trim() - : typeof noteRaw === "string" && noteRaw.trim().length > 0 + : (typeof noteRaw === "string" && noteRaw.trim().length > 0 ? noteRaw.trim() - : null; + : null); return residenceCardVerificationSchema.parse({ status, diff --git a/apps/portal/src/components/molecules/OtpInput/OtpInput.tsx b/apps/portal/src/components/molecules/OtpInput/OtpInput.tsx index 9dafae15..49a8eecc 100644 --- a/apps/portal/src/components/molecules/OtpInput/OtpInput.tsx +++ b/apps/portal/src/components/molecules/OtpInput/OtpInput.tsx @@ -149,9 +149,9 @@ export function OtpInput({ "disabled:opacity-50 disabled:cursor-not-allowed", error ? "border-danger focus:ring-danger focus:border-danger" - : activeIndex === index + : (activeIndex === index ? "border-primary" - : "border-border hover:border-muted-foreground/50" + : "border-border hover:border-muted-foreground/50") )} aria-label={`Digit ${index + 1}`} /> diff --git a/apps/portal/src/components/organisms/AppShell/AppShell.tsx b/apps/portal/src/components/organisms/AppShell/AppShell.tsx index cb991c0a..d60ee067 100644 --- a/apps/portal/src/components/organisms/AppShell/AppShell.tsx +++ b/apps/portal/src/components/organisms/AppShell/AppShell.tsx @@ -216,9 +216,9 @@ export function AppShell({ children }: AppShellProps) { - ) : isAuthReady ? ( + ) : (isAuthReady ? ( children - ) : null} + ) : null)} diff --git a/apps/portal/src/features/account/components/AddressCard.tsx b/apps/portal/src/features/account/components/AddressCard.tsx index 56b9bd27..95956178 100644 --- a/apps/portal/src/features/account/components/AddressCard.tsx +++ b/apps/portal/src/features/account/components/AddressCard.tsx @@ -126,11 +126,11 @@ export function AddressCard({ )} - ) : hasAddress ? ( + ) : (hasAddress ? ( ) : ( - )} + ))} ); diff --git a/apps/portal/src/features/address/components/AddressStepJapan.tsx b/apps/portal/src/features/address/components/AddressStepJapan.tsx index 87528fb1..b040b6af 100644 --- a/apps/portal/src/features/address/components/AddressStepJapan.tsx +++ b/apps/portal/src/features/address/components/AddressStepJapan.tsx @@ -119,9 +119,9 @@ function fromLegacyFormat(address: LegacyAddressData): PartialJapanAddressFormDa // For new users, leave it undefined so they must explicitly choose const hasExistingAddress = address.postcode || address.state || address.city; const residenceType = hasExistingAddress - ? roomNumber + ? (roomNumber ? RESIDENCE_TYPE.APARTMENT - : RESIDENCE_TYPE.HOUSE + : RESIDENCE_TYPE.HOUSE) : undefined; return { diff --git a/apps/portal/src/features/address/components/JapanAddressForm.tsx b/apps/portal/src/features/address/components/JapanAddressForm.tsx index f2b9ed41..cc011c58 100644 --- a/apps/portal/src/features/address/components/JapanAddressForm.tsx +++ b/apps/portal/src/features/address/components/JapanAddressForm.tsx @@ -336,9 +336,9 @@ export function JapanAddressForm({ required helperText={ form.address.streetAddress.trim() - ? streetAddressError + ? (streetAddressError ? undefined - : "Valid format" + : "Valid format") : "Enter chome-banchi-go (e.g., 1-5-3)" } > diff --git a/apps/portal/src/features/address/components/ProgressIndicator.tsx b/apps/portal/src/features/address/components/ProgressIndicator.tsx index 48a3f4a8..c789349b 100644 --- a/apps/portal/src/features/address/components/ProgressIndicator.tsx +++ b/apps/portal/src/features/address/components/ProgressIndicator.tsx @@ -23,9 +23,9 @@ export function ProgressIndicator({ currentStep, totalSteps }: ProgressIndicator "h-1 rounded-full transition-all duration-500", i < currentStep ? "bg-primary flex-[2]" - : i === currentStep + : (i === currentStep ? "bg-primary/40 flex-[2] animate-pulse" - : "bg-border flex-1" + : "bg-border flex-1") )} /> ))} diff --git a/apps/portal/src/features/billing/views/PaymentMethods.tsx b/apps/portal/src/features/billing/views/PaymentMethods.tsx index de1d5404..3c912580 100644 --- a/apps/portal/src/features/billing/views/PaymentMethods.tsx +++ b/apps/portal/src/features/billing/views/PaymentMethods.tsx @@ -144,7 +144,7 @@ export function PaymentMethodsContainer() { - ) : paymentMethodsData && paymentMethodsData.paymentMethods.length > 0 ? ( + ) : (paymentMethodsData && paymentMethodsData.paymentMethods.length > 0 ? (
@@ -214,7 +214,7 @@ export function PaymentMethodsContainer() {
)}
- )} + ))}
diff --git a/apps/portal/src/features/checkout/components/CheckoutStatusBanners.tsx b/apps/portal/src/features/checkout/components/CheckoutStatusBanners.tsx index 2e5b084b..c13b47fb 100644 --- a/apps/portal/src/features/checkout/components/CheckoutStatusBanners.tsx +++ b/apps/portal/src/features/checkout/components/CheckoutStatusBanners.tsx @@ -132,11 +132,11 @@ export function CheckoutStatusBanners({

{eligibility.notes ? (

{eligibility.notes}

- ) : eligibility.requestedAt ? ( + ) : (eligibility.requestedAt ? (

Last updated: {new Date(eligibility.requestedAt).toLocaleString()}

- ) : null} + ) : null)} diff --git a/apps/portal/src/features/checkout/components/checkout-sections/IdentityVerificationSection.tsx b/apps/portal/src/features/checkout/components/checkout-sections/IdentityVerificationSection.tsx index e13bd4b2..be52f925 100644 --- a/apps/portal/src/features/checkout/components/checkout-sections/IdentityVerificationSection.tsx +++ b/apps/portal/src/features/checkout/components/checkout-sections/IdentityVerificationSection.tsx @@ -254,11 +254,11 @@ function NotSubmittedContent({
Rejection note
{reviewerNotes}
- ) : isRejected ? ( + ) : (isRejected ? (

Your document couldn't be approved. Please upload a new file to continue.

- ) : null} + ) : null)}

Upload a JPG, PNG, or PDF (max 5MB). We'll verify it before activating SIM service. diff --git a/apps/portal/src/features/landing-page/views/PublicLandingView.tsx b/apps/portal/src/features/landing-page/views/PublicLandingView.tsx index 8ae3395f..0e79e182 100644 --- a/apps/portal/src/features/landing-page/views/PublicLandingView.tsx +++ b/apps/portal/src/features/landing-page/views/PublicLandingView.tsx @@ -1341,14 +1341,14 @@ export function PublicLandingView() { Sending... - ) : submitStatus === "success" ? ( + ) : (submitStatus === "success" ? ( <> Sent! ) : ( "Submit" - )} + ))} diff --git a/apps/portal/src/features/notifications/components/NotificationDropdown.tsx b/apps/portal/src/features/notifications/components/NotificationDropdown.tsx index 930c7340..8862775e 100644 --- a/apps/portal/src/features/notifications/components/NotificationDropdown.tsx +++ b/apps/portal/src/features/notifications/components/NotificationDropdown.tsx @@ -67,7 +67,7 @@ export const NotificationDropdown = memo(function NotificationDropdown({

- ) : notifications.length === 0 ? ( + ) : (notifications.length === 0 ? (

No notifications yet

@@ -86,7 +86,7 @@ export const NotificationDropdown = memo(function NotificationDropdown({ /> ))}
- )} + ))}
{/* Footer */} diff --git a/apps/portal/src/features/services/components/base/AddressForm.tsx b/apps/portal/src/features/services/components/base/AddressForm.tsx index 4e3d72e2..c28a6a41 100644 --- a/apps/portal/src/features/services/components/base/AddressForm.tsx +++ b/apps/portal/src/features/services/components/base/AddressForm.tsx @@ -287,9 +287,9 @@ export function AddressForm({ const containerClasses = variant === "inline" ? "" - : variant === "compact" + : (variant === "compact" ? "p-4 bg-gray-50 rounded-lg border border-gray-200" - : "p-6 bg-white border border-gray-200 rounded-lg"; + : "p-6 bg-white border border-gray-200 rounded-lg"); // Get all validation errors const allErrors = Object.values(form.errors).filter(Boolean) as string[]; diff --git a/apps/portal/src/features/services/components/base/OrderSummary.tsx b/apps/portal/src/features/services/components/base/OrderSummary.tsx index 04b0958c..b1d8dc38 100644 --- a/apps/portal/src/features/services/components/base/OrderSummary.tsx +++ b/apps/portal/src/features/services/components/base/OrderSummary.tsx @@ -261,7 +261,7 @@ export function OrderSummary({ ) : null} - ) : onContinue ? ( + ) : (onContinue ? ( - ) : null} + ) : null)} )} diff --git a/apps/portal/src/features/services/components/base/ProductCard.tsx b/apps/portal/src/features/services/components/base/ProductCard.tsx index feb73ea5..e39c45c6 100644 --- a/apps/portal/src/features/services/components/base/ProductCard.tsx +++ b/apps/portal/src/features/services/components/base/ProductCard.tsx @@ -160,7 +160,7 @@ export function ProductCard({ > {actionLabel} - ) : onClick ? ( + ) : (onClick ? ( - ) : null} + ) : null)} {/* Custom footer */} diff --git a/apps/portal/src/features/services/components/internet/InstallationOptions.tsx b/apps/portal/src/features/services/components/internet/InstallationOptions.tsx index 1fb6944d..25d5fbb7 100644 --- a/apps/portal/src/features/services/components/internet/InstallationOptions.tsx +++ b/apps/portal/src/features/services/components/internet/InstallationOptions.tsx @@ -37,9 +37,9 @@ export function InstallationOptions({ installation.description || (installationTerm === "12-Month" ? "Spread the installation fee across 12 monthly payments." - : installationTerm === "24-Month" + : (installationTerm === "24-Month" ? "Spread the installation fee across 24 monthly payments." - : "Pay the full installation fee in one payment."); + : "Pay the full installation fee in one payment.")); return ( - )} + ))} ))} diff --git a/apps/portal/src/features/services/components/sim/DeviceCompatibility.tsx b/apps/portal/src/features/services/components/sim/DeviceCompatibility.tsx index 85935d4d..540c4bbb 100644 --- a/apps/portal/src/features/services/components/sim/DeviceCompatibility.tsx +++ b/apps/portal/src/features/services/components/sim/DeviceCompatibility.tsx @@ -255,7 +255,7 @@ export function DeviceCompatibility() {

)} - ) : showNoResults ? ( + ) : (showNoResults ? (
@@ -269,7 +269,7 @@ export function DeviceCompatibility() { to verify compatibility.

- ) : null} + ) : null)}
)} diff --git a/apps/portal/src/features/services/components/sim/SimPlansContent.tsx b/apps/portal/src/features/services/components/sim/SimPlansContent.tsx index 58dc87cb..f51eecf8 100644 --- a/apps/portal/src/features/services/components/sim/SimPlansContent.tsx +++ b/apps/portal/src/features/services/components/sim/SimPlansContent.tsx @@ -266,9 +266,9 @@ export function SimPlansContent({ const tabPlans = activeTab === "data-voice" ? plansByType.DataSmsVoice - : activeTab === "data-only" + : (activeTab === "data-only" ? plansByType.DataOnly - : plansByType.VoiceOnly; + : plansByType.VoiceOnly); const regularPlans = tabPlans.filter(p => !p.simHasFamilyDiscount); const familyPlans = tabPlans.filter(p => p.simHasFamilyDiscount); diff --git a/apps/portal/src/features/services/hooks/useConfigureParams.ts b/apps/portal/src/features/services/hooks/useConfigureParams.ts index dd71dba3..9b74a6f3 100644 --- a/apps/portal/src/features/services/hooks/useConfigureParams.ts +++ b/apps/portal/src/features/services/hooks/useConfigureParams.ts @@ -64,9 +64,9 @@ export function useInternetConfigureParams() { .split(",") .map(s => s.trim()) .filter(Boolean) - : addonSkuParams.length > 0 + : (addonSkuParams.length > 0 ? addonSkuParams - : []; + : []); return { accessMode, diff --git a/apps/portal/src/features/services/views/InternetEligibilityRequest.tsx b/apps/portal/src/features/services/views/InternetEligibilityRequest.tsx index 9a1bf1e4..619e28d1 100644 --- a/apps/portal/src/features/services/views/InternetEligibilityRequest.tsx +++ b/apps/portal/src/features/services/views/InternetEligibilityRequest.tsx @@ -204,7 +204,7 @@ export function InternetEligibilityRequestView() {
{planLoading ? (
Loading selected plan…
- ) : plan ? ( + ) : (plan ? (

Selected plan

@@ -212,7 +212,7 @@ export function InternetEligibilityRequestView() {
- ) : null} + ) : null)}
diff --git a/apps/portal/src/features/services/views/PublicEligibilityCheck.tsx b/apps/portal/src/features/services/views/PublicEligibilityCheck.tsx index aa7c2de0..e17a069f 100644 --- a/apps/portal/src/features/services/views/PublicEligibilityCheck.tsx +++ b/apps/portal/src/features/services/views/PublicEligibilityCheck.tsx @@ -68,9 +68,9 @@ export function PublicEligibilityCheckView() { step === "success" ? (hasAccount ? "Account Created" : "Request Submitted") : currentMeta.title; const description = step === "success" - ? hasAccount + ? (hasAccount ? "Your account is ready and eligibility check is in progress." - : "Your availability check request has been submitted." + : "Your availability check request has been submitted.") : currentMeta.description; return ( diff --git a/apps/portal/src/features/services/views/PublicInternetPlans.tsx b/apps/portal/src/features/services/views/PublicInternetPlans.tsx index 76b5d9fe..a9157a83 100644 --- a/apps/portal/src/features/services/views/PublicInternetPlans.tsx +++ b/apps/portal/src/features/services/views/PublicInternetPlans.tsx @@ -977,7 +977,7 @@ export function PublicInternetPlansContent({
{isLoading ? ( - ) : consolidatedPlanData ? ( + ) : (consolidatedPlanData ? ( - ) : null} + ) : null)}
{/* Available Plans - Expandable cards by offering type */} diff --git a/apps/portal/src/features/subscriptions/components/sim/ReissueSimModal.tsx b/apps/portal/src/features/subscriptions/components/sim/ReissueSimModal.tsx index d6b9a978..bd68e789 100644 --- a/apps/portal/src/features/subscriptions/components/sim/ReissueSimModal.tsx +++ b/apps/portal/src/features/subscriptions/components/sim/ReissueSimModal.tsx @@ -79,9 +79,9 @@ export function ReissueSimModal({ } catch (error: unknown) { const message = process.env.NODE_ENV === "development" - ? error instanceof Error + ? (error instanceof Error ? error.message - : "Failed to submit reissue request" + : "Failed to submit reissue request") : "Failed to submit reissue request. Please try again."; onError(message); } finally { diff --git a/apps/portal/src/features/subscriptions/components/sim/SimActions.tsx b/apps/portal/src/features/subscriptions/components/sim/SimActions.tsx index 8319b210..208ec8ef 100644 --- a/apps/portal/src/features/subscriptions/components/sim/SimActions.tsx +++ b/apps/portal/src/features/subscriptions/components/sim/SimActions.tsx @@ -388,9 +388,9 @@ function useSimActionsState(subscriptionId: number, onCancelSuccess?: () => void } catch (err: unknown) { setError( process.env.NODE_ENV === "development" - ? err instanceof Error + ? (err instanceof Error ? err.message - : "Failed to cancel SIM service" + : "Failed to cancel SIM service") : "Unable to cancel SIM service right now. Please try again." ); } finally { diff --git a/apps/portal/src/features/subscriptions/components/sim/SimManagementSection.tsx b/apps/portal/src/features/subscriptions/components/sim/SimManagementSection.tsx index adcec8df..a2e5d32c 100644 --- a/apps/portal/src/features/subscriptions/components/sim/SimManagementSection.tsx +++ b/apps/portal/src/features/subscriptions/components/sim/SimManagementSection.tsx @@ -108,9 +108,9 @@ export function SimManagementSection({ subscriptionId }: SimManagementSectionPro } else { setError( process.env.NODE_ENV === "development" - ? err instanceof Error + ? (err instanceof Error ? err.message - : "Failed to load SIM information" + : "Failed to load SIM information") : "Unable to load SIM information right now. Please try again." ); } @@ -252,9 +252,9 @@ export function SimManagementSection({ subscriptionId }: SimManagementSectionPro const remainingMB = simInfo.details.remainingQuotaMb.toFixed(1); const usedMB = simInfo.usage?.monthlyUsageMb ? simInfo.usage.monthlyUsageMb.toFixed(2) - : simInfo.usage?.todayUsageMb + : (simInfo.usage?.todayUsageMb ? simInfo.usage.todayUsageMb.toFixed(2) - : "0.00"; + : "0.00"); // Calculate percentage for circle const totalMB = Number.parseFloat(remainingMB) + Number.parseFloat(usedMB); diff --git a/apps/portal/src/features/subscriptions/views/CancelSubscription.tsx b/apps/portal/src/features/subscriptions/views/CancelSubscription.tsx index f7c784a7..80d4c72f 100644 --- a/apps/portal/src/features/subscriptions/views/CancelSubscription.tsx +++ b/apps/portal/src/features/subscriptions/views/CancelSubscription.tsx @@ -140,9 +140,9 @@ export function CancelSubscriptionContainer() { } catch (e: unknown) { setError( process.env.NODE_ENV === "development" - ? e instanceof Error + ? (e instanceof Error ? e.message - : "Failed to load cancellation information" + : "Failed to load cancellation information") : "Unable to load cancellation information right now. Please try again." ); } finally { @@ -176,9 +176,9 @@ export function CancelSubscriptionContainer() { } catch (e: unknown) { setFormError( process.env.NODE_ENV === "development" - ? e instanceof Error + ? (e instanceof Error ? e.message - : "Failed to submit cancellation" + : "Failed to submit cancellation") : "Unable to submit your cancellation right now. Please try again." ); } finally { diff --git a/apps/portal/src/features/subscriptions/views/SimChangePlan.tsx b/apps/portal/src/features/subscriptions/views/SimChangePlan.tsx index 7a4f84bb..049cbb89 100644 --- a/apps/portal/src/features/subscriptions/views/SimChangePlan.tsx +++ b/apps/portal/src/features/subscriptions/views/SimChangePlan.tsx @@ -32,9 +32,9 @@ export function SimChangePlanContainer() { } catch (e: unknown) { setError( process.env.NODE_ENV === "development" - ? e instanceof Error + ? (e instanceof Error ? e.message - : "Failed to load available plans" + : "Failed to load available plans") : "Unable to load available plans right now. Please try again." ); } finally { @@ -66,9 +66,9 @@ export function SimChangePlanContainer() { } catch (e: unknown) { setError( process.env.NODE_ENV === "development" - ? e instanceof Error + ? (e instanceof Error ? e.message - : "Failed to change plan" + : "Failed to change plan") : "Unable to submit your plan change right now. Please try again." ); } finally { diff --git a/apps/portal/src/features/subscriptions/views/SimReissue.tsx b/apps/portal/src/features/subscriptions/views/SimReissue.tsx index cc035aaa..7d9e5725 100644 --- a/apps/portal/src/features/subscriptions/views/SimReissue.tsx +++ b/apps/portal/src/features/subscriptions/views/SimReissue.tsx @@ -37,9 +37,9 @@ export function SimReissueContainer() { } catch (e: unknown) { setError( process.env.NODE_ENV === "development" - ? e instanceof Error + ? (e instanceof Error ? e.message - : "Failed to load SIM details" + : "Failed to load SIM details") : "Unable to load SIM details right now. Please try again." ); } finally { @@ -85,9 +85,9 @@ export function SimReissueContainer() { } catch (e: unknown) { setError( process.env.NODE_ENV === "development" - ? e instanceof Error + ? (e instanceof Error ? e.message - : "Failed to submit reissue request" + : "Failed to submit reissue request") : "Unable to submit your request right now. Please try again." ); } finally { diff --git a/apps/portal/src/features/subscriptions/views/SimTopUp.tsx b/apps/portal/src/features/subscriptions/views/SimTopUp.tsx index 2d94784c..6b86ed5d 100644 --- a/apps/portal/src/features/subscriptions/views/SimTopUp.tsx +++ b/apps/portal/src/features/subscriptions/views/SimTopUp.tsx @@ -54,9 +54,9 @@ export function SimTopUpContainer() { } catch (e: unknown) { setError( process.env.NODE_ENV === "development" - ? e instanceof Error + ? (e instanceof Error ? e.message - : "Failed to submit top-up" + : "Failed to submit top-up") : "Unable to submit your top-up right now. Please try again." ); } finally { diff --git a/apps/portal/src/features/subscriptions/views/SubscriptionDetail.tsx b/apps/portal/src/features/subscriptions/views/SubscriptionDetail.tsx index 8488afcd..83c53472 100644 --- a/apps/portal/src/features/subscriptions/views/SubscriptionDetail.tsx +++ b/apps/portal/src/features/subscriptions/views/SubscriptionDetail.tsx @@ -57,9 +57,9 @@ export function SubscriptionDetailContainer() { // Show error message (only when we have an error, not during loading) const pageError = error - ? process.env.NODE_ENV === "development" && error instanceof Error + ? (process.env.NODE_ENV === "development" && error instanceof Error ? error.message - : "Unable to load subscription details. Please try again." + : "Unable to load subscription details. Please try again.") : null; const productNameLower = subscription?.productName?.toLowerCase() ?? ""; diff --git a/apps/portal/src/features/support/views/NewSupportCaseView.tsx b/apps/portal/src/features/support/views/NewSupportCaseView.tsx index 991cb24d..6867d4fd 100644 --- a/apps/portal/src/features/support/views/NewSupportCaseView.tsx +++ b/apps/portal/src/features/support/views/NewSupportCaseView.tsx @@ -42,9 +42,9 @@ export function NewSupportCaseView() { } catch (err) { setError( process.env.NODE_ENV === "development" - ? err instanceof Error + ? (err instanceof Error ? err.message - : "Failed to create support case" + : "Failed to create support case") : "Unable to create your support case right now. Please try again." ); } diff --git a/apps/portal/src/features/support/views/SupportCasesView.tsx b/apps/portal/src/features/support/views/SupportCasesView.tsx index 2d3bb047..b61e3038 100644 --- a/apps/portal/src/features/support/views/SupportCasesView.tsx +++ b/apps/portal/src/features/support/views/SupportCasesView.tsx @@ -212,7 +212,7 @@ export function SupportCasesView() { ))} - ) : hasActiveFilters ? ( + ) : (hasActiveFilters ? ( @@ -228,7 +228,7 @@ export function SupportCasesView() { }} /> - )} + ))} ); } diff --git a/packages/domain/opportunity/contract.ts b/packages/domain/opportunity/contract.ts index 253199db..ede2d94e 100644 --- a/packages/domain/opportunity/contract.ts +++ b/packages/domain/opportunity/contract.ts @@ -585,7 +585,7 @@ export function getOrderTrackingSteps( return stages.map((s, index) => ({ label: s.label, - status: index < currentStep ? "completed" : index === currentStep ? "current" : "upcoming", + status: index < currentStep ? "completed" : (index === currentStep ? "current" : "upcoming"), })); } diff --git a/packages/domain/subscriptions/providers/whmcs/mapper.ts b/packages/domain/subscriptions/providers/whmcs/mapper.ts index fab3566e..c2177e51 100644 --- a/packages/domain/subscriptions/providers/whmcs/mapper.ts +++ b/packages/domain/subscriptions/providers/whmcs/mapper.ts @@ -195,9 +195,9 @@ export function transformWhmcsSubscriptionListResponse( const productContainer = parsed.products?.product; const products = Array.isArray(productContainer) ? productContainer - : productContainer + : (productContainer ? [productContainer] - : []; + : []); const subscriptions: Subscription[] = []; for (const product of products) { @@ -213,9 +213,9 @@ export function transformWhmcsSubscriptionListResponse( const totalResults = typeof totalResultsRaw === "number" ? totalResultsRaw - : typeof totalResultsRaw === "string" + : (typeof totalResultsRaw === "string" ? Number.parseInt(totalResultsRaw, 10) - : subscriptions.length; + : subscriptions.length); if (status) { const normalizedStatus = subscriptionStatusSchema.parse(status);