@flowselections/pick-schermen-kwekers 1.0.29 → 1.0.30
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/dist-lib/components/pick/PickScherm.d.ts.map +1 -1
- package/dist-lib/components/pick/PickScherm.js +23 -17
- package/dist-lib/integrations/supabase/types.d.ts +10 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/__tests__/pickStatusRef.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/pickStatusRef.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/pickStatusRef.test.js +65 -0
- package/dist-lib/lib/pickCartResults.d.ts +2 -0
- package/dist-lib/lib/pickCartResults.d.ts.map +1 -1
- package/dist-lib/lib/pickCartResults.js +11 -0
- package/dist-lib/lib/pickTypes.d.ts +6 -0
- package/dist-lib/lib/pickTypes.d.ts.map +1 -1
- package/dist-lib/lib/pickTypes.js +24 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PickScherm.d.ts","sourceRoot":"","sources":["../../../src/components/pick/PickScherm.tsx"],"names":[],"mappings":"AAqCA,OAAO,
|
|
1
|
+
{"version":3,"file":"PickScherm.d.ts","sourceRoot":"","sources":["../../../src/components/pick/PickScherm.tsx"],"names":[],"mappings":"AAqCA,OAAO,EAWL,KAAK,WAAW,EACjB,MAAM,qBAAqB,CAAC;AA2C7B,UAAU,KAAK;IACb,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAwBD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,+BA80DpD"}
|
|
@@ -10,9 +10,9 @@ import { ShippingNoteScan } from "./ShippingNoteScan";
|
|
|
10
10
|
import { getSessionId, pickApi } from "../../lib/pickApi";
|
|
11
11
|
import { sendLogisticsEvent } from "../../lib/logisticsApi";
|
|
12
12
|
import { completeLogisticsTaskForItem } from "../../lib/pickPrint";
|
|
13
|
-
import { isPdfOnlyFailure, pickReadiness, printedCartIdsOf, pdfSaveWarning, unitRefOf, unitTitleOf, } from "../../lib/pickTypes";
|
|
13
|
+
import { isPdfOnlyFailure, pickReadiness, printedCartIdsOf, pdfSaveWarning, unitRefOf, statusRefOf, unitTitleOf, } from "../../lib/pickTypes";
|
|
14
14
|
import { rowFingerprint, rowsToVerify } from "../../lib/pickVerify";
|
|
15
|
-
import { CART_MISSING_MESSAGE, cartResultLine, cartsForRow, isCartMissingError, reprintCartsIndividually, resettableJobs, runExclusive, resultsFromBatch, resultsFromBatchError, summarizeCartResults, trackableJobs, } from "../../lib/pickCartResults";
|
|
15
|
+
import { alreadyPrintedResults, CART_MISSING_MESSAGE, cartResultLine, cartsForRow, isCartMissingError, reprintCartsIndividually, resettableJobs, runExclusive, resultsFromBatch, resultsFromBatchError, summarizeCartResults, trackableJobs, } from "../../lib/pickCartResults";
|
|
16
16
|
import { getPickTranslator } from "../../lib/pickI18n";
|
|
17
17
|
import { friendlyPickError, getPickUiTexts } from "../../lib/pickUiText";
|
|
18
18
|
import { getPrintJobTexts, printJobStatusLabel } from "../../lib/pickPrintJobText";
|
|
@@ -26,6 +26,15 @@ const LANG_STORAGE_KEY = "pick.language";
|
|
|
26
26
|
/** Melding als de planning voor deze order geen karren heeft vastgelegd. */
|
|
27
27
|
/** Papier is geprint, maar de PDF-kopie op de werkplek is niet opgeslagen. */
|
|
28
28
|
const PDF_SAVE_NOTICE = "De pakbon is geprint, maar de PDF is niet op de werkplek opgeslagen. Geef de PDF-map in Layout maker opnieuw vrij.";
|
|
29
|
+
/** Geeft een claim vrij zonder de actie te laten mislukken; de heartbeat ruimt anders op. */
|
|
30
|
+
async function releaseQuietly(itemId) {
|
|
31
|
+
try {
|
|
32
|
+
await pickApi.releaseLock(itemId);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
/* heartbeat ruimt de lock alsnog op */
|
|
36
|
+
}
|
|
37
|
+
}
|
|
29
38
|
/** Melding als de regel nog niet compleet is aangeleverd door de bron. */
|
|
30
39
|
const NOT_READY_NOTICE = "Deze pakbon is nog niet printklaar. Klik op \"Pakbon ophalen\" om de ontbrekende gegevens bij de bron op te vragen.";
|
|
31
40
|
/**
|
|
@@ -232,7 +241,7 @@ export function PickScherm({ station, onBack }) {
|
|
|
232
241
|
*/
|
|
233
242
|
const loadCartPlan = useCallback(async (item) => {
|
|
234
243
|
const plan = await pickApi.queueCartPlan(item.id);
|
|
235
|
-
const ref =
|
|
244
|
+
const ref = statusRefOf(item, plan);
|
|
236
245
|
let status = null;
|
|
237
246
|
try {
|
|
238
247
|
status = ref ? await pickApi.cartPlanStatus(ref) : null;
|
|
@@ -281,7 +290,7 @@ export function PickScherm({ station, onBack }) {
|
|
|
281
290
|
running = true;
|
|
282
291
|
const next = {};
|
|
283
292
|
try {
|
|
284
|
-
const results = await pickApi.verifyRows(todo.map((item) => ({ id: item.id, ref:
|
|
293
|
+
const results = await pickApi.verifyRows(todo.map((item) => ({ id: item.id, ref: statusRefOf(item) })));
|
|
285
294
|
const byId = new Map(results.map((r) => [r.id, r]));
|
|
286
295
|
const now = Date.now();
|
|
287
296
|
for (const item of todo) {
|
|
@@ -358,8 +367,9 @@ export function PickScherm({ station, onBack }) {
|
|
|
358
367
|
await new Promise((resolve) => setTimeout(resolve, 3000));
|
|
359
368
|
const plan = await pickApi.queueCartPlan(item.id);
|
|
360
369
|
let status = null;
|
|
370
|
+
const statusRef = statusRefOf(item, plan);
|
|
361
371
|
try {
|
|
362
|
-
status =
|
|
372
|
+
status = statusRef ? await pickApi.cartPlanStatus(statusRef) : null;
|
|
363
373
|
}
|
|
364
374
|
catch {
|
|
365
375
|
status = null;
|
|
@@ -621,6 +631,7 @@ export function PickScherm({ station, onBack }) {
|
|
|
621
631
|
setPending(target);
|
|
622
632
|
if (!plan || !state.ready) {
|
|
623
633
|
toast.warning(state.reason ?? NOT_READY_NOTICE);
|
|
634
|
+
await releaseQuietly(target.id);
|
|
624
635
|
await requestData(target);
|
|
625
636
|
return;
|
|
626
637
|
}
|
|
@@ -809,6 +820,9 @@ export function PickScherm({ station, onBack }) {
|
|
|
809
820
|
if (!plan || !readiness.ready) {
|
|
810
821
|
// Niet printklaar: nooit printen, altijd eerst de gegevens opvragen.
|
|
811
822
|
toast.warning(readiness.reason ?? NOT_READY_NOTICE);
|
|
823
|
+
// Geweigerd: claim vrijgeven, zodat de rij niet op "Wordt geprint" blijft.
|
|
824
|
+
await releaseQuietly(item.id);
|
|
825
|
+
refresh();
|
|
812
826
|
await requestData(item);
|
|
813
827
|
return;
|
|
814
828
|
}
|
|
@@ -824,18 +838,10 @@ export function PickScherm({ station, onBack }) {
|
|
|
824
838
|
const already = printedCartIdsOf(item);
|
|
825
839
|
const todo = rowCarts.filter((cart) => !already.includes(cart.cartId));
|
|
826
840
|
if (todo.length === 0) {
|
|
827
|
-
// Alles al geprint:
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
setLastPrinted(item);
|
|
832
|
-
startBatchTracking(item, results);
|
|
833
|
-
showCartResults(results);
|
|
834
|
-
refresh();
|
|
835
|
-
}
|
|
836
|
-
finally {
|
|
837
|
-
setBusyId(null);
|
|
838
|
-
}
|
|
841
|
+
// Alles al geprint: geen opdracht. Herprinten alleen via de knop Herprint.
|
|
842
|
+
showCartResults(alreadyPrintedResults(rowCarts));
|
|
843
|
+
await releaseQuietly(item.id);
|
|
844
|
+
refresh();
|
|
839
845
|
return;
|
|
840
846
|
}
|
|
841
847
|
setBusyId("confirm");
|
|
@@ -6653,6 +6653,7 @@ export type Database = {
|
|
|
6653
6653
|
dead_lettered_at: string | null;
|
|
6654
6654
|
desired_available: boolean | null;
|
|
6655
6655
|
gateway_attempt_id: string | null;
|
|
6656
|
+
gateway_unreachable_since: string | null;
|
|
6656
6657
|
id: string;
|
|
6657
6658
|
last_error: string | null;
|
|
6658
6659
|
locked_at: string | null;
|
|
@@ -6680,6 +6681,7 @@ export type Database = {
|
|
|
6680
6681
|
dead_lettered_at?: string | null;
|
|
6681
6682
|
desired_available?: boolean | null;
|
|
6682
6683
|
gateway_attempt_id?: string | null;
|
|
6684
|
+
gateway_unreachable_since?: string | null;
|
|
6683
6685
|
id?: string;
|
|
6684
6686
|
last_error?: string | null;
|
|
6685
6687
|
locked_at?: string | null;
|
|
@@ -6707,6 +6709,7 @@ export type Database = {
|
|
|
6707
6709
|
dead_lettered_at?: string | null;
|
|
6708
6710
|
desired_available?: boolean | null;
|
|
6709
6711
|
gateway_attempt_id?: string | null;
|
|
6712
|
+
gateway_unreachable_since?: string | null;
|
|
6710
6713
|
id?: string;
|
|
6711
6714
|
last_error?: string | null;
|
|
6712
6715
|
locked_at?: string | null;
|
|
@@ -8902,6 +8905,8 @@ export type Database = {
|
|
|
8902
8905
|
queue_cleanup_batch: number;
|
|
8903
8906
|
queue_cleanup_max_batches: number;
|
|
8904
8907
|
queue_failed_days: number;
|
|
8908
|
+
queue_gateway_backoff_minutes: number[];
|
|
8909
|
+
queue_gateway_give_up_hours: number;
|
|
8905
8910
|
queue_sent_days: number;
|
|
8906
8911
|
queue_skipped_days: number;
|
|
8907
8912
|
queue_superseded_days: number;
|
|
@@ -8920,6 +8925,8 @@ export type Database = {
|
|
|
8920
8925
|
queue_cleanup_batch?: number;
|
|
8921
8926
|
queue_cleanup_max_batches?: number;
|
|
8922
8927
|
queue_failed_days?: number;
|
|
8928
|
+
queue_gateway_backoff_minutes?: number[];
|
|
8929
|
+
queue_gateway_give_up_hours?: number;
|
|
8923
8930
|
queue_sent_days?: number;
|
|
8924
8931
|
queue_skipped_days?: number;
|
|
8925
8932
|
queue_superseded_days?: number;
|
|
@@ -8938,6 +8945,8 @@ export type Database = {
|
|
|
8938
8945
|
queue_cleanup_batch?: number;
|
|
8939
8946
|
queue_cleanup_max_batches?: number;
|
|
8940
8947
|
queue_failed_days?: number;
|
|
8948
|
+
queue_gateway_backoff_minutes?: number[];
|
|
8949
|
+
queue_gateway_give_up_hours?: number;
|
|
8941
8950
|
queue_sent_days?: number;
|
|
8942
8951
|
queue_skipped_days?: number;
|
|
8943
8952
|
queue_superseded_days?: number;
|
|
@@ -27626,6 +27635,7 @@ export type Database = {
|
|
|
27626
27635
|
dead_lettered_at: string | null;
|
|
27627
27636
|
desired_available: boolean | null;
|
|
27628
27637
|
gateway_attempt_id: string | null;
|
|
27638
|
+
gateway_unreachable_since: string | null;
|
|
27629
27639
|
id: string;
|
|
27630
27640
|
last_error: string | null;
|
|
27631
27641
|
locked_at: string | null;
|