maykinmedia / objects-api

API and admin interface to manage Objects of certain Objecttypes. An object can be anything whether its a monument, report, tree or a permit.
https://opengem.nl/producten/overige-registraties/
Other
7 stars 10 forks source link

Test and rework history logic (part 1) #168

Closed joeribekker closed 3 years ago

joeribekker commented 3 years ago

Hints

Documentation: https://www.gemmaonline.nl/images/gemmaonline/f/fa/Stuf0301.pdf

Add the following JSON schema to mimic the StUF documentation on history (PersoonId is left out since its unused):

The other attributes should be covered by our internal model:

image

image

Note: The history is changed here, not by API calls but just a new usecase. His name was registered incorrectly on 20010910 and record 40 corrected record 10. Ordering on registratedAt shows this.

image

Note: New scenario: Record 10 had an incorrect startAt date! So, 40 was still added to correct 10 but we cannot order on startAt alone anymore to decide the correct record. Corrections should be taken into account.

annashamray commented 3 years ago

@joeribekker

Test 4b: material history on 01-10-2001 should say: Records 10 and 40 (both are material records on that date). Test 5b: material history on 01-10-2001 should say: Records 10 and 40 (both are material records on that date).

Now we show the last record which fits the date. If two records have to be shown we need to change Object.record atribute from object to array in the OAS and implementation.

annashamray commented 3 years ago

@joeribekker

Test 4c: formal history on 01-10-2001 should say: Record 40 (since it was registered later than record 10) Test 5d: formal history on 01-10-2001 should say: Record 40 (since it was registered later than record 10)

Formal history on 01-10-2001 should say: Record 10, because Record 40 was registered 02-11-2001, i.e. later than 01-10-2001

annashamray commented 3 years ago

@joeribekker

Test 5c: material history on 04-09-2001 should say: Record 10.

Record 10 starts at 05-09-2001, and Record 40 starts at 03-09-2001. Therefore material history on 04-09-2001 should say: Record 40.

Test 5e: formal history on 04-09-2001 should say: Record 40 (since record 10 was corrected by record 40)

Record 40 was registered at 02-11-2001, Record 10 was registered at 10-09-2001. On 04-09-2001 only Record 1 was available

annashamray commented 3 years ago

@joeribekker

Test 5g: formal history for the entire object, should show records 1, 40, 50 Test 5h: material history for the entire object, should show all records (always)

For now we have only history endpoint that shows all the records for the particular object. We don't have an endpoint to show different types of history.

joeribekker commented 3 years ago

All your comments are valid!