|
| 1 | +# Supplier Reports CLI |
| 2 | + |
| 3 | +A command-line tool for generating HTML reports for NHS Notify suppliers showing their assigned pack specifications. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +This package is part of the nhs-notify-supplier-config monorepo. Install dependencies from the root: |
| 8 | + |
| 9 | +```bash |
| 10 | +npm install |
| 11 | +``` |
| 12 | + |
| 13 | +## Usage |
| 14 | + |
| 15 | +```bash |
| 16 | +# Generate HTML reports for all suppliers |
| 17 | +npm run cli -- report -f specs.xlsx -o ./reports |
| 18 | + |
| 19 | +# Exclude draft packs from reports |
| 20 | +npm run cli -- report -f specs.xlsx -o ./reports --exclude-drafts |
| 21 | + |
| 22 | +# Generate a blank Excel template |
| 23 | +npm run cli -- template -o specs.template.xlsx |
| 24 | + |
| 25 | +# Force overwrite existing template |
| 26 | +npm run cli -- template -o specs.template.xlsx --force |
| 27 | +``` |
| 28 | + |
| 29 | +### Commands |
| 30 | + |
| 31 | +#### `report` |
| 32 | + |
| 33 | +Generate HTML reports per supplier showing assigned pack specifications. |
| 34 | + |
| 35 | +| Option | Alias | Description | Default | |
| 36 | +|--------|-------|-------------|---------| |
| 37 | +| `--file` | `-f` | Excel file path | specifications.xlsx | |
| 38 | +| `--out` | `-o` | Output directory for HTML reports | ./supplier-reports | |
| 39 | +| `--exclude-drafts` | | Exclude supplier packs with DRAFT approval status | false | |
| 40 | + |
| 41 | +#### `template` |
| 42 | + |
| 43 | +Generate a blank Excel template with all required sheets and columns. |
| 44 | + |
| 45 | +| Option | Alias | Description | Default | |
| 46 | +|--------|-------|-------------|---------| |
| 47 | +| `--out` | `-o` | Output .xlsx file path | specifications.template.xlsx | |
| 48 | +| `--force` | `-F` | Overwrite existing file if present | false | |
| 49 | + |
| 50 | +## Report Features |
| 51 | + |
| 52 | +Each supplier report includes: |
| 53 | + |
| 54 | +- Supplier information (ID, name, channel type, daily capacity, status) |
| 55 | +- Volume group allocations with percentages |
| 56 | +- Summary cards showing pack counts by status |
| 57 | +- Table of contents with quick navigation |
| 58 | +- Detailed pack specifications including: |
| 59 | + - Basic information |
| 60 | + - Postage details |
| 61 | + - Constraints |
| 62 | + - Assembly specifications |
| 63 | + - Paper details |
| 64 | + |
| 65 | +## Dependencies |
| 66 | + |
| 67 | +- `@nhs-notify/excel-parser` - For parsing Excel files |
0 commit comments