-
Notifications
You must be signed in to change notification settings - Fork 682
OHRM5X-2222: Fix claim - related issues #1701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c93a2c3 to
ba1eb63
Compare
ba1eb63 to
e7bb0a8
Compare
| if (!$canNameEdit && $name) { | ||
| throw $this->getInvalidParamException(self::PARAMETER_NAME); | ||
| } | ||
| if ($canNameEdit && $name) { | ||
| $claimEvent->setName($name); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!$canNameEdit && $name ?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this need ?
src/plugins/orangehrmClaimPlugin/test/fixtures/testcases/ClaimExpenseTypeAPITestCases.yaml
Show resolved
Hide resolved
| $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) { |
There was a problem hiding this comment.
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 !== '') {There was a problem hiding this comment.
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.
No description provided.