fix(appointment): real status filter + required account fields

- My-appointments tabs sent invalid status values (reserved/waiting_for_payment/
  ...) that don't exist in the backend, so every tab but "all" returned empty.
  Map tabs to real statuses (pending/confirmed/completed/cancelled_by_user/
  expired) so booked appointments show up.
- Booking form now validates required account fields before proceeding to
  payment (national_code 10 digits, name, family, gender, basic_insurance),
  in both self and other-person modes, surfacing per-field errors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
hamed
2026-06-16 10:45:41 +03:30
co-authored by Claude Opus 4.8
parent 59d29cd7c7
commit 7949da9ba9
4 changed files with 237 additions and 9 deletions
@@ -3,20 +3,20 @@ import Tabs from "@/app/component/Tabs";
const listTab = [
"همه",
"در انتظار پرداخت",
"رزرو شده",
"ویزیت شده",
"لغو خودکار",
"تکمیل شده",
"تأیید شده",
"انجام شده",
"لغو شده",
"منقضی شده",
];
function Head({ status, setStatus }) {
const statusMap = {
0: undefined, // all
1: "waiting_for_payment",
2: "reserved",
3: "visited",
4: "auto_cancel_unpaid",
5: "completed",
1: "pending",
2: "confirmed",
3: "completed",
4: "cancelled_by_user",
5: "expired",
};
const handleChange = (e, value) => {