[feat] purchase price added to inventory collection
This commit is contained in:
@@ -12,6 +12,10 @@ const GainLoss = (purchasePrice: any, marketPrice: any) => {
|
||||
if (pp > mp) return `<div class="fs-5 fw-semibold text-critical">-$${(pp - mp).toFixed(2)}</div>`;
|
||||
return `<div class="fs-6 fw-semibold text-success">+$${(mp - pp).toFixed(2)}</div>`;
|
||||
}
|
||||
const DollarToInt = (dollar: any) => {
|
||||
if (dollar === null) return null;
|
||||
return Math.round(dollar * 100);
|
||||
}
|
||||
|
||||
const getInventory = async (userId: string, cardId: number) => {
|
||||
|
||||
@@ -108,6 +112,7 @@ const addToInventory = async (userId: string, cardId: number, skuId: number, pur
|
||||
userId: i.userId,
|
||||
catalogName: i.catalogName,
|
||||
sku_id: i.skuId.toString(),
|
||||
purchasePrice: DollarToInt(i.purchasePrice),
|
||||
productLineName: card?.productLineName,
|
||||
rarityName: card?.rarityName,
|
||||
setName: card?.set?.setName || "",
|
||||
|
||||
Reference in New Issue
Block a user