Skip to content

Documentation on inventory report#123

Open
sonzsara wants to merge 2 commits into
mainfrom
ENG-636
Open

Documentation on inventory report#123
sonzsara wants to merge 2 commits into
mainfrom
ENG-636

Conversation

@sonzsara

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds documentation for an “Inventory Report” query intended to provide a per-location, per-batch inventory snapshot including purchase value and expiry status bucketing.

Changes:

  • Introduces a new markdown query doc for an inventory snapshot report.
  • Documents expiry bucketing logic (Expired / Critical / Warning) and ordering expectations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Care/Inventory/inventory_report_pallium.md
Comment thread Care/Inventory/inventory_report_pallium.md
Comment thread Care/Inventory/inventory_report_pallium.md

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.


## Purpose

Returns a full inventory snapshot with one row per inventory item . Each row shows the stock count, batch number, expiration date, unit purchase price, total purchase value (`stock_count × purchase_price`), and an `expiry_flag` that buckets each batch as **Expired**, **Critical (≤1 month)**, **Warning (≤3 months)**, or normal.
Comment on lines +37 to +40
ORDER BY
fl.name,
pk.name,
expiration_date;
WHEN p.expiration_date <= CURRENT_DATE THEN 'Expired'
WHEN p.expiration_date <= CURRENT_DATE + INTERVAL '1 month' THEN 'Critical - Expires in 1 month'
WHEN p.expiration_date <= CURRENT_DATE + INTERVAL '3 months' THEN 'Warning - Expires in 3 months'
ELSE ''


## Notes
- Results are ordered by location, then stock name.
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