import {Category} from '@shared/models/category.model';
import {Pentest} from '@shared/models/pentest.model';

import {getINFO_Pentests} from '@shared/functions/categories/INFO/pentests.function';
import {getCONFIG_Pentests} from '@shared/functions/categories/CONFIG/pentests.function';
import {getIDENT_Pentests} from '@shared/functions/categories/IDENT/pentests.function';
import {getAUTHN_Pentests} from '@shared/functions/categories/AUTHN/pentests.function';
import {getAUTHZ_Pentests} from '@shared/functions/categories/AUTHZ/pentests.function';
import {getSESS_Pentests} from '@shared/functions/categories/SESS/pentests.function';
import {getINPVAL_Pentests} from '@shared/functions/categories/INPVAL/pentests.function';
import {getERR_Pentests} from '@shared/functions/categories/ERR/pentests.function';
import {getCRYPST_Pentests} from '@shared/functions/categories/CRYPST/pentests.function';
import {getBUSLOGIC_Pentests} from '@shared/functions/categories/BUSLOGIC/pentests.function';
import {getCLIENT_Pentests} from '@shared/functions/categories/CLIENT/pentests.function';

export function getTempPentestsForCategory(requestedCategory: Category): Pentest[] {
  let pentests: Pentest[];
  switch (requestedCategory) {
    case Category.INFORMATION_GATHERING: {
      pentests = getINFO_Pentests();
      break;
    }
    case Category.CONFIGURATION_AND_DEPLOY_MANAGEMENT_TESTING: {
      pentests = getCONFIG_Pentests();
      break;
    }
    case Category.IDENTITY_MANAGEMENT_TESTING: {
      pentests = getIDENT_Pentests();
      break;
    }
    case Category.AUTHENTICATION_TESTING: {
      pentests = getAUTHN_Pentests();
      break;
    }
    case Category.AUTHORIZATION_TESTING: {
      pentests = getAUTHZ_Pentests();
      break;
    }
    case Category.SESSION_MANAGEMENT_TESTING: {
      pentests = getSESS_Pentests();
      break;
    }
    case Category.INPUT_VALIDATION_TESTING: {
      pentests = getINPVAL_Pentests();
      break;
    }
    case Category.ERROR_HANDLING: {
      pentests = getERR_Pentests();
      break;
    }
    case Category.CRYPTOGRAPHY: {
      pentests = getCRYPST_Pentests();
      break;
    }
    case Category.BUSINESS_LOGIC_TESTING: {
      pentests = getBUSLOGIC_Pentests();
      break;
    }
    case Category.CLIENT_SIDE_TESTING: {
      pentests = getCLIENT_Pentests();
      break;
    }
    default: {
      pentests = [];
      console.error('Invalid categories: ', requestedCategory);
      break;
    }
  }
  return pentests;
}
