<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace CprBroker.DBR
{
    public class ErrorRequestType : NewRquestType
    {
        public ErrorRequestType(string contents)
        {

        }

        public override DiversionResponseType Process(string dprConnectionString)
        {
            DiversionResponseType ret = null;

            if (Contents.Length < 12)
            {
                ret = new ClassicResponseType() { Contents = "00999999999999Fejl i kaldet - Færre end 12 tegn." };
            }
            else if (!Regex.Match(Contents, @"\A[0-9]{12}").Success)
            {
                ret = new ClassicResponseType() { Contents = "Fejl i kaldet - første 12 tegn ikke numeriske." };
            }
            else if (!PartInterface.Strings.IsValidPersonNumber(this.PNR))
            {
                ret = new ClassicResponseType()
                {
                    Type = this.Type,
                    LargeData = this.LargeData,
                    ErrorNumber = "40",
                    PNR = this.PNR,
                    Data = " Personnummer forkert opbygget. Kald afvist."
                };

            }
            else if (!Regex.Match(this.Contents, @"\A[013]").Success)
            {
                ret = new ClassicResponseType()
                {
                    Type = this.Type,
                    LargeData = this.LargeData,
                    ErrorNumber = "10",
                    PNR = this.PNR,
                    Data = " ABON_TYPE ukendt"
                };
            }
            else if (!Regex.Match(this.Contents, @"\A[013][01]").Success)
            {
                ret = new ClassicResponseType() { Contents = "Tom Codepath i sSvarGammelType. Stordata = " + (int)this.LargeData };
            }
            else
            {
                // Other input validation errors 
            }

            return ret;
        }
    }
}<commit_msg>Case for invalid input to DPR viderstilling that is not correct but without a specific reason<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace CprBroker.DBR
{
    public class ErrorRequestType : NewRquestType
    {
        public ErrorRequestType(string contents)
        {

        }

        public override DiversionResponseType Process(string dprConnectionString)
        {
            DiversionResponseType ret = null;

            if (Contents.Length < 12)
            {
                ret = new ClassicResponseType() { Contents = "00999999999999Fejl i kaldet - Færre end 12 tegn." };
            }
            else if (!Regex.Match(Contents, @"\A[0-9]{12}").Success)
            {
                ret = new ClassicResponseType() { Contents = "Fejl i kaldet - første 12 tegn ikke numeriske." };
            }
            else if (!PartInterface.Strings.IsValidPersonNumber(this.PNR))
            {
                ret = new ClassicResponseType()
                {
                    Type = this.Type,
                    LargeData = this.LargeData,
                    ErrorNumber = "40",
                    PNR = this.PNR,
                    Data = " Personnummer forkert opbygget. Kald afvist."
                };

            }
            else if (!Regex.Match(this.Contents, @"\A[013]").Success)
            {
                ret = new ClassicResponseType()
                {
                    Type = this.Type,
                    LargeData = this.LargeData,
                    ErrorNumber = "10",
                    PNR = this.PNR,
                    Data = " ABON_TYPE ukendt"
                };
            }
            else if (!Regex.Match(this.Contents, @"\A[013][01]").Success)
            {
                ret = new ClassicResponseType() { Contents = "Tom Codepath i sSvarGammelType. Stordata = " + (int)this.LargeData };
            }
            else
            {
                // This case should not be reached
                // Other input validation errors
                return new ClassicResponseType()
                {
                    Type = this.Type,
                    LargeData = this.LargeData,
                    PNR = this.PNR,
                    ErrorNumber = "31",
                    Data = "Kommunikationsfejl"
                };
            }

            return ret;
        }
    }
}
{'fraction_non_alphanumeric': 0.09020732245258051, 'fraction_numerical': 0.016321129245699163, 'mean_word_length': 1.2915613946437594, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '672037', 'n_tokens_mistral': 1264, 'n_tokens_neox': 1136, 'n_words': 270}