-
Notifications
You must be signed in to change notification settings - Fork 49
(feat) O3-5121: Add ability to edit cashpoints #442
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
base: main
Are you sure you want to change the base?
Conversation
NethmiRodrigo
left a comment
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.
Thanks @abertnamanya, a few suggestions:
Co-authored-by: Nethmi Rodrigo <[email protected]>
Co-authored-by: Nethmi Rodrigo <[email protected]>
Co-authored-by: Nethmi Rodrigo <[email protected]>
|
Does the backend resource fully support editing cash points? @dkayiwa |
|
@denniskigen no it does not. |
|
So we'd need to fix that as a pre-requisite for any work on the frontend, right? |
|
Actually, it looks like the save functionality exists in the base class here https://github.com/openmrs/openmrs-module-billing/blob/main/omod/src/main/java/org/openmrs/module/billing/web/base/resource/BaseRestMetadataResource.java#L61, so this should be viable. I'd recommend dropping the |
@denniskigen I think its okay to leave this as is because cash points are mainly meant to be an Iniz config like so - https://github.com/openmrs/openmrs-content-referenceapplication-demo/blob/main/configuration/backend_configuration/cashpoints/cashPoints.csv The current implementation allows editing cash points through the UI, but these changes:
Maybe we could add a clear warning indicating that changes made to the cash points configuration are ephemeral and that the canonical place to make changes is in the demo content package. Any thoughts, @ibacher? |
src/billable-services/cash-point/cash-point-configuration.component.tsx
Outdated
Show resolved
Hide resolved
|
|
||
| export const updateCashPoint = (uuid: string, payload: UpdateCashPointPayload) => { | ||
| return openmrsFetch(`${apiBasePath}cashPoint/${uuid}`, { | ||
| method: 'POST', |
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.
| method: 'POST', | |
| method: 'PUT', |
PUT is the canonical HTTP request method for updates.
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.
Yeah, it should be a PUT, but the endpoint does not seem to accept the request
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.
Yeah, that sounds like a bug. The controller in the backend might be misparsing main resource URLs. Could you have a look when you get some time, @wikumChamith?
Let's keep it as a POST for now, @abertnamanya.
|
So, the code LGTM. What's holding this up is the potential config drift issue I spoke about here. Still eager to hear the thoughts of @dkayiwa @wikumChamith @ibacher on how we should handle it. |
Requirements
Summary
Edit/update cashpoints in the billing module
Screenshots
Screen-Recording.5.mp4
Related Issue
https://openmrs.atlassian.net/browse/O3-5121
Other