Contract with highest "valid from" is returned as prime contract
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
#3 Updated by Radek Tomiška 5 months 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:
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 :/
#4 Updated by Ondřej Kopr 4 months 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.