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

6455 cancelled prescription status #6509

Merged
merged 10 commits into from
Feb 13, 2025

Conversation

zachariah-at-msupply
Copy link
Contributor

Fixes #6455

πŸ‘©πŸ»β€πŸ’» What does this PR do?

Adds the cancelled status for invoices.
This means prescriptions can now have a cancelled status.

πŸ’Œ Any notes for the reviewer?

πŸ§ͺ Testing

  • check it compiles
  • run the migrations and see if they do what is expected

πŸ“ƒ Documentation

  • Part of an epic: documentation will be completed for the feature as a whole
  • No documentation required: no user facing changes or a bug fix which isn't a change in behaviour
  • These areas should be updated or checked:

@github-actions github-actions bot added Team Piwakawaka James, Carl, John, Zachariah feature: dispensing labels Feb 13, 2025
Copy link

github-actions bot commented Feb 13, 2025

Bundle size difference

Comparing this PR to main

Old size New size Diff
5.32 MB 5.32 MB 356 B (0.01%)

@jmbrunskill jmbrunskill self-assigned this Feb 13, 2025
Copy link
Contributor

@jmbrunskill jmbrunskill left a comment

Choose a reason for hiding this comment

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

Looks good, just want to merge a couple of quick fixes before merging

@@ -34,6 +34,7 @@ const createStatusLog = (invoice: PrescriptionRowFragment) => {
[InvoiceNodeStatus.Allocated]: null,
[InvoiceNodeStatus.Shipped]: null,
[InvoiceNodeStatus.Delivered]: null,
[InvoiceNodeStatus.Cancelled]: null,
Copy link
Contributor

Choose a reason for hiding this comment

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

  if (statusIdx >= 3) {
    statusLog[InvoiceNodeStatus.Cancelled] = invoice.cancelledDatetime;
  }

We might want something like this added, I think that will require chaging the PrescriptionRowFragment as well though.

Copy link
Contributor

Choose a reason for hiding this comment

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

Added an issue follow up on this...

@@ -740,6 +740,7 @@ fn legacy_invoice_status(t: &InvoiceType, status: &InvoiceStatus) -> Option<Lega
InvoiceStatus::Shipped => LegacyTransactStatus::Fn,
InvoiceStatus::Delivered => LegacyTransactStatus::Fn,
InvoiceStatus::Verified => LegacyTransactStatus::Fn,
InvoiceStatus::Cancelled => LegacyTransactStatus::Fn, // TODO enable cancelled status to sync with mSupply https://github.com/msupply-foundation/open-msupply/issues/6495
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for these comments!

@@ -213,6 +214,7 @@ impl ActivityLogNodeType {
from::DemographicIndicatorUpdated => to::DemographicIndicatorUpdated,
from::DemographicProjectionCreated => to::DemographicProjectionCreated,
from::DemographicProjectionUpdated => to::DemographicProjectionUpdated,
&repository::ActivityLogType::InvoiceStatusCancelled | &repository::ActivityLogType::PrescriptionStatusCancelled => todo!()
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't really want to have todo! code in the develop branch, will push a fix for this, mapping to the right fields.

            from::PrescriptionStatusCancelled => to::PrescriptionStatusCancelled,
            from::InvoiceStatusCancelled => to::InvoiceStatusCancelled,

@@ -184,6 +186,7 @@ export const isInboundDisabled = (inbound: InboundRowFragment): boolean => {
case InvoiceNodeStatus.Allocated:
// Inbound shipments can be edited when having been delivered
case InvoiceNodeStatus.Delivered:
case InvoiceNodeStatus.Cancelled:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this needs to be in the disabled section, after Verified

Copy link
Contributor

@jmbrunskill jmbrunskill left a comment

Choose a reason for hiding this comment

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

Thanks @zachariah-at-msupply good to merge!

@jmbrunskill jmbrunskill merged commit 0ff94e8 into develop Feb 13, 2025
6 checks passed
@jmbrunskill jmbrunskill deleted the 6455-cancelled-prescription-status branch February 13, 2025 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: dispensing Team Piwakawaka James, Carl, John, Zachariah
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement a new status for prescriptions, of Cancelled
2 participants