Defect #1430
closedContract with highest "valid from" is returned as prime contract
100%
Description
Version: 9.3.1
When computing prime contract and no contract is set as "main position", then the contract with lowest "valid from" should be returned according to doc ( https://wiki.czechidm.com/devel/documentation/identities/dev/contractual-relationship#prime_contract_position).
But the contract with highest "valid from" is returned.
Affected functions:- bulk role assignment (when using "Assign to main contract only"]
- default role for synchronization is assigned only to prime contract
- groovy scripts that use identityContractService.getPrimeContract or getPrimeValidContract
Updated by Alena Peterová about 6 years ago
- Target version set to Onyx (9.3.3)
If possible, would you please include fix to 9.3.3? It would save a lot of project-specific implementation if we could use the default strategy of computing prime contract (= lowest valid from).
Updated by Radek Tomiška almost 6 years ago
- Status changed from New to In Progress
Updated by Radek Tomiška almost 6 years ago
- Status changed from In Progress to Needs feedback
- Assignee changed from Radek Tomiška to Ondřej Kopr
- % Done changed from 0 to 90
I fixed behavior of computing prime contract, there was wrong comparing of valid from dates:
https://github.com/bcvsolutions/CzechIdMng/commit/a12db58f1e926c94e0927f47841597ec1ebe70e3
Could you do a feedback, please?
Note: the unit test was created for this before, but the issue was hidden, because invalid test contract was created :/
Updated by Ondřej Kopr almost 6 years ago
- Assignee changed from Ondřej Kopr to Radek Tomiška
- % Done changed from 90 to 100
Thanks for update behavior for computed prime contract. Now it works as is described in ticket.
For example:- Contract [id:1] validTill: 1.1. 2019, validTill: 15.1. 2019,
- contract [id:2] validTill: 9.1. 2019, validTill: 1.1. 2025.
As primary contract is used contract with id: 1. This behavior is wanted by the ticket.
Updated by Radek Tomiška almost 6 years ago
- Status changed from Needs feedback to Closed