task-d complate
This commit is contained in:
@@ -77,6 +77,15 @@ export interface CustomerActivityRecord {
|
||||
actorName: string | null;
|
||||
}
|
||||
|
||||
export interface CustomerRelatedEnquiryItem {
|
||||
id: string;
|
||||
code: string;
|
||||
title: string;
|
||||
status: string;
|
||||
productType: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface CustomerReferenceData {
|
||||
branches: BranchOption[];
|
||||
customerTypes: CustomerOption[];
|
||||
|
||||
@@ -14,6 +14,7 @@ import type { CustomerReferenceData } from '../api/types';
|
||||
import { CustomerFormSheet } from './customer-form-sheet';
|
||||
import { CustomerContactsTab } from './customer-contacts-tab';
|
||||
import { CustomerStatusBadge } from './customer-status-badge';
|
||||
import type { CustomerRelatedEnquiryItem } from '../api/types';
|
||||
|
||||
function FieldItem({ label, value }: { label: string; value: string | null | undefined }) {
|
||||
return (
|
||||
@@ -28,7 +29,8 @@ export function CustomerDetail({
|
||||
customerId,
|
||||
referenceData,
|
||||
canUpdate,
|
||||
canManageContacts
|
||||
canManageContacts,
|
||||
relatedEnquiries
|
||||
}: {
|
||||
customerId: string;
|
||||
referenceData: CustomerReferenceData;
|
||||
@@ -38,6 +40,7 @@ export function CustomerDetail({
|
||||
update: boolean;
|
||||
delete: boolean;
|
||||
};
|
||||
relatedEnquiries: CustomerRelatedEnquiryItem[];
|
||||
}) {
|
||||
const { data } = useSuspenseQuery(customerByIdOptions(customerId));
|
||||
const [editOpen, setEditOpen] = useState(false);
|
||||
@@ -212,14 +215,36 @@ export function CustomerDetail({
|
||||
<CardHeader>
|
||||
<CardTitle>Related Documents</CardTitle>
|
||||
<CardDescription>
|
||||
Task C stops at customer and contact scope, so downstream CRM documents stay
|
||||
intentionally deferred.
|
||||
Production enquiry links are now visible here, while quotation and approval
|
||||
modules stay deferred.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className='text-muted-foreground rounded-lg border border-dashed p-8 text-center text-sm'>
|
||||
Enquiry, quotation, and approval links will land here in Task D and later.
|
||||
</div>
|
||||
{!relatedEnquiries.length ? (
|
||||
<div className='text-muted-foreground rounded-lg border border-dashed p-8 text-center text-sm'>
|
||||
No enquiries have been linked to this customer yet.
|
||||
</div>
|
||||
) : (
|
||||
<div className='space-y-3'>
|
||||
{relatedEnquiries.map((enquiry) => (
|
||||
<Link
|
||||
key={enquiry.id}
|
||||
href={`/dashboard/crm/enquiries/${enquiry.id}`}
|
||||
className='block rounded-lg border p-4 transition-colors hover:bg-muted/40'
|
||||
>
|
||||
<div className='flex items-center justify-between gap-3'>
|
||||
<div className='space-y-1'>
|
||||
<div className='font-medium'>{enquiry.title}</div>
|
||||
<div className='text-muted-foreground font-mono text-xs'>
|
||||
{enquiry.code}
|
||||
</div>
|
||||
</div>
|
||||
<Icons.arrowRight className='text-muted-foreground h-4 w-4' />
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</TabsContent>
|
||||
|
||||
Reference in New Issue
Block a user