@crvouga/mockingbird-service-junction 3.3.1 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog — @crvouga/mockingbird-service-junction
2
2
 
3
+ ## 3.5.0 (2026-10-16)
4
+
5
+ ### Features
6
+
7
+ - resolve SQL, routing and writer gaps ([73f97d0](https://github.com/crvouga/mockingbird/commit/73f97d0d2379f44b9131180498f4fab76648fed9))
8
+
9
+ ## 3.4.0 (2026-10-15)
10
+
11
+ ### Features
12
+
13
+ - finish durable run lifecycle ([725ea1a](https://github.com/crvouga/mockingbird/commit/725ea1a966dac65434e98f06a9c33aca0d6f32d7))
14
+ - add management and portable archives ([0d2a6dd](https://github.com/crvouga/mockingbird/commit/0d2a6dd0f9fecb3a1ea7c1638f6639787395c2f4))
15
+
16
+ ### Fixes and improvements
17
+
18
+ - correlate cross-namespace operations ([3457a4b](https://github.com/crvouga/mockingbird/commit/3457a4b7dbfd9ad9c8a10671a5744b7c8425d000))
19
+ - harden HTTP stream handling ([674307a](https://github.com/crvouga/mockingbird/commit/674307a869f57907567d462c4f506c3b0a237e13))
20
+
3
21
  ## 3.3.1 (2026-10-15)
4
22
 
5
23
  ### Fixes and improvements
package/DISCOVERY.md CHANGED
@@ -41,6 +41,8 @@ repository; live parity is an additional oracle check, not a substitute for the
41
41
  - `GET /__admin/metrics`
42
42
  - `GET /__admin/faults/presets`
43
43
  - `GET /__admin/ui`
44
+ - `GET/PUT /__admin/lab-account-omission-policies`
45
+ - `GET/PUT /__admin/requisitions/:id`
44
46
 
45
47
  For HTTP services, use `x-mockingbird-namespace` (or the documented credential/path carrier) so
46
48
  parallel tests do not share state. Admin state, journal, metrics and fault-preset endpoints are
package/README.md CHANGED
@@ -330,23 +330,31 @@ invented.
330
330
 
331
331
  ## Lab accounts
332
332
 
333
- `create_order` routes, accepts and rejects `lab_account_id` against the team's lab accounts, the
334
- way the sandbox does: an explicit id must exist, be linked to the team and be active; with no id,
335
- one active account for the lab is selected, several select the first listed, and a lab with none
336
- falls back to Junction's platform account. The billing type must be allowed in the patient's
337
- state by the account's `allowed_billing`.
338
-
339
- Two of Junction's documented rules are **not** enforced by the sandbox, so the emulator does not
340
- enforce them either. An id naming another lab's account is accepted and the order is placed with
341
- that account (the guide says it must be "associated with the lab selected for the order"):
342
- recorded in `corpus/lab-account-probes.json`, where a Labcorp test ordered through Junction's
343
- BioReference account was placed, and reported live by a consumer's team
344
- ([#138](https://github.com/crvouga/mockingbird/issues/138)). An omitted id while several active
345
- accounts are linked for the lab places the order (the guide says it "may be rejected"): reported
346
- live by a consumer's team ([#136](https://github.com/crvouga/mockingbird/issues/136)); the
347
- sandbox team the parity run uses has one account per lab, so `verify --orders` checks it whenever
348
- a corpus has such a lab. Which of the several accounts the sandbox bills through is not visible
349
- from outside; the emulator uses the first listed.
333
+ `create_order` selects explicit linked accounts in either `active` or `ready_to_launch`
334
+ status. With no id, exactly one orderable linked account is selected. Multiple orderable
335
+ accounts use the per-lab `labAccountOmissionPolicies` control (`platform`, the default, or
336
+ `reject`). Platform selection uses an orderable linked account with `org_id: null`, or an
337
+ opaque platform account for a supported platform lab. It never chooses a customer account
338
+ by listing order. With no linked accounts, supported labs use the platform; with linked
339
+ accounts but none orderable, ordering fails. Billing type and patient state are checked
340
+ against the selected account. This follows the
341
+ [Junction guide](https://docs.junction.com/lab/overview/lab-accounts); the choice between
342
+ platform fallback and rejection varies by lab/team, so configure `reject` where appropriate.
343
+ Set `{ labAccountOmissionPolicies: { bioreference: "platform" } }` at runtime creation, or
344
+ `PUT /__admin/lab-account-omission-policies` with `{ "policies": { "bioreference": "reject" } }`.
345
+ `GET` reads the effective overrides. Overrides are namespace isolated and kept across reset.
346
+
347
+ Explicit ids naming another lab's account remain accepted, matching the sandbox probe in
348
+ `corpus/lab-account-probes.json` and [#138](https://github.com/crvouga/mockingbird/issues/138).
349
+ Delegation alone does not change account selection.
350
+
351
+ Requisition PDFs are synthetic and contain labelled `Account number:` evidence copied from
352
+ the selected account's `provider_account_id` **when the order is created**. Later account edits,
353
+ reordering or routing changes cannot change that evidence. Opaque platform accounts show
354
+ `unknown`. Use `GET /__admin/requisitions/:id` to inspect it, or `PUT` with
355
+ `{ "provider_account_id": "MOCK-CUSTOMER" }` (or `null` for explicitly unknown evidence) to
356
+ install a namespace-isolated fixture. Reset removes the orders and their requisition fixtures.
357
+ This models account evidence, not a vendor's exact PDF layout or proof of a real association.
350
358
 
351
359
  Junction's order (`ClientFacingOrder`) has no `lab_account_id`, so neither does the emulator's: not on
352
360
  the create response, `GET /v3/order/{id}`, `GET /v3/orders` or webhooks. The account an order was
@@ -705,8 +713,8 @@ An emulator that is silent about its gaps is how a green suite starts lying. Spe
705
713
  accounts is not reproduced. Run `verify --orders` with your team's corpus to check what you rely on.
706
714
  - Rate limits and outages, except when injected as faults or switched on as
707
715
  [limits](#sandbox-limits).
708
- - Which of several active accounts for a lab the sandbox bills an order through when
709
- `lab_account_id` is omitted (see [Lab accounts](#lab-accounts)); the emulator uses the first listed.
716
+ - Lab/team-specific omission defaults must be configured through `labAccountOmissionPolicies`
717
+ (see [Lab accounts](#lab-accounts)); exact vendor requisition layout is not modelled.
710
718
  - Adopted users (`adopt-users`) have `client_user_id` equal to their `user_id`; nothing in
711
719
  Junction corresponds to adoption.
712
720
  - Real 429 / 5xx bodies: the presets are plausible, not recorded.
package/SUPPORT.md CHANGED
@@ -44,7 +44,7 @@ Generated from `openapi.yaml`; do not edit by hand.
44
44
  | `get_result_raw_v3_order__order_id__result_get` | `GET /v3/order/{order_id}/result` | ✅ supported | ❌ disabled | results carry provider-side specimen data; covered by the emulator-internal results property suite instead |
45
45
  | `get_result_metadata_v3_order__order_id__result_metadata_get` | `GET /v3/order/{order_id}/result/metadata` | ✅ supported | ✅ | |
46
46
  | `get_result_pdf_v3_order__order_id__result_pdf_get` | `GET /v3/order/{order_id}/result/pdf` | ✅ supported | ❌ disabled | PDF bytes are provider-rendered; compared by shape (byteLength) only in the scenario script |
47
- | `get_order_requisition_pdf_v3_order__order_id__requisition_pdf_get` | `GET /v3/order/{order_id}/requisition/pdf` | ✅ supported | ❌ disabled | PDF bytes are provider-rendered; compared by shape (byteLength) only in the scenario script |
47
+ | `get_order_requisition_pdf_v3_order__order_id__requisition_pdf_get` | `GET /v3/order/{order_id}/requisition/pdf` | ✅ supported | ❌ disabled | Synthetic PDF includes persisted selected provider account number or unknown; admin evidence override supported; live comparison remains shape-only |
48
48
  | `get_orders_v3_orders_get` | `GET /v3/orders` | ✅ supported | ✅ | |
49
49
  | `get_order_transaction_v3_order_transaction__transaction_id__get` | `GET /v3/order_transaction/{transaction_id}` | ✅ supported | ❌ disabled | order transactions are not available to the sandbox team (feature not available) |
50
50
  | `get_order_transaction_result_v3_order_transaction__transaction_id__result_get` | `GET /v3/order_transaction/{transaction_id}/result` | ✅ supported | ❌ disabled | lab results are not available to the sandbox team (feature not available) |