Skip to content
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

O3-4250 (feat) Ability to add Cash Points and Payment modes via a UI #74

Merged
merged 5 commits into from
Dec 18, 2024

Conversation

ODORA0
Copy link
Member

@ODORA0 ODORA0 commented Dec 10, 2024

Requirements

  • This PR has a title that briefly describes the work done including a conventional commit type prefix and a Jira ticket number if applicable. See existing PR titles for inspiration.

For changes to apps

If applicable

  • My work includes tests or is validated by existing tests.

Summary

Add UI functionality for creating billing settings during facility configuration

  • Introduced a UI to display and creation of billing configuration
    setting e.g. cash points and payment modes via tables
  • Added functionality to create new billing related setting with zod validation
  • Functionality to avoid duplicating existing cash points or payment modes

Screenshots

Screen.Recording.2024-12-11.at.12.42.26.mov

Related Issue

https://openmrs.atlassian.net/browse/O3-4250

Other

To do

  • Add functionality to prevent deleting a cash point or payment mode related to
    and existing bill (support to be added to the backend first)

@ODORA0 ODORA0 changed the title O3-4250 (feat) Ability to add cash points via a UI O3-4250 (feat) Ability to add Cash Points and Payment modes via a UI Dec 12, 2024
} from '@carbon/react';
import { Add } from '@carbon/react/icons';
import { useTranslation } from 'react-i18next';
import axios from 'axios';
Copy link
Member

Choose a reason for hiding this comment

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

Please, if at all possible, use openmrsFetch instead of axios.

Copy link
Member Author

Choose a reason for hiding this comment

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

@ibacher Absolutely

@ODORA0 ODORA0 marked this pull request as ready for review December 13, 2024 06:29
@ODORA0 ODORA0 requested a review from CynthiaKamau December 13, 2024 06:30
Copy link

@jabahum jabahum left a comment

Choose a reason for hiding this comment

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

@ODORA0 just a few changes

name: data.name,
uuid: data.uuid,
location: { uuid: data.location },
const response = await openmrsFetch('/ws/rest/v1/billing/cashPoint', {
Copy link

Choose a reason for hiding this comment

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

you could use restBaseUrl otherthan completing the entire url

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@@ -55,7 +53,7 @@ const PaymentModesConfig: React.FC = () => {

const fetchPaymentModes = useCallback(async () => {
try {
const response = await axios.get(`${baseUrl}/billing/paymentMode?v=full`);
const response = await openmrsFetch('/ws/rest/v1/billing/paymentMode?v=full');
Copy link

Choose a reason for hiding this comment

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

here too

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

await axios.post(`${baseUrl}/billing/paymentMode`, {
name: data.name,
description: data.description,
const response = await openmrsFetch('/ws/rest/v1/billing/paymentMode', {
Copy link

Choose a reason for hiding this comment

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

here too

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@@ -117,7 +132,9 @@ const PaymentModesConfig: React.FC = () => {
if (!selectedPaymentMode) return;

try {
await axios.delete(`${baseUrl}/billing/paymentMode/${selectedPaymentMode.uuid}`);
await openmrsFetch(`/ws/rest/v1/billing/paymentMode/${selectedPaymentMode.uuid}`, {
Copy link

Choose a reason for hiding this comment

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

here too

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Copy link

@jabahum jabahum left a comment

Choose a reason for hiding this comment

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

@ODORA0 looks good

@ODORA0 ODORA0 merged commit 3681f42 into openmrs:main Dec 18, 2024
5 checks passed
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.

4 participants