const getConstants = require('../../../../src/constants').getConstants
const CONSTANTS = getConstants()
const year = '3000'

const secretariatHeader = {
  'content-type': 'application/json',
  'CVE-API-ORG': 'mitre',
  'CVE-API-USER': 'cpadro',
  'CVE-API-KEY': 'S96E4QT-SMT4YE3-KX03X6K-4615CED'
}

const userAHeader = {
  'content-type': 'application/json',
  'CVE-API-ORG': 'cisco',
  'CVE-API-USER': 'alopez',
  'CVE-API-KEY': 'SVXPHM9-1VXM0A8-QMG8WN0-29MASSE'
}

const userBHeader = {
  'content-type': 'application/json',
  'CVE-API-ORG': 'siemens',
  'CVE-API-USER': 'rgonz',
  'CVE-API-KEY': '006YPCK-14R46D6-KR24W1K-PJG5BVP'
}

const secretariatOrg = {
  UUID: '15fd129f-af00-4d8c-8f7b-e19b0587223f',
  authority: {
    active_roles: [CONSTANTS.AUTH_ROLE_ENUM.CNA, CONSTANTS.AUTH_ROLE_ENUM.SECRETARIAT]
  },
  name: 'The MITRE Corporation',
  policies: {
    id_quota: 1000
  },
  short_name: 'mitre',
  inUse: false
}

const secretariatUser = {
  UUID: 'e13186d5-ce3d-4fd9-aecd-8698c26897f2',
  org_UUID: secretariatOrg.UUID,
  name: {
    first: 'Cristina',
    last: 'Padro'
  },
  authority: {
    active_roles: []
  },
  secret: '$argon2i$v=19$m=4096,t=3,p=1$+qGHEfH5h4/tk404iWBxFw$xV96/b4NvQVvlZIq57wTS8s7gfKzsfMXRiOyf3ffgcw',
  username: 'cpadro',
  active: true
}

const orgA = {
  UUID: '88c02595-c8f7-4864-a0e7-e09b3e1da691',
  authority: {
    active_roles: [CONSTANTS.AUTH_ROLE_ENUM.CNA]
  },
  name: 'Cisco',
  policies: {
    id_quota: 500
  },
  short_name: 'cisco',
  inUse: false
}

const userA = {
  UUID: '1fcbf829-81ae-4b53-a61d-9fa04711447f',
  org_UUID: orgA.UUID,
  name: {
    first: 'Armando',
    last: 'Lopez',
    middle: 'Jose'
  },
  authority: {
    active_roles: []
  },
  secret: '$argon2i$v=19$m=4096,t=3,p=1$bHTrVB/WVMI+yscYe1Y1aQ$RdQkx9w9sME6z5W/2tyHu/6WcYGvi1JeY3KLbr+ioBg',
  username: 'alopez',
  active: true
}

const orgB = {
  UUID: 'c0a1d017-faa5-4608-92ff-5c938da17eff',
  authority: {
    active_roles: [CONSTANTS.AUTH_ROLE_ENUM.CNA]
  },
  name: 'Siemens',
  policies: {
    id_quota: 500
  },
  short_name: 'siemens',
  inUse: false
}

const userB = {
  UUID: '4121968f-cc2d-4680-b9b0-39e98a2182f6',
  org_UUID: orgB.UUID,
  name: {
    first: 'Rebecca',
    last: 'Gonzalez',
    middle: 'Andrea'
  },
  authority: {
    active_roles: []
  },
  secret: '$argon2i$v=19$m=4096,t=3,p=1$3q1N+kLqTivvqH1q+r1G5Q$7E+ZXrwagOmWaXFxnBbfaWwTyfpWBhsGMitaF82cx3Q',
  username: 'rgonz',
  active: true
}

const availableCveIds = [
  {
    cve_id: `CVE-${year}-20001`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-20002`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-20003`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-20004`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-20005`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  }
]

const availableCveIdsAB = []

const availableCveIdsA = [...availableCveIds]

const availableCveIdsB = [...availableCveIds]

const availableCveIdsC = [
  {
    cve_id: `CVE-${year}-0001`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  }
]

const cveIdsE = [
  {
    cve_id: `CVE-${year}-0001`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0002`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0003`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0004`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0005`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0006`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0007`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0008`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.RESERVED,
    owning_cna: secretariatOrg.UUID,
    reserved: Date.now(),
    requested_by: {
      cna: secretariatUser.org_UUID,
      user: secretariatUser.UUID
    }
  },
  {
    cve_id: `CVE-${year}-0009`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.RESERVED,
    owning_cna: secretariatOrg.UUID,
    reserved: Date.now(),
    requested_by: {
      cna: secretariatUser.org_UUID,
      user: secretariatUser.UUID
    }
  },
  {
    cve_id: `CVE-${year}-0010`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.RESERVED,
    owning_cna: secretariatOrg.UUID,
    reserved: Date.now(),
    requested_by: {
      cna: secretariatUser.org_UUID,
      user: secretariatUser.UUID
    }
  }
]

const availableCveIdsF = [
  {
    cve_id: `CVE-${year}-0001`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0002`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0003`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0004`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0005`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0006`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0007`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0008`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0009`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0010`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0011`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0012`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0013`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0014`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  },
  {
    cve_id: `CVE-${year}-0015`,
    cve_year: year,
    state: CONSTANTS.CVE_STATES.AVAILABLE,
    owning_cna: 'N/A',
    reserved: Date.now(),
    requested_by: {
      cna: 'N/A',
      user: 'N/A'
    }
  }
]

const availableCveIdsG = [...availableCveIdsF]

module.exports = {
  availableCveIds,
  availableCveIdsAB,
  availableCveIdsA,
  availableCveIdsB,
  availableCveIdsC,
  cveIdsE,
  availableCveIdsF,
  availableCveIdsG,
  secretariatHeader,
  userAHeader,
  userBHeader,
  secretariatOrg,
  secretariatUser,
  orgA,
  userA,
  orgB,
  userB,
  year
}
