Skip to content

Conversation

@DulsaraNethmin
Copy link

No description provided.

@DulsaraNethmin DulsaraNethmin marked this pull request as ready for review May 30, 2023 04:50
Comment on lines 381 to 386
if (!$canNameEdit && $name) {
throw $this->getInvalidParamException(self::PARAMETER_NAME);
}
if ($canNameEdit && $name) {
$claimEvent->setName($name);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!$canNameEdit && $name ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used to handle situation like, when sending "name" in a request body for used ClaimEvent.

* @param ClaimExpense $claimExpense
*/
public function setClaimExpense(ClaimExpense $claimExpense): void
public function setClaimExpense(ClaimExpense $claimExpense, bool $isEdit = false): void
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this need ?

$this->throwRecordNotFoundExceptionIfNotExist($claimEvent, ClaimEvent::class);
$canNameEdit = !$this->getClaimService()->getClaimDao()->isClaimEventUsed($id);
$name = $this->getRequestParams()->getStringOrNull(RequestParams::PARAM_TYPE_BODY, self::PARAMETER_NAME);
if (!$canNameEdit && $name) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This expression is not clear. Are you going to check this 🤔

        if (!$canNameEdit && $name !== '') {

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checking is it null or not.

@RajithaKumara RajithaKumara changed the title OHRM5X-2218: Make Claim Event/Expense Type editable OHRM5X-2222: Fix claim - related issues Jun 1, 2023
@RajithaKumara RajithaKumara merged commit 73f0cb5 into orangehrm:5.5 Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants