EQAR / eqar_backend

REST API backend for the DEQAR database.
GNU General Public License v3.0
1 stars 0 forks source link

Issue with new names in OrgReg sync #502

Open ctueck opened 6 months ago

ctueck commented 6 months ago

There seems to be a small issue somewhere in the logic of adding & updating new names from OrgReg.

The following pattern seems to occur on the most common case, namely a new name (with no valid to date) is added, the existing name is retired by adding a valid to date.

First sync run leads to:

----------------------------------------------------------------------------------------------------
Institution record DE0128 / DEQARINST0435 (UPDATE)
Philosophisch-Theologische Hochschule St. Augustin (rk)
----------------------------------------------------------------------------------------------------
**ADD - NAME RECORD
  Name English: Cologne University of Catholic Theology
  Name Official: Kölner Hochschule für Katholische Theologie
  Acronym: KHKT
  Valid To: None
  Source Note: OrgReg-2024-CHARDE0128-2 
**UPDATE - NAME RECORD
**Because of a new name record as added without valid_to date.
  Name English: 
  Valid To: 2024-03-17 03:06:06.065604

Second sync run (next day) does:

----------------------------------------------------------------------------------------------------
Institution record DE0128 / DEQARINST0435 (UPDATE)
Cologne University of Catholic Theology
----------------------------------------------------------------------------------------------------
**UPDATE - NAME RECORD
  Name English: 
  Name Official: Philosophisch-Theologische Hochschule St. Augustin (rk)
  Acronym: 
  Valid To: 2024-03-17 <- 2020-12-31
  Source Note: OrgReg-2024-CHARDE0128-1 

I'd say that our record corresponding to OrgReg CHARDE0128-1 should simply be updated to the new valid to date in the same run where CHARDE0128-2 is added.

But instead, one run sets a default valid to date first, and the next run updates it.