Project

General

Profile

Defect #1430

Contract with highest "valid from" is returned as prime contract

Added by Alena Peterová 3 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Category:
Contractual relationship
Target version:
Start date:
12/20/2018
Due date:
% Done:

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

History

#1 Updated by Alena Peterová 3 months 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).

#2 Updated by Radek Tomiška 3 months ago

  • Status changed from New to In Progress

#3 Updated by Radek Tomiška 3 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:
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 :/

#4 Updated by Ondřej Kopr 2 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.

#5 Updated by Radek Tomiška 2 months ago

  • Status changed from Needs feedback to Closed

Also available in: Atom PDF