feat: add public product catalog boundary

This commit is contained in:
2026-09-08 18:20:04 -04:00
parent f29629c712
commit 43f4f69894
11 changed files with 233 additions and 9 deletions
+2 -1
View File
@@ -7,6 +7,7 @@
"./inventory": "./inventory.js",
"./image": "./image.js",
"./listing": "./listing.js",
"./product": "./product.js"
"./product": "./product.js",
"./public-product": "./public-product.js"
}
}
+20
View File
@@ -0,0 +1,20 @@
function toIsoString(value) {
return value instanceof Date ? value.toISOString() : value;
}
export function toPublicProductDto(product) {
return {
id: product.id,
categoryId: product.categoryId,
name: product.name,
slug: product.slug,
description: product.description ?? null,
brand: product.brand ?? null,
setName: product.setName ?? null,
cardNumber: product.cardNumber ?? null,
eventName: product.eventName ?? null,
releaseYear: product.releaseYear ?? null,
createdAt: toIsoString(product.createdAt),
updatedAt: toIsoString(product.updatedAt),
};
}