Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Uniqueness of
key
for RelationshipAttributes (#319)
* refactor: preapare CreateAttributeRequestItemProcessor to add more validation * feat: add validation for CreateAttributeRequestItemProcessor * test: CreateAttributeRequestItemProcessor key validation * fix: uniqueness for key only instead of pair of owner and key * fix: failing test * test: ensure key uniqueness in attributes.test * test: ensure key uniqueness in CreateRelationshipAttributeRequestItemDVO.test * feat: use database language every database understands * test: ensure key uniqueness only for constant ownership * fix: too late clean up of Attributes * feat: ensure key uniqueness only for RelationshipAttributes that are not in deletion in any way * refactor: extract function call as auxiliary function * refactor: put afterEach block inside describe block * feat: ensure key uniqueness for Recipient within CreateAttributeRequestItemProcessor * refactor: auxiliary function can be applied to queries as well * feat: ensure key uniqueness for Sender within ReadAttributeRequestItemProcessor * feat: ensure key uniqueness only for constant value type * fix: failing tests with async canCreateOutgoingRequestItem method * feat: key uniqueness for Recipient within ReadAttributeRequestItemProcessor * feat: ensure key uniquess for empty owner as placeholder as well * refactor: simplify error message * refactor: move validation to canAccept method * refactor: standardize error messages * test: ensure key uniqueness with empty owner * test: move tests to canAccept block * fix: call accept instead of canAccept * test: refactor canAccept test with SuccessfulValidationResult * test: make tests independent of each other * feat: ensure key uniqueness for empty owner queried with ReadAttributeRequestItem * feat: ensure key uniqueness on Sender site of ProposeAttributeRequestItemProcessor * feat: ensure key uniqueness on Recipient site of ProposeAttributeRequestItemProcessor * refactor: standardize error messages * feat: prohibit Requests that create more than one RelationshipAttribute with same key * fix: title type * test: key uniqueness of incomingRequestsController * test: key uniqueness of OutgoingRequestsController * refactor: remove recursion of IncomingRequestsController * refactor: keep RequestItemGroup in mind * refactor: use auxiliary method for clearness * feat: handle empty owner in IncomingRequestsController and OutgoingRequestsController * test: ensure key uniqueness for empty owner * refactor: move validation from canDecide to canAccept * fix: failing IncomingRequestsController test * test: ensure key uniqueness with RequestItemGroups * fix: wrong DecideRequestParameters for RequestItemGroups * feat: use already known separation sequence * feat: give better validation function name * refactor: do not break existing code blocks anymore * fix: error due to incorrect merging * test: ensure key uniqueness with ProposeAttributeRequestItem * chore: descriptive values should not start with capital letter * refactor: rename error code * feat: distinguish between user mistake and deformed Request * feat: throwing instead of returning error if Request is deformed * feat: reuse key uniqueness error * feat: distinguish between deformed Requests and wrong accept parameters * test: RequestItem cannot be accepted due to incorrect params of User * fix: failing test due to void return * feat: self-explanatory variable names * refactor: more renaming of variables * refactor: unify renaming * feat: simplify error message for unknown recipient of Request * feat: incorporate some review comments * fix: failing test due to wrong error format * feat: incorporate review comment * refactor: prepare reusability of code * fix: error due to merge * feat: use JSON.stringify() instead of own method for extracting identifiers * refactor: reduce redundancy by move auxiliary functions to different file * feat: inform user what key would be redundantly in use * feat: incorporate some review comments * feat: incoporate review comments * refactor: change order of thrown errors * test: can propose and query RelationshipAttribute with same key but different value type * feat: incorporate review comments * refactor: simplify extraction of fragments of mustBeAcceptedItems * refactor: further simplification of extraction of fragments of mustBeAcceptedItems * refactor: simplify extraction of fragments of accepte items * fix: returned instead of continued * test: RequestItem cannot be accepted if key uniqueness is violated regardless of value of mustBeAccepted --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Milena Czierlinski <milena.czierlinski@js-soft.com>
- Loading branch information