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

(feat) Add payment mode usage status and prevent deletion if in use #75

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ODORA0
Copy link
Member

@ODORA0 ODORA0 commented Dec 19, 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 status column with tags showing payment mode usage
  • Implement status check using /billing/paymentMode/isInUse endpoint
  • Update UI to reflect payment mode usage status

Screenshots

Screen.Recording.2024-12-19.at.15.27.39.mov

Related Issue

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

Other

Dependant on this backend PR

@ODORA0 ODORA0 marked this pull request as ready for review December 19, 2024 11:31
};

const rowData = paymentModes.map((mode) => ({
id: mode.uuid,
name: mode.name,
description: mode.description || '--',
status: statusMap[mode.uuid] ? 'In Use' : 'Not In Use',
Copy link

Choose a reason for hiding this comment

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

lets move this to constants and also translate them

{row.cells.map((cell) =>
cell.info.header === 'status' ? (
<TableCell key={cell.id}>
<Tag type={cell.value === 'In Use' ? 'red' : 'green'}>{cell.value}</Tag>
Copy link

Choose a reason for hiding this comment

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

this too

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.

2 participants