Conversation
There was a problem hiding this comment.
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.
|
|
||
| ## 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.