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:
- If
data.LifecycleStatus
is provided, it MUST benamespace:reference-data--CollaborationProjectStatus:Open:
. Or we raise error. - If
data.LifecycleStatus
is NOT provided, we set it tonamespace:reference-data--CollaborationProjectStatus:Open:
. - If non-empty
data.LifecycleEvents
is provided, we raise an error. - We add a new CollaborationLifecycleEvent to the
data.LifecycleEvents
:
{
"Name": "Create",
"Date": "<current timestamp>"
}
-
If "data.Namespace" is provided, we check its uniqueness and format correctness. If it is not unique or incorrect, we raise an error.
-
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.
-
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
- Test the
CREATE operation of the
ProjectService` class with both valid and invalid payloads. - Each validator should be intensively tested with varied payloads to ensure correct validations and modifications.
Technical Notes
- For data store-read from OSDU use Storage client from os-core-common lib
Edited by Rostislav Dublin (EPAM)