Content
View differences
Updated by Bruno Pagno about 8 hours ago
The goal is to persist target\_versions and versions in sync, meaning implement constraints so that when we write persisting work\_package.version the data gets written to one, we write to both. target\_versions.
* Include a validation to One approach is as follows:
1. BaseContract does validations (e.g. not allow passing in both writing to version & target\_versions & version\_id at the same time time)
* Include a validation that target\_versions can contain only a single value (conditional)
This implementation will be done in WorkPackage services:
1. BaseContract does validations
2. SetAttributeService stores the values in the model in memory on a temporary variable (similar to attachments)
3. CreateService & UpdateService persist associated versions set during SetAttributeServices op based on SetAttributeServices's outcomes
reference implementation:
* [https://github.com/opf/openproject/pull/22473/changes/d6edee9f492a35b206a6bfb821cbec391d20d459](https://github.com/opf/openproject/pull/22473/changes/d6edee9f492a35b206a6bfb821cbec391d20d459)
* Some things here as well [https://github.com/opf/openproject/pull/22473/changes/f8ce6fd573d5aefe31b094e0a73ed2ff1614a60a](https://github.com/opf/openproject/pull/22473/changes/f8ce6fd573d5aefe31b094e0a73ed2ff1614a60a) but less relevant
* Include a validation to
1. BaseContract does validations (e.g.
* Include a validation that target\_versions can contain only a single value (conditional)
This implementation will be done in WorkPackage services:
1. BaseContract does validations
2. SetAttributeService stores the values in the model in memory on a temporary variable (similar to attachments)
3. CreateService & UpdateService persist
reference implementation:
* [https://github.com/opf/openproject/pull/22473/changes/d6edee9f492a35b206a6bfb821cbec391d20d459](https://github.com/opf/openproject/pull/22473/changes/d6edee9f492a35b206a6bfb821cbec391d20d459)
* Some things here as well [https://github.com/opf/openproject/pull/22473/changes/f8ce6fd573d5aefe31b094e0a73ed2ff1614a60a](https://github.com/opf/openproject/pull/22473/changes/f8ce6fd573d5aefe31b094e0a73ed2ff1614a60a) but less relevant