arkivverket / arkade5

Arkade 5 - testverktøy for arkivuttrekk
http://arkade.arkivverket.no
GNU Affero General Public License v3.0
12 stars 17 forks source link

N5.60 Start- og sluttdatoer - Noe feil med sjekkingen? #105

Closed smult closed 4 years ago

smult commented 5 years ago

Får følgende i rapporten som "feil" på flere uttrekk:

N5.60 – Start- og sluttdatoer Type: Innholdsanalyse Resultater Lokasjon Melding Start- og sluttdato i arkivstrukturen: 02.01.2008 - 02.02.2016 Start- og sluttdato i offentlig journal: 02.01.2008 - 02.02.2016 Start- og sluttdato i løpende journal: 02.01.2008 - 02.02.2016 Periodeskille er skarpt og datoer i arkivstrukturen er ikke like de i offentlig og løpende journal

For meg ser disse datoene like ut.. men Arkade melder dem som forskjellige? Hva skjer?

palm72 commented 5 years ago

Har opplevd det samme, Oppdaget da at arkivuttrekk.xml opererte med andre periodedatoer enn det som var registrert i de øvrige filene. Dersom dette er årsaken, bør det opplyses i rapporten.

joergen-vs commented 5 years ago

Det er lagt inn feilmelding til utviklerne.

douzounov commented 5 years ago

See the following code in Arkivverket.Arkade.Core/Testing/Noark5/N5_60_ArchiveStartAndEndDateControl.cs:

     if (_periodSeparationIsSharp && !StartAndEndDate.Equals(archiveDates, 
        publicJournalDates, runningJournalDates))
          testResults.Add(new TestResult(ResultType.Error, new Location(""),
          Noark5Messages.ArchiveStartAndEndDateControlMessage_UnEqualJournalAndArchiveDates));
       private class StartAndEndDate
        {
            private DateTime _startDate;
            private DateTime _endDate;
            private readonly string _dateFormat;

            public StartAndEndDate(DateTime startDate, DateTime endDate)
            {
                _startDate = startDate.Date;
                _endDate = endDate.Date;
                _dateFormat = "dd.MM.yyyy";
            }

            public string StartDate()
            {
                return _startDate.ToString(_dateFormat);
            }

            public string EndDate()
            {
                return _endDate.ToString(_dateFormat);
            }

            public bool Equals(StartAndEndDate startAndEndDate)
            {
                return startAndEndDate._startDate.Equals(_startDate)
                       && startAndEndDate._endDate.Equals(_endDate);
            }

            public static bool Equals(params StartAndEndDate[] startAndEndDates)
            {
                return startAndEndDates.All(s => s.Equals(startAndEndDates.First()));
            }
        }

The Equals methods in the StartAndEndDate class will hardly ever return true because they try to compare a date with a time element (in this case opprettetDato which is defined as xs:dateTime in metadatakatalog.xsd) to a date without a time element (in this case journaldato which is defined as xs:date in metadatakatalog.xsd). See also https://github.com/arkivverket/arkade5/issues/112 for the reasoning why the above code should only use journaldato.

douzounov commented 4 years ago

It appears that this issue has been fixed with https://github.com/arkivverket/arkade5/commit/65c63ffdcf62cba1252c05a8fc9f9daffbee428c. Can someone please confirm?

joergen-vs commented 4 years ago

Version 1.5.1 uses "journaldato", not "opprettetDato". The new datatype is date, same as "journalStartDato" and "journalSluttDato" from the journals.

erikaaberg commented 4 years ago

Changes in release 1.5.1:

• Noark 5 tests o N5.60: Start and end date control is now performed using the field journaldato (not opprettetDato). o N5.60: Situation with no registrations / registration dates are now handled and written to report. o N5.10: Folders without a specific type are now counted and included in report. o N5.16: Registrations without a specific type are now counted and included in report. o N5.16: The term Registertype is corrected to Registreringstype. o + some minor internal system improvements.

Comment: An upgrade of .Net (and possibly reboot) may be necessary.