@@ -0,0 +1,61 @@
|
||||
import { Panel } from '@/components/procurement';
|
||||
import { date } from '@/types/procurement';
|
||||
|
||||
export type FrozenUrgentBasis = {
|
||||
id: number;
|
||||
created_at: string;
|
||||
reason: string;
|
||||
snapshot: {
|
||||
item: { description: string };
|
||||
author: { name: string };
|
||||
stock_policy: {
|
||||
minimum_stock_milli: number;
|
||||
usage_context: string | null;
|
||||
warehouse: { name: string };
|
||||
};
|
||||
availability: { free_milli: number | null };
|
||||
};
|
||||
};
|
||||
export default function UrgentQuotationSummary({
|
||||
records,
|
||||
}: {
|
||||
records?: FrozenUrgentBasis[];
|
||||
}) {
|
||||
if (!records?.length) return null;
|
||||
return (
|
||||
<Panel
|
||||
title="Fundamento da redução urgente de cotações"
|
||||
description="Conferências preservadas do momento em que o mínimo parametrizado foi atingido. Orçamento e aprovações mantêm-se."
|
||||
>
|
||||
<ul className="space-y-3">
|
||||
{records.map((record) => (
|
||||
<li key={record.id} className="text-sm">
|
||||
<p className="font-semibold">
|
||||
{record.snapshot.item.description} ·{' '}
|
||||
{record.snapshot.stock_policy.warehouse.name}
|
||||
</p>
|
||||
<p>
|
||||
Mínimo:{' '}
|
||||
{record.snapshot.stock_policy.minimum_stock_milli /
|
||||
1000}
|
||||
; stock livre no momento:{' '}
|
||||
{record.snapshot.availability.free_milli === null
|
||||
? 'Indeterminado'
|
||||
: record.snapshot.availability.free_milli /
|
||||
1000}
|
||||
.
|
||||
</p>
|
||||
<p>
|
||||
{record.snapshot.author.name} ·{' '}
|
||||
{date(record.created_at)}
|
||||
</p>
|
||||
{record.snapshot.stock_policy.usage_context && (
|
||||
<p>{record.snapshot.stock_policy.usage_context}</p>
|
||||
)}
|
||||
<p className="whitespace-pre-wrap">{record.reason}</p>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</Panel>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user