# Features — magalies-pharma-heisenberg-print-server

Evidence date: 2026-10-09. Source: `git@bitbucket.org:overdrive/magalies-pharma-heisenberg-print-server.git`, `master` at `07aa3df` (2022-10-19).

No features file existed in the repository or in Silicon Ark. "Current" means the behaviour is in `master` at `07aa3df`. It does not mean a printer is attached or that a client still calls the process.

## Current features

| Feature | Status | Where |
|---|---|---|
| Express server on port 3000 | Current | `server.js` `app.listen(port)` |
| `GET /` identity string | Current since `ea73a4b` | `server.js` |
| JSON body parsing | Current | `bodyParser.json()` |
| CORS middleware with default options | Current | `app.use(cors())` |
| `POST /barcode` | Current | `server.js` |
| `POST /label` | Current | `server.js` |
| Queue `Barcode-Printer` for barcodes | Current since `231ccd3` (2022-10-19) | `server.js` |
| Queue `Small-Label-Printer` when `size == 'small'` | Current since `231ccd3` | `server.js` |
| Queue `Big-Label-Printer` for every other label size | Current since `231ccd3` | `server.js` |
| Batch QR `{batch_number}-{four digits}` | Current | `print.js` `printBarcode` |
| Medicine QR `{medicine_number}-{four digits}` | Current since `a3fdeb9` (2022-10-19) | `print.js` `printLabel` |
| Falsy `starting_number` becomes 1 | Current | both routes in `server.js` |
| One `printDirect` per HTTP request | Current. Label path since `16e84dc` | `print.js` |
| Each rendered copy sets template `quantity` to 1 | Current | `print.js` |
| RAW print type | Current | `printDirect` `type: "RAW"` |
| Batch ZPL template | Current | `templates/barcodes.zpl` |
| Standard medicine ZPL template | Current | `templates/labels.zpl` |
| Small medicine ZPL template | Current | `templates/labels_small.zpl` |
| QR field data with leading commas | Current. Commas added in `593ccfa` so the payload is not read as ZPL mode switches. Later commits set magnification `3` and a third comma | all three templates, `^FD,,,{{barcode}}` |
| Standard label text: directions, client, Rx number, prescriber, quantity, date | Current since `a44f442`, layout edited again the same day | `templates/labels.zpl` |
| Small label text: description, client, Rx number, quantity, prescriber, date | Current | `templates/labels_small.zpl` |
| Barcode failure JSON `{ "message": "Printing failed" }` | Current | `server.js` `POST /barcode` `catch` |
| Success JSON `Printing barcodes` / `Printing labels` | Current | `server.js` |
| Request field `description` | Current since `07aa3df` | `server.js`, `print.js` |
| npm dependencies locked | Current | `package-lock.json` lockfileVersion 2 |

## Changed on the last day of commits (2022-10-19)

These are the last behaviour changes in git. They are current, not planned.

| Change | Commit | What changed |
|---|---|---|
| Printer queue names | `231ccd3` | `XP-TT426B` became `Small-Label-Printer`. Both `XP-TT426B-2` uses became `Barcode-Printer` and `Big-Label-Printer` |
| Body field names | `a44f442` | `/barcode` field `barcode` became `batch_number`. `/label` fields `barcode` and `batch_number` became `medicine_number` and `order_number` |
| Standard label copy | `a44f442` | `Dispensed By:{{dispensed_by}}` replaced by prescriber and date. Rx number bound to `order_number` |
| Print loop | `16e84dc` | `printLabel` no longer called `printDirect` inside the loop |
| Medicine code dash | `a3fdeb9` | `{medicine_number}{suffix}` became `{medicine_number}-{suffix}` |
| Description field | `07aa3df` | `label_description` became `description` on both routes and both print functions |

The same day also contains many commits titled "updated medicine label heading" and "fixed bq size". They edit coordinates, font commands, and QR magnification in the ZPL files. The files at `07aa3df` are the result.

## Removed

| Feature | When | Evidence |
|---|---|---|
| Handlebars templates `templates/barcodes.hbs` and `templates/labels.hbs` | Replaced in `4ef494e` (2022-07-26) by `.zpl` files. `templates/labels.hbs` deleted. `barcodes.hbs` renamed | git log |
| Single label printer for every label | Replaced in `f9a9c98` (2022-10-12) by the `size` branch | `server.js` |
| Queue names `XP-TT426B` and `XP-TT426B-2` | Replaced in `231ccd3` | `server.js`. Earlier `07f6024` had used `Xprinter XP-TT426B` |
| `printDirect` inside the label loop | Removed in `16e84dc` | `print.js` |
| Printed `Dispensed By` line | Removed from `templates/labels.zpl` in `a44f442` | The route still reads `dispensed_by` |
| JSON field `label_description` | Renamed in `07aa3df` | `server.js` |
| Medicine QR without a dash | Lasted between `a44f442` and `a3fdeb9` on 2022-10-19 | `print.js` |

`POST /label` has never had a `catch` in the history inspected. That is an absence, not a removed feature.

## Not features of this repository

| Item | Why it is listed |
|---|---|
| Login or roles | No auth code |
| Choosing a printer name in the JSON body | Names are constants |
| Calling the Heisenberg HTTP API | No outbound client |
| Saving a print job | No database or log file |
| Automated tests | `npm test` exits 1 |
| `index.js` entry | Named in `package.json` `main` and not present |
| Sonar scanner project file | Named by the onboarding scan, absent from git |
| Deploy pipeline | No pipeline file |

## Planned

No TODO, issue export, or roadmap in the repository describes unfinished work. Nothing after 2022-10-19 is **Planned** from evidence in this repo.

## In development

No branch other than `master` is on the Bitbucket remote. `testing/local` appears only as a merge source on CodeCommit in `f22c5fc` (2022-10-12) and is not a current branch here.
