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

(refactor) : applied changes from code review #302

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
@use '@carbon/layout';
@use '@carbon/colors';

.billManagerContainer {
margin: layout.$layout-01;
row-gap: layout.$layout-01;
}

.billListContainer {
background-color: white;
background-color: colors.$white-0;
}

.dataTableSkeleton {
margin-top: 0.625rem;
margin-top: layout.$spacing-05;
}

.refundedItem {
background-color: #fee2e2;
}
background-color: colors.$red-20;

.refundedItem:hover {
background-color: #fecaca !important;
}
&:hover {
background-color: colors.$red-30 !important;
}

.refundedItem:active {
background-color: #fca5a5 !important;
&:active {
background-color: colors.$red-40 !important;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use '@carbon/type';
@use '@carbon/layout';

.modalHeaderLabel {
@include type.type-style('label-02');
Expand All @@ -10,7 +11,7 @@

.button_spinner {
padding: 0;
margin-right: 12px;
margin-right: layout.$spacing-03;
}

.loading_wrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next';
import { showSnackbar } from '@openmrs/esm-framework';
import { processBillItems } from '../../../billing.resource';
import { mutate } from 'swr';
import { LineItem, MappedBill } from '../../../types';
import { LineItem, MappedBill, PaymentStatus } from '../../../types';

export const RefundBillModal: React.FC<{
onClose: () => void;
Expand All @@ -23,7 +23,7 @@ export const RefundBillModal: React.FC<{
priceName: lineItem.priceName,
priceUuid: lineItem.priceUuid,
lineItemOrder: lineItem.lineItemOrder,
paymentStatus: 'CREDITED',
paymentStatus: PaymentStatus.CREDITED,
billableService: lineItem.billableService.split(':').at(0),
};

Expand All @@ -44,7 +44,7 @@ export const RefundBillModal: React.FC<{
revalidate: true,
});
showSnackbar({
title: t('billItems', 'Refund Items'),
title: t('refundItems', 'Refund Items'),
subtitle: 'Item has been successfully refunded.',
kind: 'success',
timeoutInMs: 3000,
Expand Down
2 changes: 2 additions & 0 deletions packages/esm-billing-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { DeleteBillModal } from './billable-services/bill-manager/modals/delete-
import PriceInfoOrder from './billable-services/billiable-item/test-order/price-info-order.componet';
import ProcedureOrder from './billable-services/billiable-item/test-order/procedure-order.component';
import ImagingOrder from './billable-services/billiable-item/test-order/imaging-order.component';
import { RefundBillModal } from './billable-services/bill-manager/modals/refund-bill.modal';

const moduleName = '@kenyaemr/esm-billing-app';

Expand Down Expand Up @@ -70,6 +71,7 @@ export const deleteBillModal = getSyncLifecycle(DeleteBillModal, options);
// bill manager extensions
export const waiveBillForm = getSyncLifecycle(WaiveBillForm, options);
export const editBillForm = getSyncLifecycle(EditBillForm, options);
export const refundBillModal = getSyncLifecycle(RefundBillModal, options);

export function startupApp() {
defineConfigSchema(moduleName, configSchema);
Expand Down
10 changes: 10 additions & 0 deletions packages/esm-billing-app/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,13 @@ export type QueueEntry = {
};

export type RequestStatus = 'INITIATED' | 'COMPLETE' | 'FAILED' | 'NOT-FOUND';

export enum PaymentStatus {
POSTED = 'POSTED',
PENDING = 'PENDING',
PAID = 'PAID',
CREDITED = 'CREDITED',
CANCELLED = 'CANCELLED',
ADJUSTED = 'ADJUSTED',
EXEMPTED = 'EXEMPTED',
}
Loading