@mohasinac/appkit 4.60.1 → 4.61.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/dist/.build-stamp.json +3 -3
- package/dist/_internal/server/features/auctions/actions.d.ts +1 -1
- package/dist/_internal/server/features/auctions/actions.js +12 -1
- package/dist/_internal/server/features/blog/actions.d.ts +1 -1
- package/dist/_internal/server/features/blog/actions.js +12 -1
- package/dist/_internal/server/features/brands/actions.d.ts +1 -1
- package/dist/_internal/server/features/brands/actions.js +12 -1
- package/dist/_internal/server/features/cart/actions.d.ts +1 -1
- package/dist/_internal/server/features/cart/actions.js +12 -1
- package/dist/_internal/server/features/checkout/actions.js +0 -1
- package/dist/_internal/server/features/events/actions.d.ts +1 -1
- package/dist/_internal/server/features/events/actions.js +12 -1
- package/dist/_internal/server/features/gateway-events/redact.js +14 -2
- package/dist/_internal/server/features/history/actions.d.ts +1 -1
- package/dist/_internal/server/features/history/actions.js +12 -1
- package/dist/_internal/server/features/lottery/actions.d.ts +1 -1
- package/dist/_internal/server/features/lottery/actions.js +12 -1
- package/dist/_internal/server/features/orders/actions.d.ts +1 -1
- package/dist/_internal/server/features/orders/actions.js +12 -1
- package/dist/_internal/server/features/orders/cancellation-refund.js +0 -1
- package/dist/_internal/server/features/orders/service.js +31 -1
- package/dist/_internal/server/features/payouts/actions.d.ts +1 -1
- package/dist/_internal/server/features/payouts/actions.js +12 -1
- package/dist/_internal/server/features/points/award.js +9 -1
- package/dist/_internal/server/features/pre-orders/actions.d.ts +1 -1
- package/dist/_internal/server/features/pre-orders/actions.js +12 -1
- package/dist/_internal/server/features/prize-draws/actions.d.ts +1 -1
- package/dist/_internal/server/features/prize-draws/actions.js +12 -1
- package/dist/_internal/server/features/products/actions.d.ts +1 -1
- package/dist/_internal/server/features/products/actions.js +12 -1
- package/dist/_internal/server/features/promotions/actions.d.ts +1 -1
- package/dist/_internal/server/features/promotions/actions.js +12 -1
- package/dist/_internal/server/features/protection-claims/actions.d.ts +2 -2
- package/dist/_internal/server/features/protection-claims/actions.js +21 -12
- package/dist/_internal/server/features/raffle/actions.d.ts +1 -1
- package/dist/_internal/server/features/raffle/actions.js +12 -1
- package/dist/_internal/server/features/refunds/actions.d.ts +1 -3
- package/dist/_internal/server/features/refunds/actions.js +14 -2
- package/dist/_internal/server/features/reviews/actions.d.ts +1 -1
- package/dist/_internal/server/features/reviews/actions.js +12 -1
- package/dist/_internal/server/features/wishlist/actions.d.ts +1 -1
- package/dist/_internal/server/features/wishlist/actions.js +12 -1
- package/dist/_internal/server/jobs/core/obligationSweep.js +0 -1
- package/dist/_internal/server/jobs/core/paymentReconcile.js +84 -57
- package/dist/_internal/server/jobs/core/testDataCleanup.d.ts +1 -1
- package/dist/_internal/server/jobs/core/testDataCleanup.js +22 -1
- package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.js +16 -4
- package/dist/_internal/shared/features/promotions/schema.d.ts +66 -0
- package/dist/_internal/shared/features/promotions/schema.js +7 -0
- package/dist/_internal/shared/obligations/deadlines.js +11 -1
- package/dist/_internal/shared/tester/window.d.ts +25 -0
- package/dist/_internal/shared/tester/window.js +66 -0
- package/dist/core/unit-of-work.js +15 -1
- package/dist/errors/firestore-codes.d.ts +37 -0
- package/dist/errors/firestore-codes.js +52 -0
- package/dist/errors/index.d.ts +0 -1
- package/dist/errors/index.js +12 -2
- package/dist/features/admin/components/AdminCouponEditorView.js +8 -0
- package/dist/features/admin/components/AdminGatewayEventsView.js +2 -2
- package/dist/features/admin/components/DataListingView.js +2 -0
- package/dist/features/admin/components/analytics/AdminStatCard.js +4 -1
- package/dist/features/admin/repository/site-settings.repository.d.ts +2 -1
- package/dist/features/admin/repository/site-settings.repository.js +7 -0
- package/dist/features/auctions/components/MarketplaceAuctionCard.js +1 -1
- package/dist/features/catalogue/actions/approve-catalogue-listing.d.ts +1 -1
- package/dist/features/catalogue/actions/approve-catalogue-listing.js +12 -1
- package/dist/features/catalogue/actions/list-from-catalogue.d.ts +1 -1
- package/dist/features/catalogue/actions/list-from-catalogue.js +12 -1
- package/dist/features/catalogue/actions/submit-for-approval.d.ts +1 -1
- package/dist/features/catalogue/actions/submit-for-approval.js +12 -1
- package/dist/features/categories/repository/price-observation.repository.d.ts +19 -0
- package/dist/features/categories/repository/price-observation.repository.js +21 -2
- package/dist/features/events/actions/event-actions.js +4 -1
- package/dist/features/events/components/AdminEventEditorView.js +72 -45
- package/dist/features/events/components/EventsListPageView.js +2 -1
- package/dist/features/events/schemas/firestore.d.ts +17 -0
- package/dist/features/events/schemas/firestore.js +1 -0
- package/dist/features/events/utils/sort-pinned.d.ts +33 -0
- package/dist/features/events/utils/sort-pinned.js +46 -0
- package/dist/features/gateway-events/repository/gateway-events.repository.js +3 -40
- package/dist/features/gateway-events/schemas/index.d.ts +2 -2
- package/dist/features/inventory/components/AdminStorageBoxesView.js +55 -39
- package/dist/features/inventory/components/ReceiveStationView.js +61 -17
- package/dist/features/inventory/repository/storage-boxes.repository.d.ts +3 -1
- package/dist/features/inventory/repository/storage-boxes.repository.js +36 -3
- package/dist/features/obligations/repository/obligations.repository.js +10 -1
- package/dist/features/orders/schemas/firestore.d.ts +19 -0
- package/dist/features/orders/schemas/firestore.js +19 -0
- package/dist/features/payment-cases/repository/payment-cases.repository.d.ts +1 -0
- package/dist/features/payment-cases/repository/payment-cases.repository.js +3 -14
- package/dist/features/pre-orders/components/MarketplacePreorderCard.js +1 -1
- package/dist/features/products/components/MarketplaceBundleCard.js +1 -1
- package/dist/features/products/components/MarketplacePrizeDrawCard.js +1 -1
- package/dist/features/products/components/ProductForm.js +2 -2
- package/dist/features/products/components/ProductGrid.js +1 -1
- package/dist/features/promotions/repository/claimed-coupons.repository.js +31 -1
- package/dist/features/promotions/schemas/firestore.d.ts +22 -0
- package/dist/features/promotions/schemas/firestore.js +22 -0
- package/dist/features/promotions/schemas/index.d.ts +479 -6
- package/dist/features/promotions/schemas/index.js +153 -0
- package/dist/features/protection-claims/repository/protection-claims.repository.js +22 -15
- package/dist/features/seller/schemas/coupon-form.d.ts +5 -0
- package/dist/features/seller/schemas/coupon-form.js +18 -0
- package/dist/features/shell/SectionForm.js +31 -9
- package/dist/features/sticker-trace/server.d.ts +2 -0
- package/dist/http/api-handler.js +4 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/next/routing/route-map.d.ts +0 -2
- package/dist/next/routing/route-map.js +10 -1
- package/dist/schemas/registry.d.ts +11 -6
- package/dist/server.d.ts +0 -1
- package/dist/server.js +5 -3
- package/dist/styles.css +51 -0
- package/dist/ui/components/PaginatedSelect.js +0 -0
- package/package.json +1 -1
- package/scripts/seed-cli.mjs +1822 -1812
- package/dist/features/tester/utils/phases.d.ts +0 -48
- package/dist/features/tester/utils/phases.js +0 -139
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Computes default `phase` numbers for the tester checklist catalog.
|
|
3
|
-
*
|
|
4
|
-
* `phase` is a real, stored, admin-editable field on `TesterChecklistItemDocument`
|
|
5
|
-
* (see schemas/firestore.ts) — not something recomputed on every read. This
|
|
6
|
-
* module only supplies the INITIAL assignment: given the catalog in its
|
|
7
|
-
* existing groupKey/pageKey/order sequence, bucket whole pages together into
|
|
8
|
-
* phases of roughly `targetPhaseSize` items each (never splitting a single
|
|
9
|
-
* page's items across two phases), so a tester works through ~10-50 cases
|
|
10
|
-
* per session instead of the full catalog at once.
|
|
11
|
-
*
|
|
12
|
-
* Used once at seed-authoring time (tester-checklist-seed-data.ts) and by
|
|
13
|
-
* the one-off Firestore backfill for already-seeded items that predate the
|
|
14
|
-
* `phase` field. After that, every read path (TesterHubView, admin results
|
|
15
|
-
* views, the markdown report) just groups by the stored `item.phase` value —
|
|
16
|
-
* no chunking logic at read time.
|
|
17
|
-
*/
|
|
18
|
-
export interface TesterPhaseAssignable {
|
|
19
|
-
groupKey: string;
|
|
20
|
-
pageKey: string;
|
|
21
|
-
}
|
|
22
|
-
/** Target item count per phase — real phase sizes vary a little around this
|
|
23
|
-
* since a page's items are never split across two phases. */
|
|
24
|
-
export declare const DEFAULT_TESTER_PHASE_SIZE = 25;
|
|
25
|
-
/**
|
|
26
|
-
* Groups that take the earliest phases, ahead of the round-robin.
|
|
27
|
-
*
|
|
28
|
-
* 🛑 THE ROUND-ROBIN BELOW IS RIGHT FOR EVERYTHING ELSE AND WRONG FOR THIS.
|
|
29
|
-
* Interleaving exists so an early stop costs a proportional slice of every
|
|
30
|
-
* group rather than the whole tail — a fair outcome when no group matters more
|
|
31
|
-
* than another. But `happy-path` is not one group among fourteen: it is the
|
|
32
|
-
* question "can anyone buy anything on this site", and a run that covered 7% of
|
|
33
|
-
* it alongside 7% of SEO metadata has answered nothing.
|
|
34
|
-
*
|
|
35
|
-
* So these groups are packed FIRST, in their own catalogue order, and the
|
|
36
|
-
* round-robin then runs over the remainder exactly as before.
|
|
37
|
-
*
|
|
38
|
-
* Adding a group here is a real cost: every group after it loses its early
|
|
39
|
-
* proportional slice. Two entries is the intended size of this list.
|
|
40
|
-
*/
|
|
41
|
-
export declare const PRIORITY_GROUPS: readonly string[];
|
|
42
|
-
/**
|
|
43
|
-
* Returns a same-length array of 1-based phase numbers, one per input item,
|
|
44
|
-
* computed by greedily packing whole pages (consecutive runs of the same
|
|
45
|
-
* groupKey+pageKey) into phases of ~`targetPhaseSize` items. `items` MUST
|
|
46
|
-
* already be in catalog order (e.g. sorted by the `order` field).
|
|
47
|
-
*/
|
|
48
|
-
export declare function assignDefaultPhases<T extends TesterPhaseAssignable>(itemsInCatalogOrder: T[], targetPhaseSize?: number): number[];
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Computes default `phase` numbers for the tester checklist catalog.
|
|
3
|
-
*
|
|
4
|
-
* `phase` is a real, stored, admin-editable field on `TesterChecklistItemDocument`
|
|
5
|
-
* (see schemas/firestore.ts) — not something recomputed on every read. This
|
|
6
|
-
* module only supplies the INITIAL assignment: given the catalog in its
|
|
7
|
-
* existing groupKey/pageKey/order sequence, bucket whole pages together into
|
|
8
|
-
* phases of roughly `targetPhaseSize` items each (never splitting a single
|
|
9
|
-
* page's items across two phases), so a tester works through ~10-50 cases
|
|
10
|
-
* per session instead of the full catalog at once.
|
|
11
|
-
*
|
|
12
|
-
* Used once at seed-authoring time (tester-checklist-seed-data.ts) and by
|
|
13
|
-
* the one-off Firestore backfill for already-seeded items that predate the
|
|
14
|
-
* `phase` field. After that, every read path (TesterHubView, admin results
|
|
15
|
-
* views, the markdown report) just groups by the stored `item.phase` value —
|
|
16
|
-
* no chunking logic at read time.
|
|
17
|
-
*/
|
|
18
|
-
/** Target item count per phase — real phase sizes vary a little around this
|
|
19
|
-
* since a page's items are never split across two phases. */
|
|
20
|
-
export const DEFAULT_TESTER_PHASE_SIZE = 25;
|
|
21
|
-
/**
|
|
22
|
-
* Groups that take the earliest phases, ahead of the round-robin.
|
|
23
|
-
*
|
|
24
|
-
* 🛑 THE ROUND-ROBIN BELOW IS RIGHT FOR EVERYTHING ELSE AND WRONG FOR THIS.
|
|
25
|
-
* Interleaving exists so an early stop costs a proportional slice of every
|
|
26
|
-
* group rather than the whole tail — a fair outcome when no group matters more
|
|
27
|
-
* than another. But `happy-path` is not one group among fourteen: it is the
|
|
28
|
-
* question "can anyone buy anything on this site", and a run that covered 7% of
|
|
29
|
-
* it alongside 7% of SEO metadata has answered nothing.
|
|
30
|
-
*
|
|
31
|
-
* So these groups are packed FIRST, in their own catalogue order, and the
|
|
32
|
-
* round-robin then runs over the remainder exactly as before.
|
|
33
|
-
*
|
|
34
|
-
* Adding a group here is a real cost: every group after it loses its early
|
|
35
|
-
* proportional slice. Two entries is the intended size of this list.
|
|
36
|
-
*/
|
|
37
|
-
export const PRIORITY_GROUPS = ["happy-path"];
|
|
38
|
-
/**
|
|
39
|
-
* Returns a same-length array of 1-based phase numbers, one per input item,
|
|
40
|
-
* computed by greedily packing whole pages (consecutive runs of the same
|
|
41
|
-
* groupKey+pageKey) into phases of ~`targetPhaseSize` items. `items` MUST
|
|
42
|
-
* already be in catalog order (e.g. sorted by the `order` field).
|
|
43
|
-
*/
|
|
44
|
-
export function assignDefaultPhases(itemsInCatalogOrder, targetPhaseSize = DEFAULT_TESTER_PHASE_SIZE) {
|
|
45
|
-
/*
|
|
46
|
-
* 🛑 PAGES ARE INTERLEAVED ACROSS GROUPS, NOT PACKED IN CATALOGUE ORDER.
|
|
47
|
-
*
|
|
48
|
-
* This used to walk the catalogue straight through, so a group's phase number
|
|
49
|
-
* was an accident of where its `...group(...)` spread sat in a 6,200-line
|
|
50
|
-
* literal. `admin` is the 9th spread, so its 231 cases landed at phases
|
|
51
|
-
* **25–32** — and any run that stops early is therefore GUARANTEED to lose
|
|
52
|
-
* the largest, most privileged group in its entirety. The same held for every
|
|
53
|
-
* infrastructure group in the tail: page-wiring (32–33), cta-layout (33),
|
|
54
|
-
* addresses and search-and-nav (34).
|
|
55
|
-
*
|
|
56
|
-
* That is not hypothetical. Run run-1789300124915 stopped at phase 17 of 34
|
|
57
|
-
* and ten of fourteen groups had ZERO coverage — 527 cases, including all 233
|
|
58
|
-
* admin ones — while the run looked about half done.
|
|
59
|
-
*
|
|
60
|
-
* Round-robin over groups fixes the shape rather than the symptom: an early
|
|
61
|
-
* stop now costs a proportional slice of every group instead of the whole
|
|
62
|
-
* tail. Groups are visited largest-first within each round so the big ones do
|
|
63
|
-
* not bunch up at the end as the small ones run out.
|
|
64
|
-
*
|
|
65
|
-
* A phase may now span several groups. That is fine for a tester session —
|
|
66
|
-
* it is ~25 cases either way — and every read path already groups by the
|
|
67
|
-
* STORED `item.phase`, never by position.
|
|
68
|
-
*
|
|
69
|
-
* 🛑 The RETURN IS STILL POSITIONAL. Items keep their catalogue order and
|
|
70
|
-
* their `order` field; only the phase LABEL changes. Nothing downstream
|
|
71
|
-
* reorders, and `fetch-cases` still sorts by (phase, order) to build batches.
|
|
72
|
-
*/
|
|
73
|
-
const pageOrder = [];
|
|
74
|
-
const pageSize = new Map();
|
|
75
|
-
const pageGroup = new Map();
|
|
76
|
-
for (const item of itemsInCatalogOrder) {
|
|
77
|
-
const pageId = `${item.groupKey}␟${item.pageKey}`;
|
|
78
|
-
if (!pageSize.has(pageId)) {
|
|
79
|
-
pageOrder.push(pageId);
|
|
80
|
-
pageSize.set(pageId, 0);
|
|
81
|
-
pageGroup.set(pageId, item.groupKey);
|
|
82
|
-
}
|
|
83
|
-
pageSize.set(pageId, pageSize.get(pageId) + 1);
|
|
84
|
-
}
|
|
85
|
-
// Queues of pages per group, each still in catalogue order within its group.
|
|
86
|
-
const byGroup = new Map();
|
|
87
|
-
for (const pageId of pageOrder) {
|
|
88
|
-
const g = pageGroup.get(pageId);
|
|
89
|
-
if (!byGroup.has(g))
|
|
90
|
-
byGroup.set(g, []);
|
|
91
|
-
byGroup.get(g).push(pageId);
|
|
92
|
-
}
|
|
93
|
-
/*
|
|
94
|
-
* Priority groups first, whole, in catalogue order — then the round-robin over
|
|
95
|
-
* everything else. See PRIORITY_GROUPS for why this one group is exempt from
|
|
96
|
-
* the interleaving the rest depends on.
|
|
97
|
-
*/
|
|
98
|
-
const interleaved = [];
|
|
99
|
-
for (const g of PRIORITY_GROUPS) {
|
|
100
|
-
for (const pageId of byGroup.get(g) ?? [])
|
|
101
|
-
interleaved.push(pageId);
|
|
102
|
-
}
|
|
103
|
-
const groupsLargestFirst = [...byGroup.entries()]
|
|
104
|
-
.filter(([g]) => !PRIORITY_GROUPS.includes(g))
|
|
105
|
-
.map(([g, pages]) => ({
|
|
106
|
-
g,
|
|
107
|
-
pages,
|
|
108
|
-
cases: pages.reduce((n, p) => n + pageSize.get(p), 0),
|
|
109
|
-
}))
|
|
110
|
-
.sort((a, b) => b.cases - a.cases || a.g.localeCompare(b.g))
|
|
111
|
-
.map((e) => e.g);
|
|
112
|
-
const cursor = new Map(groupsLargestFirst.map((g) => [g, 0]));
|
|
113
|
-
let remaining = pageOrder.length - interleaved.length;
|
|
114
|
-
while (remaining > 0) {
|
|
115
|
-
for (const g of groupsLargestFirst) {
|
|
116
|
-
const i = cursor.get(g);
|
|
117
|
-
const pages = byGroup.get(g);
|
|
118
|
-
if (i >= pages.length)
|
|
119
|
-
continue;
|
|
120
|
-
interleaved.push(pages[i]);
|
|
121
|
-
cursor.set(g, i + 1);
|
|
122
|
-
remaining--;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
// Pack the interleaved page sequence into phases, never splitting a page.
|
|
126
|
-
const phaseOfPage = new Map();
|
|
127
|
-
let currentPhase = 1;
|
|
128
|
-
let currentPhaseCount = 0;
|
|
129
|
-
for (const pageId of interleaved) {
|
|
130
|
-
const size = pageSize.get(pageId);
|
|
131
|
-
if (currentPhaseCount > 0 && currentPhaseCount >= targetPhaseSize) {
|
|
132
|
-
currentPhase += 1;
|
|
133
|
-
currentPhaseCount = 0;
|
|
134
|
-
}
|
|
135
|
-
phaseOfPage.set(pageId, currentPhase);
|
|
136
|
-
currentPhaseCount += size;
|
|
137
|
-
}
|
|
138
|
-
return itemsInCatalogOrder.map((item) => phaseOfPage.get(`${item.groupKey}␟${item.pageKey}`));
|
|
139
|
-
}
|