Update of the core module

Models

Mandatory fields have *

Technical fields have **

HistoryModel

Field in HistoryModel:

  • UUID (UUIDField)**

  • isDeleted (bool)** default false

  • Json_ext (json)

  • DateCreated (date)**

  • DateUpdated (date)**

  • UserUpdatedUUID (fk users)**

  • UserCreatedUUID (fk users)**

Actions

on create:

  • save the action in the history log (django-simple-history)

  • UUID is generated by database

  • update:

    • DateCreated (date)**

    • DateUpdated (date)**

    • UserUpdatedUUID (fk users)**

    • UserCreatedUUID (fk users)**

    • version = 1

on update:

  • save the action in the history log (django-simple-history)

  • check that the version save is still the same as the one in-memory

  • update the fields

    • DateUpdated (date)**

    • UserUpdatedUUID (fk users)**

    • version (+1)

on Delete:

  • save the action in the history log (django-simple-history)

  • check that the version save is still the same as the one in-memory

  • update the fields

    • DateUpdated (date)**

    • UserUpdatedUUID (fk users)**

    • version (+1)

    • isDeleted to True

HistoryBusinessModel

Field in HistoryBusinessModel

  • HistoryModel fields

  • DateValidFrom (date)*

  • DateValidTo (date)

  • ReplacementUUID (UUID)

Actions

on create: same as HistoryModel

on update: same as HistoryModel

on Delete: same as HistoryModel

on Replace

  • create the new entity

    • save the action in the history log (django-simple-history)

    • UUID is generated on database level

    • Update

      • DateCreated (date)**

      • DateUpdated (date)**

      • UserUpdatedUUID (fk users)**

      • UserCreatedUUID (fk users)**

      • version = 1

    • check that

      • DateValidFrom is not empty

  • update the fields for the entity to be replaced (ri)

    • save the action in the history log (django-simple-history)

    • check that the version save is still the same as the one in-memory

    • update

      • DateUpdated (date)**

      • UserUpdatedUUID (fk users)**

      • version (+1)

      • DateValidTo set to DateValidFrom the new entity(ni) if ni.DateValidFrom < ri.DateValidTo or ri.DateValidTo is null

      • ReplacementUUID set to UUID of new entity

 

 

 

Did you encounter a problem or do you have a suggestion?

Please contact our Service Desk



This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-sa/4.0/