feat: add public product catalog boundary
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
"./inventory": "./inventory.js",
|
||||
"./image": "./image.js",
|
||||
"./listing": "./listing.js",
|
||||
"./product": "./product.js"
|
||||
"./product": "./product.js",
|
||||
"./public-product": "./public-product.js"
|
||||
}
|
||||
}
|
||||
@@ -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),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user