Add visitor phone lookup flow

This commit is contained in:
wangxuming
2026-07-15 11:26:37 +08:00
parent 331e30894b
commit 7f751bebae
21 changed files with 971 additions and 104 deletions

View File

@@ -219,6 +219,14 @@ def main() -> None:
assert public["ticket_number"] == first_ticket["ticket_number"]
assert_public_phone_projection(public, phone, "public status")
phone_lookup = client.request(
"POST", "/api/public/status/search", {"phone": phone}
)
assert len(phone_lookup.get("tickets", [])) == 1
phone_lookup_ticket = phone_lookup["tickets"][0]
assert phone_lookup_ticket["ticket_number"] == first_ticket["ticket_number"]
assert_public_phone_projection(phone_lookup_ticket, phone, "phone lookup")
client.request(
"POST",
"/api/admin/auth/login",
@@ -266,6 +274,18 @@ def main() -> None:
source="confirmed duplicate create response",
)
phone_lookup = client.request(
"POST", "/api/public/status/search", {"phone": phone}
)
phone_lookup_numbers = {
ticket["ticket_number"] for ticket in phone_lookup.get("tickets", [])
}
assert phone_lookup_numbers == {
first_ticket["ticket_number"], confirmed_ticket["ticket_number"]
}
for ticket in phone_lookup["tickets"]:
assert_public_phone_projection(ticket, phone, "phone lookup with duplicate tickets")
snapshot = client.request("GET", f"/api/staff/projects/{project_id}/queue")
project = snapshot["project"]
batch_size = int(