Content
View differences
Updated by Bruno Pagno 5 days ago
The goal is to implement constraints so that when persisting work\_package.version the data gets written to target\_versions.
One approach is as follows:
1. BaseContract does validations (e.g. not allow writing to version & target\_versions at the same time)
2. SetAttributeService stores the values in memory
3. CreateService & UpdateService persist associated versions 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
One approach is as follows:
1. BaseContract does validations (e.g. not allow writing to version & target\_versions at the same time)
2. SetAttributeService stores the values in memory
3. CreateService & UpdateService persist associated versions 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