<commit_before>package xml

import models.domain._
import XMLHelper.{stringify, booleanStringToYesNo, formatValue}
import scala.xml.{NodeSeq, NodeBuffer, Elem}
import app.{PensionPaymentFrequency, StatutoryPaymentFrequency}
import app.XMLValues._

object EvidenceList {

  def xml(claim: Claim) = {
    <EvidenceList>
      {evidence(claim)}{aboutYou(claim)}{yourPartner(claim)}{careYouProvide(claim)}{breaks(claim)}{timeSpentAbroad(claim)}{fiftyTwoWeeksTrips(claim)}{employment(claim)}{selfEmployment(claim)}{otherMoney(claim)}{consentAndDeclaration(claim)}
    </EvidenceList>
  }

  def evidence(claim: Claim): NodeBuffer = {
    val employment = claim.questionGroup[models.domain.Employment].getOrElse(models.domain.Employment())
    val employed = employment.beenEmployedSince6MonthsBeforeClaim == yes
    val selfEmployed = employment.beenSelfEmployedSince1WeekBeforeClaim == yes
    val claimDate = claim.questionGroup[ClaimDate].getOrElse(ClaimDate())

    val buffer = new NodeBuffer

    if (employed || selfEmployed) {
      buffer += textLine("Send us the following documents below including your Name and National Insurance (NI) number.")

      if (employed) {
        buffer += textLine()
        buffer += textLine("Your Employment documents.")<commit_msg>Adding the XML Generation date to the evidence list<commit_after>package xml

import models.domain._
import XMLHelper.{stringify, booleanStringToYesNo, formatValue}
import scala.xml.{NodeSeq, NodeBuffer, Elem}
import app.{PensionPaymentFrequency, StatutoryPaymentFrequency}
import app.XMLValues._
import org.joda.time.format.DateTimeFormat
import org.joda.time.DateTime

object EvidenceList {

  def xml(claim: Claim) = {
    <EvidenceList>
      {xmlGenerated()}{evidence(claim)}{aboutYou(claim)}{yourPartner(claim)}{careYouProvide(claim)}{breaks(claim)}{timeSpentAbroad(claim)}{fiftyTwoWeeksTrips(claim)}{employment(claim)}{selfEmployment(claim)}{otherMoney(claim)}{consentAndDeclaration(claim)}
    </EvidenceList>
  }

  def xmlGenerated() = {
    textLine("XML Generated at: "+DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss").print(DateTime.now()))
  }


  def evidence(claim: Claim): NodeBuffer = {
    val employment = claim.questionGroup[models.domain.Employment].getOrElse(models.domain.Employment())
    val employed = employment.beenEmployedSince6MonthsBeforeClaim == yes
    val selfEmployed = employment.beenSelfEmployedSince1WeekBeforeClaim == yes
    val claimDate = claim.questionGroup[ClaimDate].getOrElse(ClaimDate())

    val buffer = new NodeBuffer

    if (employed || selfEmployed) {
      buffer += textLine("Send us the following documents below including your Name and National Insurance (NI) number.")

      if (employed) {
        buffer += textLine()
        buffer += textLine("Your Employment documents.")
{'fraction_non_alphanumeric': 0.11565836298932385, 'fraction_numerical': 0.0014234875444839859, 'mean_word_length': 5.598591549295775, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7238546', 'n_tokens_mistral': 820, 'n_tokens_neox': 768, 'n_words': 163}