cern-sis / issues-inspire

0 stars 0 forks source link

Refactor Workflows by Type and Update Endpoints #582

Closed drjova closed 3 weeks ago

drjova commented 1 month ago

As we plan to introduce more workflow types in the backoffice, we need to refactor the current structure to better separate workflows by type. This involves creating dedicated Django apps for each workflow type, updating models, serializers, API endpoints, and ensuring changes are reflected in OpenSearch and the UI.

Separate Workflow Types:

Update API Endpoints:

Serializer and Model Refactoring:

OpenSearch Index Update:

UI Update:

Acceptance: A more modular workflow system with dedicated apps, serializers, and endpoints for each workflow type. The new /api/workflows/authors endpoint should be fully functional, with corresponding updates in Elasticsearch and the UI.

DonHaul commented 1 month ago

Questions that have risen: should is_update be removed?

https://docs.djangoproject.com/en/5.1/topics/db/models/#model-inheritance abstract or Multi-table inheritance? Base Workflow model from which all wf types (Author,Literature) etc inherit

Choices cannot really be merged / concatted as they are Models.TextChoices, once we upgrade to django 5 the issue is fixed https://docs.djangoproject.com/en/5.1/releases/5.0/#more-options-for-declaring-field-choices

DonHaul commented 1 month ago

informations in the data field is currently being dynamically generated should it be specified which fields we actually want to index?