[feat] purchase price added to inventory collection

This commit is contained in:
2026-04-08 08:13:52 -04:00
parent 4648507371
commit 3b4f98e556
2 changed files with 7 additions and 0 deletions

View File

@@ -106,6 +106,7 @@ export const createInventoryCollection = async () => {
{ name: 'catalogName', type: 'string' },
{ name: 'card_id', type: 'string', reference: 'cards.id', async_reference: true },
{ name: 'sku_id', type: 'string', reference: 'skus.id', async_reference: true },
{ name: 'purchasePrice', type: 'int32', optional: true },
// content,setName,productLineName,rarityName,energyType,cardType from cards for searching
{ name: 'content', type: 'string', token_separators: ['/'] },
{ name: 'setName', type: 'string' },
@@ -172,6 +173,7 @@ export const upsertInventoryCollection = async (db:DBInstance) => {
catalogName: i.catalogName,
card_id: i.sku?.cardId.toString(),
sku_id: i.skuId.toString(),
purchasePrice: DollarToInt(i.purchasePrice),
productLineName: i.sku?.card?.productLineName,
rarityName: i.sku?.card?.rarityName,
setName: i.sku?.card?.set?.setName || "",