F1 (Java) Story 13 Upgrade CollaborationProject CREATE operation business logic.

Description

On project creation, the input JSON payload is a document of the CollaborationProject kind. We need to validate the provided content and specifically augment it:

  1. If data.LifecycleStatus is provided, it MUST be namespace:reference-data--CollaborationProjectStatus:Open:. Or we raise error.
  2. If data.LifecycleStatus is NOT provided, we set it to namespace:reference-data--CollaborationProjectStatus:Open:.
  3. If non-empty data.LifecycleEvents is provided, we raise an error.
  4. We add a new CollaborationLifecycleEvent to the data.LifecycleEvents:
{
  "Name": "Create",
  "Date": "<current timestamp>"
}
  1. If "data.Namespace" is provided, we check its uniqueness and format correctness. If it is not unique or incorrect, we raise an error.

  2. If "data.Namespace" is NOT provided, we generate a value, check its uniqueness, and re-generate it if is not unique. Then we set the value.

  3. If data.TrustedResourcesID is provided - we raise an error.

Acceptance Criteria

All data validation and augmentation requirements listed in the description are implemented and tested.

Testing Scenarios

  1. Test the CREATE operation of the ProjectService` class with both valid and invalid payloads.
  2. Each validator should be intensively tested with varied payloads to ensure correct validations and modifications.

Technical Notes

  1. For data store-read from OSDU use Storage client from os-core-common lib
Edited Mar 11, 2024 by Rostislav Dublin (EPAM)
Assignee Loading
Time tracking Loading