feat: add party-size queueing and call modes
This commit is contained in:
@@ -14,6 +14,7 @@ const batch = {
|
||||
last_name: "张",
|
||||
honorific: "先生",
|
||||
status: "CALLED",
|
||||
party_size: 3,
|
||||
}],
|
||||
};
|
||||
|
||||
@@ -26,6 +27,8 @@ describe("BatchCard contact details", () => {
|
||||
expect(screen.queryByText("第 3 批")).not.toBeInTheDocument();
|
||||
expect(screen.getByText("13800138000")).toBeVisible();
|
||||
expect(screen.getByText("张先生")).toBeVisible();
|
||||
expect(screen.getByText("1 个号码 · 3 人")).toBeVisible();
|
||||
expect(screen.getByText("3 人")).toBeVisible();
|
||||
expect(screen.getByText("您的号码已叫到")).toBeVisible();
|
||||
});
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ export function BatchCard({
|
||||
batch: CallBatchDto;
|
||||
showContactDetails?: boolean;
|
||||
}) {
|
||||
const peopleCount = batch.people_count ?? batch.tickets.reduce((total, ticket) => total + ticket.party_size, 0);
|
||||
|
||||
return (
|
||||
<section className="batch-card" aria-labelledby={`batch-${batch.id}`}>
|
||||
<div className="batch-card__header">
|
||||
@@ -18,7 +20,7 @@ export function BatchCard({
|
||||
<StatusBadge status={batch.status} />
|
||||
</div>
|
||||
<p className="batch-card__summary">
|
||||
<strong>{batchTicketCount(batch)} 个号码</strong>
|
||||
<strong>{batchTicketCount(batch)} 个号码 · {peopleCount} 人</strong>
|
||||
<span>{formatDateTime(batch.called_at)}</span>
|
||||
</p>
|
||||
<ul className="batch-ticket-list">
|
||||
@@ -26,6 +28,7 @@ export function BatchCard({
|
||||
<li key={ticket.id} className="batch-ticket-row">
|
||||
<div className="batch-ticket-identity">
|
||||
<strong className="ticket-number">{ticket.ticket_number}</strong>
|
||||
<span className="batch-ticket-party">{ticket.party_size} 人</span>
|
||||
{showContactDetails ? (
|
||||
<span className="ticket-contact-line">
|
||||
<span><span className="ticket-contact-label">手机号</span> <strong className="phone-value">{ticket.phone || "未返回"}</strong></span>
|
||||
|
||||
Reference in New Issue
Block a user