MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / validateAutoVerifyCriteria

Function validateAutoVerifyCriteria

src/services/verificationService.js:656–680  ·  view source on GitHub ↗
(criteria, accountAgeDays)

Source from the content-addressed store, hash-verified

654}
655
656export function validateAutoVerifyCriteria(criteria, accountAgeDays) {
657 const validCriteria = ['account_age', 'server_size', 'none'];
658
659 if (!validCriteria.includes(criteria)) {
660 throw createError(
661 `Invalid auto-verify criteria: ${criteria}`,
662 ErrorTypes.VALIDATION,
663 "Please select a valid criteria option.",
664 { criteria, validCriteria }
665 );
666 }
667
668 if (criteria === 'account_age') {
669 if (!accountAgeDays || accountAgeDays < minAutoVerifyAccountAgeDays || accountAgeDays > maxAutoVerifyAccountAgeDays) {
670 throw createError(
671 "Invalid account age days",
672 ErrorTypes.VALIDATION,
673 `Account age must be between ${minAutoVerifyAccountAgeDays} and ${maxAutoVerifyAccountAgeDays} days.`,
674 { accountAgeDays, minAutoVerifyAccountAgeDays, maxAutoVerifyAccountAgeDays }
675 );
676 }
677 }
678
679 return { criteria, accountAgeDays };
680}
681
682export default {
683 verifyUser,

Callers 1

handleSetupFunction · 0.90

Calls 1

createErrorFunction · 0.90

Tested by

no test coverage detected