Jeppe B
6475f817c7
fix(api): wire order_item_reason_policy into POST/PUT and persist reason fields ( #345 )
...
Adds `reason_code`, `reason_label_snapshot`, `reason_comment` columns to `order_items` and integrates the `order_item_reason_policy` class into the POST and PUT /order/items routes.
Validation order on audited products (consistent across POST and PUT):
1. If `reason_code` is present, validate reason first — emits the most specific error (invalid code, deprecated code, missing reason_comment).
2. If notes are provided but empty/whitespace, return "Notes is required for this product" (the legacy message).
3. Otherwise run reason validation — covers the missing-reason_code case.
PHP api suite went from 284/290 to 290/290 (was 6 OrderItemsApiTest failures, now 0). Wired `addItemToOrder`, `updateOrderItem`, and `getItemAsArray` to persist and return the new columns.
2026-08-09 17:53:00 +02:00
..
2026-07-22 19:22:17 +02:00
2026-07-17 05:44:16 +02:00
2026-08-02 11:50:56 +02:00
2026-08-04 16:04:41 +02:00
2026-08-04 16:04:41 +02:00
2026-08-04 16:04:41 +02:00
2026-08-04 16:04:41 +02:00
2026-08-04 16:04:41 +02:00
2026-08-09 00:21:04 +02:00
2026-05-07 10:44:00 +02:00
2026-08-04 16:04:41 +02:00
2025-02-20 14:33:42 +01:00
2026-07-14 15:39:39 +02:00
2026-07-16 11:50:52 +02:00
2025-02-20 14:33:42 +01:00
2026-08-04 16:04:41 +02:00
2026-08-04 16:04:41 +02:00
2025-10-07 23:41:57 +02:00
2026-08-04 16:04:41 +02:00
2026-07-13 15:11:49 +02:00
2026-08-04 16:04:41 +02:00
2026-03-26 13:16:18 +01:00
2026-03-19 15:59:25 +01:00
2026-06-09 14:48:46 +02:00
2026-08-04 16:04:41 +02:00
2026-03-25 17:54:41 +01:00
2026-03-25 17:54:41 +01:00
2026-03-25 17:54:41 +01:00
2026-03-16 11:36:48 +01:00
2026-03-25 17:54:41 +01:00
2026-06-01 23:52:18 +02:00
2026-06-01 22:48:14 +02:00
2026-07-13 15:11:49 +02:00
2026-08-04 16:04:41 +02:00
2026-08-04 16:04:41 +02:00
2026-08-05 14:44:40 +02:00
2025-02-20 14:33:42 +01:00
2026-04-01 17:44:25 +02:00
2026-04-24 15:51:09 +02:00
2026-04-24 15:51:09 +02:00
2026-05-19 13:17:07 +02:00
2026-07-17 05:44:16 +02:00
2025-09-23 16:04:35 +02:00
2026-06-29 14:25:51 +02:00
2026-07-22 19:22:17 +02:00
2025-12-10 14:22:37 +01:00
2026-08-03 13:03:55 +02:00
2026-08-02 11:50:56 +02:00
2026-04-29 09:52:51 +02:00
2026-08-04 16:04:41 +02:00
2026-07-13 10:08:00 +02:00
2026-06-29 11:32:47 +02:00
2026-08-04 16:04:41 +02:00
2026-08-04 16:04:41 +02:00
2026-04-24 15:51:09 +02:00
2026-08-04 16:04:41 +02:00
2026-08-04 16:04:41 +02:00
2025-04-10 10:51:32 +02:00
2026-08-04 16:04:41 +02:00
2026-08-04 16:04:41 +02:00
2026-08-04 16:04:41 +02:00
2026-06-12 21:42:36 +02:00
2026-08-04 16:04:41 +02:00
2026-08-04 16:04:41 +02:00
2026-07-14 15:39:39 +02:00
2026-08-04 16:04:41 +02:00
2026-08-04 16:04:41 +02:00
2026-08-04 16:04:41 +02:00
2026-08-04 16:04:41 +02:00
2026-08-04 16:04:41 +02:00
2026-05-26 16:35:02 +02:00
2026-08-04 16:04:41 +02:00
2026-08-04 16:04:41 +02:00
2026-08-09 17:53:00 +02:00
2026-04-14 10:51:25 +02:00
2026-08-04 16:04:41 +02:00
2026-02-03 11:43:56 +01:00
2026-08-04 16:04:41 +02:00
2026-07-17 05:44:16 +02:00
2026-08-04 16:04:41 +02:00
2026-05-27 17:35:16 +02:00
2026-08-04 16:04:41 +02:00
2026-08-02 11:50:56 +02:00
2026-08-04 16:04:41 +02:00
2025-03-07 12:29:45 +01:00
2026-08-04 16:04:41 +02:00
2026-08-03 16:11:09 +02:00
2026-08-04 16:04:41 +02:00
2025-02-20 14:33:42 +01:00
2026-08-02 11:50:56 +02:00
2026-02-11 17:13:25 +01:00
2026-08-04 16:04:41 +02:00
2026-05-20 16:45:50 +02:00
2026-07-16 11:50:52 +02:00
2026-07-08 09:35:40 +02:00
2026-07-13 10:08:00 +02:00
2026-07-13 10:08:00 +02:00
2026-04-08 19:01:42 +02:00
2026-08-02 11:50:56 +02:00
2025-08-18 16:50:30 +02:00
2026-08-04 16:04:41 +02:00
2026-08-04 16:04:41 +02:00
2025-02-20 14:33:42 +01:00
2026-07-07 18:59:07 +02:00
2026-08-04 16:04:41 +02:00
2026-07-06 22:28:45 +00:00
2026-02-12 15:52:37 +01:00
2026-08-02 11:50:56 +02:00
2026-08-04 16:04:41 +02:00
2025-09-01 10:11:37 +02:00
2026-08-04 16:04:41 +02:00
2026-08-09 00:21:04 +02:00
2025-02-20 14:33:42 +01:00
2026-08-04 16:04:41 +02:00
2026-08-04 17:46:15 +02:00