A mérendő tétel fizetési tilalma a valós állapotot írja le
A szűrő szakasza eddig működő védelmet dokumentált: az IsPendingMeasurementAsync egy már nem írt Order-szintű IsMeasurable attribútumot olvas - az OrderDto.IsMeasurable a tételekből származtatott, nem tárolt érték -, ezért a predikátum mindig false. Vevői checkout ma nincs; a jövőbeli csak lemért, Audited rendelésre engedhet fizetést. Szándékosan nem javítjuk, amíg a checkout meg nem születik. A mérésindítás lépéséből kikerült a téves státusz-állítás, helyette a Started értesítő szerepel.
This commit is contained in:
@@ -73,7 +73,7 @@ OrderDto (order)
|
||||
|
||||
1. **Start Measuring** — `CustomOrderSignalREndpoint.StartMeasuring(orderId, userId)`
|
||||
- Sets `MeasurementOwnerId` via GenericAttribute
|
||||
- Order status set to Processing, Payment to Pending
|
||||
- Sends the "order started" customer notification — see [`NOTIFICATION/README.md`](NOTIFICATION/README.md)
|
||||
- Broadcasts `SendOrderChanged`
|
||||
2. **Weigh pallets** — `CustomOrderSignalREndpoint.AddOrUpdateMeasuredOrderItemPallet()`
|
||||
- Same weight formula as shipping
|
||||
@@ -100,16 +100,20 @@ valid = percentage < ProductDto.AverageWeightTreshold
|
||||
|
||||
`OrderDto.IsAllOrderItemAvgWeightValid` = all items pass this check.
|
||||
|
||||
### PendingMeasurementCheckoutFilter
|
||||
### Payment and the measurable item
|
||||
|
||||
ASP.NET Core action filter on the Checkout `ConfirmOrder` action.
|
||||
**An order containing a measurable item cannot be paid** — the final amount only exists after weighing. There is
|
||||
currently **no customer-facing checkout** in the system; when one is built (a Stripe integration is the plan), it
|
||||
may only accept payment for a measured, `Audited` order.
|
||||
|
||||
| Step | Action |
|
||||
|---|---|
|
||||
| Intercept | `ConfirmOrder` POST in CheckoutController |
|
||||
| Check | `OrderMeasurementService.IsPendingMeasurementAsync()` |
|
||||
| If pending | Set OrderStatus=Processing, PaymentStatus=Pending, redirect to PendingMeasurementWarning |
|
||||
| If not pending | Allow normal checkout flow |
|
||||
`PendingMeasurementCheckoutFilter` is what remains of that guard, and **today it guards nothing**:
|
||||
`OrderMeasurementService.IsPendingMeasurementAsync` reads an order-level `IsMeasurable` GenericAttribute that
|
||||
nobody writes any more — `OrderDto.IsMeasurable` is derived from the items (`OrderItemDtos.Any(oi => oi.IsMeasurable)`)
|
||||
and never stored — so the predicate is always `false`. The filter is bound to `ConfirmOrder`; were it to fire, it
|
||||
would redirect to `PendingMeasurementWarning`, and the `Processing` / `Pending` statuses it sets are not persisted.
|
||||
|
||||
Deliberately left unfixed while there is no customer checkout: the guard becomes part of that checkout when it is
|
||||
written, not of this filter.
|
||||
|
||||
## Workflow 3: StockTaking
|
||||
|
||||
|
||||
Reference in New Issue
Block a user