fix: normalize record identifiers for stable retry scopes
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
5889158b3c
commit
c93fe5ef6b
|
|
@ -1,6 +1,6 @@
|
||||||
# Phase 2 implementation verification — 13 October 2026
|
# Phase 2 implementation verification — 13 October 2026
|
||||||
|
|
||||||
Final local gate: 29 tests passed, strict TypeScript and lint passed, production build passed with all 27 JavaScript chunks below 500 kB (largest approximately 494 kB). The dependency audit reported zero vulnerabilities.
|
Final local gate: 30 tests passed, strict TypeScript and lint passed, production build passed with all 27 JavaScript chunks below 500 kB (largest approximately 494 kB). The dependency audit reported zero vulnerabilities.
|
||||||
|
|
||||||
| Area | Evidence / outcome |
|
| Area | Evidence / outcome |
|
||||||
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
export const uuid = z.string().uuid();
|
export const uuid = z.string().uuid().toLowerCase();
|
||||||
export const currency = z.enum(["INR", "USD", "EUR", "GBP"]);
|
export const currency = z.enum(["INR", "USD", "EUR", "GBP"]);
|
||||||
export const decimal = z.string().regex(/^\d+(?:\.\d{1,2})?$/);
|
export const decimal = z.string().regex(/^\d+(?:\.\d{1,2})?$/);
|
||||||
export const amount = z.string().regex(/^(0|[1-9]\d{0,9})\.\d{2}$/);
|
export const amount = z.string().regex(/^(0|[1-9]\d{0,9})\.\d{2}$/);
|
||||||
|
|
|
||||||
|
|
@ -425,7 +425,7 @@ export default function CatalogAdminPage({ id }: { id?: string }) {
|
||||||
{id && !uuid.safeParse(id).success ? (
|
{id && !uuid.safeParse(id).success ? (
|
||||||
<Alert severity="error">Invalid product identifier.</Alert>
|
<Alert severity="error">Invalid product identifier.</Alert>
|
||||||
) : id ? (
|
) : id ? (
|
||||||
<ProductEditor key={id} id={id} />
|
<ProductEditor key={uuid.parse(id)} id={uuid.parse(id)} />
|
||||||
) : (
|
) : (
|
||||||
<Products />
|
<Products />
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -361,7 +361,7 @@ export default function InventoryPage({ id }: { id?: string }) {
|
||||||
{id && !uuid.safeParse(id).success ? (
|
{id && !uuid.safeParse(id).success ? (
|
||||||
<Alert severity="error">Invalid stock identifier.</Alert>
|
<Alert severity="error">Invalid stock identifier.</Alert>
|
||||||
) : id ? (
|
) : id ? (
|
||||||
<StockEditor key={id} id={id} />
|
<StockEditor key={uuid.parse(id)} id={uuid.parse(id)} />
|
||||||
) : (
|
) : (
|
||||||
<StockList />
|
<StockList />
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,7 @@ export default function OrdersPage({
|
||||||
{id && !uuid.safeParse(id).success ? (
|
{id && !uuid.safeParse(id).success ? (
|
||||||
<Alert severity="error">Invalid order identifier.</Alert>
|
<Alert severity="error">Invalid order identifier.</Alert>
|
||||||
) : id ? (
|
) : id ? (
|
||||||
<OrderDetail key={id} admin={admin} id={id} />
|
<OrderDetail key={uuid.parse(id)} admin={admin} id={uuid.parse(id)} />
|
||||||
) : (
|
) : (
|
||||||
<OrderList admin={admin} />
|
<OrderList admin={admin} />
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import {
|
||||||
variant,
|
variant,
|
||||||
warehouse,
|
warehouse,
|
||||||
stock,
|
stock,
|
||||||
|
stockInput,
|
||||||
adminProductSummary,
|
adminProductSummary,
|
||||||
pricing,
|
pricing,
|
||||||
checkoutInput,
|
checkoutInput,
|
||||||
|
|
@ -27,6 +28,15 @@ const id = "d66c798a-f764-4b88-8d13-ace328ff1010";
|
||||||
test("organization UUIDs normalize case before session organization checks", () => {
|
test("organization UUIDs normalize case before session organization checks", () => {
|
||||||
assert.equal(organizationSchema.parse(id.toUpperCase()), id);
|
assert.equal(organizationSchema.parse(id.toUpperCase()), id);
|
||||||
});
|
});
|
||||||
|
test("stock identifiers normalize case before request and retry scopes", () => {
|
||||||
|
assert.equal(
|
||||||
|
stockInput.parse({
|
||||||
|
variantId: id.toUpperCase(),
|
||||||
|
warehouseId: id.toUpperCase(),
|
||||||
|
}).variantId,
|
||||||
|
id,
|
||||||
|
);
|
||||||
|
});
|
||||||
test("response schemas accept persisted metadata while write schemas stay strict", () => {
|
test("response schemas accept persisted metadata while write schemas stay strict", () => {
|
||||||
const extra = {
|
const extra = {
|
||||||
id,
|
id,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue