in src/app/functions/server/getRelevantGuidedSteps.ts [211:259]
export function hasCompletedStepSection(
data: StepDeterminationData,
section:
| "Scan"
| "HighRisk"
| "LeakedPasswords"
| "SecurityTips"
| "DataBrokerManualRemoval",
enabledFeatureFlags?: FeatureFlagName[],
): boolean {
/* c8 ignore next 8 */
// Already covered by unit tests
if (
// TODO: MNTOR-3886 - Remove EnableRemovalUnderMaintenanceStep feature flag
enabledFeatureFlags?.includes("EnableRemovalUnderMaintenanceStep") &&
section === "DataBrokerManualRemoval"
) {
return hasCompletedStep(data, "DataBrokerManualRemoval");
}
if (section === "Scan") {
return hasCompletedStep(data, "Scan");
}
if (section === "HighRisk") {
return (
hasCompletedStep(data, "HighRiskSsn") &&
hasCompletedStep(data, "HighRiskCreditCard") &&
hasCompletedStep(data, "HighRiskBankAccount") &&
hasCompletedStep(data, "HighRiskPin")
);
}
if (section === "LeakedPasswords") {
return (
hasCompletedStep(data, "LeakedPasswordsPassword") &&
hasCompletedStep(data, "LeakedPasswordsSecurityQuestion")
);
}
if (section === "SecurityTips") {
return (
hasCompletedStep(data, "SecurityTipsEmail") &&
hasCompletedStep(data, "SecurityTipsIp") &&
hasCompletedStep(data, "SecurityTipsPhone")
);
// All steps should have been covered by the above conditions:
/* c8 ignore next 4 */
}
return false as never;
}