Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

...

...

Table of Contents

What is a Lot in

...

version 3?

A Lot object has the following:

  • String lotCode (required—if the shipment really does not have a code, and only has an expiration date, then users could paste that date into this code field)
  • Date expirationDate (optional)
  • Date manufactureDate (optional)
  • reference to a TradeItem (required) — this object gives us access to the Manufacturer name, etc, which will be helpful for display. (in V2 this was a reference to a product)
  • boolean active flag — potentially a future feature to be able to set a Lot as inactive after it has gone out of circulation; or maybe this is connected to how you archive the lot instead of a DELETE endpoint
  • UUID will get assigned to the Lot in ReferenceData, but it won't be visible to the user

This definition of Lot is similar to v2, with some modifications. See https://github.com/OpenLMIS/open-lmis/blob/master/modules/stock-management/src/main/java/org/openlmis/stockmanagement/domain/Lot.java for V2 domain object.

New Endpoints in ReferenceData

  • GET /api/lots?... - search and return all matching Lots; optionally query by any TradeItemID, expirationDate, and/or lotCode*
  • GET /api/lots/{id} - get a single Lot by its UUID, not searching by TradeItem
  • POST /api/lots - create a new Lot with a TradeItemID, lotCode, and optional fields (listed above)
  • PUT / api/lots/{id} - update or replace a Lot by UUID

...

*If the TradeItem has no Lots (meaning Stock Service should create stock cards by the trade item, not by Lots), there will be zero lots coming back from this endpoint. The endpoint GET /api/lots?tradeItemID=1234&active=true would return a 200 with empty response object {}. We don't return a 404 NOT FOUND for these situations.

Permissions

For now, the ability to GET lots is based on the same permissions as ability to get the trade items, namely ORDERABLES_MANAGE permission. And the ability to POST and PUT lots is based on ORDERABLES_MANAGE permission. This is a global, sysadmin permission—it applies to all programs and facilities with no granular rights at this time.

...

For now, we expect the Stock Management UI will not need to hit the Lot endpoints directly. We expect the UI would query the Stock service, and the Stock service would provide the data including LotCode and ExpirationDate which it gets from the ReferenceData service. This is the pattern already used for the Requisition UI to query the Requisition Service to get Orderables data. The Orderables and Lots endpoints require administrative permissions that most end-users filling out a requisition or a stock inventory would not have.

Impact to Existing Endpoints

None. This work involves adding new endpoints into ReferenceData (referencedata-3.1.0), but does not change or break any existing endpoints. In particular, TradeItems endpoints already in ReferenceData would not return and Lot information inside them.

Process to Manage Lots

  1. Lot Management UI screens (view, create, update) - within the Products admin area, in the TradeItem record, some section or modal to see the current Lots and to update any one of them, or add a new Lot
  2. CSV uploads (desired)

Roles and Responsibilities

  • Reference Data API Endpoints
    • Teams TOP/AYIC to implement Lot Management endpoints in Reference Data 3.1.0
  • Lot Management UI screens (in ReferenceData UI)
    • Team ILL to design Lot Management UI screens
    • Teams TOP/AYIC to implement UI screens (maybe, pending budget/time priorities)
  • Stock Management Service and UI
    • Team Panda is designing and implementing UI and stock endpoints (based on stock workshop scope for ref-distro 3.1 release)

Future Functionality (not in 3.1 scope)

  • Audit Log: ability to see the history of when a Lot was created, edited (when and by whom), de-activated. The would show us the life-cycle of each Lot. To our knowledge, this feature is not captured in the current Roadmap; it's just an idea.
  • CSV uploads (we have other tickets in Roadmap for CSV uploads, but uploading Lots are not yet their own ticket)
  • Potentially look into allowing allowing end users to add in lots/tradeItems. 3.1 aims to achieve lot management centrally.

Process to Configure Lot feature

Why we need lot feature?

Lot feature provides two new piece of data: lot number and expiry date. 

...

When the lot feature is on then system administrator must input all lots and ensure the trade item SOH quantity are correctly break down to lot level. For example, there is a trade item A and its SOH is 100 when lot feature is off. Later when system administrator turn on the lot feature then he inputs lot1, lot2, lot3 under trade item A. End user cannot make new stock events unless they break the quantity of trade item A into these three lots correctly. Meaning, the SOH summary of lot1, lot2, lot3 must equal to 100 (the SOH of tradeitem A). After the trade item A is break down to lot level then the stock card of trade item A will be deactivated and end users are only allowed to create new stock events of lot1,lot2,lot3 stock cards. 

Option 4: Like Option 1 with easier UI (suggested by Brandon)

This part is same as Option 1: "The lot feature is always on but the system allows end users to choose either tradeitem or lot to create stock event. In other words, we provide the lot function to user but we leave the validation to end users as well."

...