feat(expenses): add beloPrice and usdcEquivalent fields to Expense model and update related logic
This commit is contained in:
@@ -97,6 +97,25 @@ export function ExpensesTable({
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
header: "USDC",
|
||||
accessorKey: "usdcEquivalent",
|
||||
cell: ({ row }) => {
|
||||
const value = row.getValue("usdcEquivalent");
|
||||
if (!value) {
|
||||
return <span className="text-muted-foreground">--</span>;
|
||||
}
|
||||
return (
|
||||
<span className="tabular-nums">
|
||||
{Number(value).toLocaleString("es-AR", {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2,
|
||||
})}{" "}
|
||||
USDC
|
||||
</span>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
header: "Vencimiento",
|
||||
accessorKey: "dueDate",
|
||||
@@ -232,6 +251,15 @@ export function ExpensesTable({
|
||||
? `Pagado ${formatExpenseDate(expense.paymentDate)}`
|
||||
: "Sin fecha de pago"}
|
||||
</p>
|
||||
{expense.usdcEquivalent && (
|
||||
<p className="text-xs text-muted-foreground tabular-nums">
|
||||
{Number(expense.usdcEquivalent).toLocaleString("es-AR", {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2,
|
||||
})}{" "}
|
||||
USDC
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="flex gap-1">
|
||||
|
||||
@@ -130,6 +130,8 @@ export type Expense = {
|
||||
month: number;
|
||||
amount: string;
|
||||
amountPayed: string | null;
|
||||
beloPrice: string | null;
|
||||
usdcEquivalent: string | null;
|
||||
status: "PENDING" | "PAYED";
|
||||
dueDate: string;
|
||||
paymentDate: string | null;
|
||||
|
||||
Reference in New Issue
Block a user