From 6f4a484051806bf8e00f1bc250734904e9c69f6d Mon Sep 17 00:00:00 2001 From: Mortezakoohjani Date: Sun, 26 Jul 2026 22:28:27 +0330 Subject: [PATCH] Migrate Beauty, Healthcare, and Accounting frontend to modular src/modules architecture. Move business logic out of App Router into module packages, add boundary validation scripts, and keep all routes as thin re-exports without changing URLs or API behavior. Co-authored-by: Cursor --- frontend/.eslintrc.json | 21 +- frontend/app/accounting/ai/analytics/page.tsx | 10 +- frontend/app/accounting/ai/anomalies/page.tsx | 10 +- frontend/app/accounting/ai/documents/page.tsx | 10 +- frontend/app/accounting/ai/forecasts/page.tsx | 10 +- frontend/app/accounting/ai/page.tsx | 10 +- frontend/app/accounting/ai/qa/page.tsx | 10 +- .../accounting/ai/recommendations/page.tsx | 10 +- .../app/accounting/ai/reconciliation/page.tsx | 10 +- .../accounting/assets/accumulated/page.tsx | 6 +- .../app/accounting/assets/dashboard/page.tsx | 8 +- .../app/accounting/assets/depreciate/page.tsx | 8 +- .../app/accounting/assets/dispose/page.tsx | 6 +- frontend/app/accounting/assets/page.tsx | 425 +- .../app/accounting/assets/schedule/page.tsx | 8 +- .../app/accounting/assets/transfers/page.tsx | 6 +- .../app/accounting/assets/valuation/page.tsx | 6 +- frontend/app/accounting/audit/page.tsx | 139 +- .../app/accounting/budget/control/page.tsx | 26 +- .../accounting/budget/definitions/page.tsx | 26 +- .../app/accounting/budget/forecast/page.tsx | 26 +- .../accounting/budget/operational/page.tsx | 26 +- .../accounting/budget/performance/page.tsx | 26 +- .../app/accounting/budget/reports/page.tsx | 26 +- .../app/accounting/budget/scenarios/page.tsx | 26 +- .../app/accounting/budget/variance/page.tsx | 26 +- .../app/accounting/chart-of-accounts/page.tsx | 647 +-- .../accounting/compliance/approvals/page.tsx | 6 +- .../accounting/compliance/controls/page.tsx | 6 +- .../accounting/compliance/policies/page.tsx | 8 +- .../accounting/compliance/records/page.tsx | 6 +- .../app/accounting/compliance/risks/page.tsx | 8 +- .../app/accounting/compliance/sod/page.tsx | 6 +- .../accounting/compliance/violations/page.tsx | 6 +- frontend/app/accounting/cost-centers/page.tsx | 274 +- frontend/app/accounting/currencies/page.tsx | 258 +- frontend/app/accounting/customers/page.tsx | 412 +- .../accounting/documents/categories/page.tsx | 22 +- .../accounting/documents/financial/page.tsx | 22 +- frontend/app/accounting/documents/hr/page.tsx | 22 +- .../accounting/documents/purchase/page.tsx | 22 +- .../accounting/documents/retention/page.tsx | 22 +- .../app/accounting/documents/sales/page.tsx | 22 +- .../app/accounting/documents/search/page.tsx | 22 +- .../accounting/documents/versions/page.tsx | 22 +- frontend/app/accounting/fiscal/page.tsx | 582 +-- .../app/accounting/integration/bank/page.tsx | 26 +- .../app/accounting/integration/crm/page.tsx | 26 +- .../accounting/integration/gateway/page.tsx | 26 +- .../integration/import-export/page.tsx | 26 +- .../accounting/integration/inventory/page.tsx | 26 +- .../accounting/integration/payroll/page.tsx | 26 +- .../accounting/integration/reports/page.tsx | 26 +- .../accounting/integration/webhooks/page.tsx | 26 +- .../accounting/inventory/adjustments/page.tsx | 19 +- .../app/accounting/inventory/issues/page.tsx | 345 +- .../app/accounting/inventory/items/page.tsx | 10 +- .../accounting/inventory/movements/page.tsx | 26 +- .../inventory/receipts-issues/page.tsx | 21 +- .../app/accounting/inventory/reports/page.tsx | 11 +- .../accounting/inventory/settings/page.tsx | 10 +- .../accounting/inventory/transfers/page.tsx | 19 +- .../accounting/inventory/valuation/page.tsx | 8 +- frontend/app/accounting/layout.tsx | 64 +- frontend/app/accounting/ledger/page.tsx | 222 +- .../accounting/monitoring/activity/page.tsx | 6 +- .../app/accounting/monitoring/alerts/page.tsx | 25 +- .../app/accounting/monitoring/health/page.tsx | 8 +- .../app/accounting/monitoring/kpis/page.tsx | 25 +- frontend/app/accounting/monitoring/page.tsx | 6 +- .../monitoring/performance/page.tsx | 25 +- .../app/accounting/monitoring/recent/page.tsx | 6 +- frontend/app/accounting/page.tsx | 181 +- .../accounting/payroll/allocation/page.tsx | 22 +- .../app/accounting/payroll/calculate/page.tsx | 6 +- .../app/accounting/payroll/contracts/page.tsx | 6 +- .../app/accounting/payroll/employees/page.tsx | 8 +- .../app/accounting/payroll/items/page.tsx | 6 +- frontend/app/accounting/payroll/page.tsx | 460 +- .../app/accounting/payroll/payments/page.tsx | 6 +- .../app/accounting/payroll/reports/page.tsx | 6 +- .../accounting/payroll/structures/page.tsx | 6 +- frontend/app/accounting/projects/page.tsx | 298 +- .../purchase/goods-receipts/page.tsx | 22 +- .../app/accounting/purchase/invoices/page.tsx | 20 +- .../app/accounting/purchase/orders/page.tsx | 19 +- .../accounting/purchase/prepayments/page.tsx | 50 +- .../app/accounting/purchase/requests/page.tsx | 19 +- .../app/accounting/purchase/returns/page.tsx | 420 +- .../accounting/purchase/settlements/page.tsx | 10 +- frontend/app/accounting/reports/page.tsx | 666 +-- .../app/accounting/sales/invoices/page.tsx | 20 +- .../accounting/sales/opportunities/page.tsx | 28 +- frontend/app/accounting/sales/orders/page.tsx | 19 +- .../accounting/sales/pre-receipts/page.tsx | 50 +- .../app/accounting/sales/proformas/page.tsx | 19 +- .../app/accounting/sales/returns/page.tsx | 20 +- .../app/accounting/sales/settlements/page.tsx | 10 +- .../accounting/settings/auto-posting/page.tsx | 190 +- .../app/accounting/settings/backup/page.tsx | 21 +- .../app/accounting/settings/company/page.tsx | 182 +- .../app/accounting/settings/general/page.tsx | 70 +- frontend/app/accounting/settings/page.tsx | 200 +- frontend/app/accounting/settings/tax/page.tsx | 21 +- frontend/app/accounting/setup/page.tsx | 292 +- frontend/app/accounting/suppliers/page.tsx | 126 +- .../app/accounting/treasury/banks/page.tsx | 8 +- .../accounting/treasury/cash-boxes/page.tsx | 8 +- .../accounting/treasury/cheques/new/page.tsx | 10 +- .../app/accounting/treasury/cheques/page.tsx | 10 +- .../accounting/treasury/facilities/page.tsx | 28 +- .../accounting/treasury/guarantees/page.tsx | 28 +- frontend/app/accounting/treasury/page.tsx | 493 +- .../treasury/receipts-payments/page.tsx | 10 +- .../treasury/reconciliation/page.tsx | 10 +- .../accounting/treasury/transfers/page.tsx | 10 +- .../app/accounting/vouchers/[id]/page.tsx | 553 +-- .../accounting/vouchers/adjustments/page.tsx | 5 +- frontend/app/accounting/vouchers/new/page.tsx | 392 +- frontend/app/accounting/vouchers/page.tsx | 244 +- .../accounting/vouchers/recurring/page.tsx | 26 +- .../accounting/vouchers/templates/page.tsx | 25 +- .../api/beauty-business/[...path]/route.ts | 96 + .../app/api/healthcare/[...path]/route.ts | 95 + .../app/api/sports-center/[...path]/route.ts | 53 + .../app/beauty/(owner)/appointments/page.tsx | 1 + .../beauty/(owner)/booking/schedules/page.tsx | 1 + .../(owner)/booking/waiting-list/page.tsx | 1 + frontend/app/beauty/(owner)/branches/page.tsx | 1 + .../(owner)/catalog/categories/page.tsx | 1 + .../beauty/(owner)/catalog/services/page.tsx | 1 + .../app/beauty/(owner)/customers/page.tsx | 1 + frontend/app/beauty/(owner)/layout.tsx | 5 + .../(owner)/marketing/campaigns/page.tsx | 1 + .../(owner)/marketing/integrations/page.tsx | 1 + .../app/beauty/(owner)/organizations/page.tsx | 1 + .../(owner)/packages/memberships/page.tsx | 1 + frontend/app/beauty/(owner)/packages/page.tsx | 1 + frontend/app/beauty/(owner)/page.tsx | 3 + .../beauty/(owner)/salon/policies/page.tsx | 1 + .../app/beauty/(owner)/salon/rooms/page.tsx | 1 + .../beauty/(owner)/salon/stations/page.tsx | 1 + frontend/app/beauty/(owner)/settings/page.tsx | 1 + .../beauty/(owner)/staff/commissions/page.tsx | 1 + frontend/app/beauty/(owner)/staff/page.tsx | 1 + frontend/app/beauty/admin/analytics/page.tsx | 3 + frontend/app/beauty/admin/branches/page.tsx | 3 + frontend/app/beauty/admin/customers/page.tsx | 3 + frontend/app/beauty/admin/layout.tsx | 5 + frontend/app/beauty/admin/monitoring/page.tsx | 3 + .../app/beauty/admin/organizations/page.tsx | 3 + frontend/app/beauty/admin/page.tsx | 3 + .../app/beauty/admin/permissions/page.tsx | 3 + frontend/app/beauty/admin/reports/page.tsx | 3 + frontend/app/beauty/admin/settings/page.tsx | 3 + frontend/app/beauty/admin/staff/page.tsx | 3 + frontend/app/beauty/auth/2fa/page.tsx | 3 + .../app/beauty/auth/forgot-password/page.tsx | 3 + frontend/app/beauty/auth/login/page.tsx | 3 + frontend/app/beauty/auth/otp/page.tsx | 3 + .../beauty/auth/profile-completion/page.tsx | 3 + frontend/app/beauty/auth/register/page.tsx | 3 + .../customer/appointments/book/page.tsx | 3 + .../customer/appointments/past/page.tsx | 3 + .../customer/appointments/upcoming/page.tsx | 3 + .../customer/favorites/centers/page.tsx | 3 + .../app/beauty/customer/favorites/page.tsx | 3 + .../beauty/customer/favorites/staff/page.tsx | 3 + .../app/beauty/customer/invoices/page.tsx | 3 + frontend/app/beauty/customer/layout.tsx | 5 + frontend/app/beauty/customer/loyalty/page.tsx | 3 + .../app/beauty/customer/memberships/page.tsx | 3 + .../app/beauty/customer/messages/page.tsx | 3 + .../beauty/customer/notifications/page.tsx | 3 + .../app/beauty/customer/packages/page.tsx | 3 + frontend/app/beauty/customer/page.tsx | 3 + .../app/beauty/customer/payments/page.tsx | 3 + frontend/app/beauty/customer/profile/page.tsx | 3 + frontend/app/beauty/customer/reviews/page.tsx | 3 + .../app/beauty/customer/sessions/page.tsx | 3 + .../app/beauty/customer/settings/page.tsx | 3 + frontend/app/beauty/customer/wallet/page.tsx | 3 + frontend/app/beauty/hub/page.tsx | 3 + frontend/app/beauty/layout.tsx | 4 + frontend/app/beauty/mobile/[portal]/page.tsx | 3 + .../owner/accounting-integration/page.tsx | 3 + frontend/app/beauty/owner/analytics/page.tsx | 3 + frontend/app/beauty/owner/calendar/page.tsx | 3 + frontend/app/beauty/owner/coupons/page.tsx | 3 + .../app/beauty/owner/crm-integration/page.tsx | 3 + frontend/app/beauty/owner/layout.tsx | 5 + frontend/app/beauty/owner/marketing/page.tsx | 3 + frontend/app/beauty/page.tsx | 5 + .../app/beauty/reception/calendar/page.tsx | 3 + .../app/beauty/reception/check-in/page.tsx | 3 + .../app/beauty/reception/check-out/page.tsx | 3 + frontend/app/beauty/reception/layout.tsx | 5 + frontend/app/beauty/reception/page.tsx | 3 + .../app/beauty/reception/payments/page.tsx | 3 + frontend/app/beauty/reception/queue/page.tsx | 3 + .../app/beauty/reception/reports/page.tsx | 3 + .../app/beauty/reception/walk-in/page.tsx | 3 + frontend/app/beauty/site/about/page.tsx | 3 + frontend/app/beauty/site/book/page.tsx | 3 + .../app/beauty/site/book/success/page.tsx | 3 + frontend/app/beauty/site/campaigns/page.tsx | 3 + frontend/app/beauty/site/center/[id]/page.tsx | 3 + frontend/app/beauty/site/contact/page.tsx | 3 + frontend/app/beauty/site/faq/page.tsx | 3 + frontend/app/beauty/site/features/page.tsx | 3 + frontend/app/beauty/site/find-laser/page.tsx | 3 + frontend/app/beauty/site/find-salon/page.tsx | 3 + frontend/app/beauty/site/find-spa/page.tsx | 3 + frontend/app/beauty/site/gallery/page.tsx | 3 + frontend/app/beauty/site/layout.tsx | 5 + frontend/app/beauty/site/packages/page.tsx | 3 + frontend/app/beauty/site/page.tsx | 3 + frontend/app/beauty/site/pricing/page.tsx | 3 + frontend/app/beauty/site/reviews/page.tsx | 3 + frontend/app/beauty/site/salon/[id]/page.tsx | 3 + frontend/app/beauty/site/search/page.tsx | 3 + .../app/beauty/site/service/[id]/page.tsx | 3 + frontend/app/beauty/site/staff/[id]/page.tsx | 3 + .../app/beauty/site/tracking/[id]/page.tsx | 3 + .../beauty/staff-portal/appointments/page.tsx | 3 + .../beauty/staff-portal/commission/page.tsx | 3 + frontend/app/beauty/staff-portal/layout.tsx | 5 + .../staff-portal/notifications/page.tsx | 3 + frontend/app/beauty/staff-portal/page.tsx | 3 + .../app/beauty/staff-portal/schedule/page.tsx | 3 + .../app/beauty/staff-portal/settings/page.tsx | 3 + .../app/healthcare/admin/analytics/page.tsx | 3 + .../app/healthcare/admin/clinics/page.tsx | 3 + .../app/healthcare/admin/doctors/page.tsx | 3 + frontend/app/healthcare/admin/layout.tsx | 5 + frontend/app/healthcare/admin/logs/page.tsx | 3 + .../app/healthcare/admin/monitoring/page.tsx | 3 + .../healthcare/admin/organizations/page.tsx | 3 + frontend/app/healthcare/admin/page.tsx | 3 + .../app/healthcare/admin/patients/page.tsx | 3 + .../app/healthcare/admin/permissions/page.tsx | 3 + .../app/healthcare/admin/pharmacies/page.tsx | 3 + .../app/healthcare/admin/reports/page.tsx | 3 + .../app/healthcare/admin/settings/page.tsx | 3 + frontend/app/healthcare/admin/users/page.tsx | 3 + frontend/app/healthcare/appointments/page.tsx | 13 + frontend/app/healthcare/auth/login/page.tsx | 3 + frontend/app/healthcare/branches/page.tsx | 13 + .../app/healthcare/clinic-management/page.tsx | 13 + .../clinic/accounting-integration/page.tsx | 3 + .../clinic/crm-integration/page.tsx | 3 + .../healthcare/clinic/departments/page.tsx | 3 + .../app/healthcare/clinic/doctors/page.tsx | 3 + frontend/app/healthcare/clinic/layout.tsx | 5 + frontend/app/healthcare/clinic/page.tsx | 3 + .../app/healthcare/clinic/patients/page.tsx | 3 + .../healthcare/clinic/receptionists/page.tsx | 3 + .../app/healthcare/clinic/reports/page.tsx | 3 + .../app/healthcare/clinic/resources/page.tsx | 3 + frontend/app/healthcare/clinic/rooms/page.tsx | 3 + .../app/healthcare/clinic/schedules/page.tsx | 3 + frontend/app/healthcare/clinics/page.tsx | 13 + frontend/app/healthcare/delivery/page.tsx | 13 + frontend/app/healthcare/departments/page.tsx | 13 + frontend/app/healthcare/doctor-panel/page.tsx | 13 + .../app/healthcare/doctor/analytics/page.tsx | 3 + .../healthcare/doctor/appointments/page.tsx | 3 + .../healthcare/doctor/availability/page.tsx | 3 + .../app/healthcare/doctor/income/page.tsx | 3 + frontend/app/healthcare/doctor/layout.tsx | 5 + .../app/healthcare/doctor/leaves/page.tsx | 3 + .../doctor/medical-records/page.tsx | 3 + .../app/healthcare/doctor/messages/page.tsx | 3 + .../healthcare/doctor/notifications/page.tsx | 3 + frontend/app/healthcare/doctor/page.tsx | 3 + .../app/healthcare/doctor/patients/page.tsx | 3 + .../healthcare/doctor/prescriptions/page.tsx | 3 + .../app/healthcare/doctor/reports/page.tsx | 3 + .../doctor/schedule/calendar/page.tsx | 3 + .../healthcare/doctor/schedule/today/page.tsx | 3 + .../app/healthcare/doctor/settings/page.tsx | 3 + frontend/app/healthcare/doctors/page.tsx | 13 + .../healthcare/hospital/appointments/page.tsx | 3 + .../app/healthcare/hospital/beds/page.tsx | 3 + .../app/healthcare/hospital/clinics/page.tsx | 3 + .../healthcare/hospital/departments/page.tsx | 3 + .../app/healthcare/hospital/doctors/page.tsx | 3 + frontend/app/healthcare/hospital/layout.tsx | 5 + frontend/app/healthcare/hospital/page.tsx | 3 + .../app/healthcare/hospital/reports/page.tsx | 3 + .../healthcare/hospital/resources/page.tsx | 3 + .../app/healthcare/hospital/staff/page.tsx | 3 + frontend/app/healthcare/hub/page.tsx | 3 + frontend/app/healthcare/layout.tsx | 4 + .../app/healthcare/medical-records/page.tsx | 13 + .../app/healthcare/mobile/[portal]/page.tsx | 3 + frontend/app/healthcare/page.tsx | 13 + .../app/healthcare/patient-portal/page.tsx | 13 + .../patient/appointments/book/page.tsx | 3 + .../patient/appointments/past/page.tsx | 3 + .../patient/appointments/upcoming/page.tsx | 3 + .../app/healthcare/patient/family/page.tsx | 3 + .../app/healthcare/patient/favorites/page.tsx | 3 + .../app/healthcare/patient/invoices/page.tsx | 3 + .../healthcare/patient/lab-results/page.tsx | 3 + frontend/app/healthcare/patient/layout.tsx | 5 + .../patient/medical-history/page.tsx | 3 + .../app/healthcare/patient/messages/page.tsx | 3 + .../healthcare/patient/notifications/page.tsx | 3 + frontend/app/healthcare/patient/page.tsx | 3 + .../app/healthcare/patient/payments/page.tsx | 3 + .../healthcare/patient/prescriptions/page.tsx | 3 + .../app/healthcare/patient/profile/page.tsx | 3 + .../app/healthcare/patient/reviews/page.tsx | 3 + .../app/healthcare/patient/settings/page.tsx | 3 + frontend/app/healthcare/patients/page.tsx | 13 + .../pharmacy-portal/delivered/page.tsx | 3 + .../pharmacy-portal/delivery/page.tsx | 3 + .../pharmacy-portal/incoming/page.tsx | 3 + .../app/healthcare/pharmacy-portal/layout.tsx | 5 + .../app/healthcare/pharmacy-portal/page.tsx | 3 + .../pharmacy-portal/preparation/page.tsx | 3 + .../healthcare/pharmacy-portal/ready/page.tsx | 3 + .../pharmacy-portal/reports/page.tsx | 3 + frontend/app/healthcare/pharmacy/page.tsx | 13 + .../healthcare/reception/calendar/page.tsx | 3 + .../healthcare/reception/check-in/page.tsx | 3 + .../healthcare/reception/check-out/page.tsx | 3 + .../app/healthcare/reception/doctors/page.tsx | 3 + frontend/app/healthcare/reception/layout.tsx | 5 + frontend/app/healthcare/reception/page.tsx | 3 + .../healthcare/reception/patients/page.tsx | 3 + .../healthcare/reception/payments/page.tsx | 3 + .../app/healthcare/reception/queue/page.tsx | 3 + .../app/healthcare/reception/reports/page.tsx | 3 + .../app/healthcare/reception/walk-in/page.tsx | 3 + frontend/app/healthcare/settings/page.tsx | 13 + frontend/app/healthcare/site/about/page.tsx | 3 + frontend/app/healthcare/site/book/page.tsx | 3 + .../app/healthcare/site/book/success/page.tsx | 3 + .../app/healthcare/site/clinic/[id]/page.tsx | 3 + frontend/app/healthcare/site/contact/page.tsx | 3 + .../app/healthcare/site/doctor/[id]/page.tsx | 3 + frontend/app/healthcare/site/faq/page.tsx | 3 + .../app/healthcare/site/features/page.tsx | 3 + .../app/healthcare/site/find-clinic/page.tsx | 3 + .../app/healthcare/site/find-doctor/page.tsx | 3 + .../healthcare/site/find-hospital/page.tsx | 3 + .../healthcare/site/hospital/[id]/page.tsx | 3 + frontend/app/healthcare/site/layout.tsx | 5 + frontend/app/healthcare/site/page.tsx | 3 + frontend/app/healthcare/site/pricing/page.tsx | 3 + frontend/app/healthcare/site/search/page.tsx | 3 + .../healthcare/site/tracking/[id]/page.tsx | 3 + .../app/sports-center/access-logs/error.tsx | 7 + .../app/sports-center/access-logs/loading.tsx | 5 + .../app/sports-center/access-logs/page.tsx | 3 + frontend/app/sports-center/admin/error.tsx | 7 + frontend/app/sports-center/admin/loading.tsx | 5 + frontend/app/sports-center/admin/page.tsx | 3 + .../app/sports-center/analytics/error.tsx | 7 + .../app/sports-center/analytics/loading.tsx | 5 + frontend/app/sports-center/analytics/page.tsx | 3 + .../athlete/achievements/error.tsx | 7 + .../athlete/achievements/loading.tsx | 5 + .../athlete/achievements/page.tsx | 3 + .../athlete/attendance/error.tsx | 7 + .../athlete/attendance/loading.tsx | 5 + .../sports-center/athlete/attendance/page.tsx | 3 + .../sports-center/athlete/bookings/error.tsx | 7 + .../athlete/bookings/loading.tsx | 5 + .../sports-center/athlete/bookings/page.tsx | 3 + frontend/app/sports-center/athlete/error.tsx | 7 + .../app/sports-center/athlete/loading.tsx | 5 + .../athlete/measurements/error.tsx | 7 + .../athlete/measurements/loading.tsx | 5 + .../athlete/measurements/page.tsx | 3 + .../athlete/membership/error.tsx | 7 + .../athlete/membership/loading.tsx | 5 + .../sports-center/athlete/membership/page.tsx | 3 + .../sports-center/athlete/nutrition/error.tsx | 7 + .../athlete/nutrition/loading.tsx | 5 + .../sports-center/athlete/nutrition/page.tsx | 3 + frontend/app/sports-center/athlete/page.tsx | 3 + .../sports-center/athlete/profile/error.tsx | 7 + .../sports-center/athlete/profile/loading.tsx | 5 + .../sports-center/athlete/profile/page.tsx | 3 + .../sports-center/athlete/progress/error.tsx | 7 + .../athlete/progress/loading.tsx | 5 + .../sports-center/athlete/progress/page.tsx | 3 + .../app/sports-center/athlete/qr/error.tsx | 7 + .../app/sports-center/athlete/qr/loading.tsx | 5 + .../app/sports-center/athlete/qr/page.tsx | 3 + .../sports-center/athlete/workout/error.tsx | 7 + .../sports-center/athlete/workout/loading.tsx | 5 + .../sports-center/athlete/workout/page.tsx | 3 + .../attendance-gateways/error.tsx | 7 + .../attendance-gateways/loading.tsx | 5 + .../attendance-gateways/page.tsx | 3 + .../app/sports-center/attendance/error.tsx | 7 + .../app/sports-center/attendance/loading.tsx | 5 + .../app/sports-center/attendance/page.tsx | 3 + .../app/sports-center/audit-logs/error.tsx | 7 + .../app/sports-center/audit-logs/loading.tsx | 5 + .../app/sports-center/audit-logs/page.tsx | 3 + frontend/app/sports-center/bookings/error.tsx | 7 + .../app/sports-center/bookings/loading.tsx | 5 + frontend/app/sports-center/bookings/page.tsx | 3 + frontend/app/sports-center/branches/error.tsx | 7 + .../app/sports-center/branches/loading.tsx | 5 + frontend/app/sports-center/branches/page.tsx | 3 + frontend/app/sports-center/calendar/error.tsx | 7 + .../app/sports-center/calendar/loading.tsx | 5 + frontend/app/sports-center/calendar/page.tsx | 3 + .../app/sports-center/capabilities/error.tsx | 7 + .../sports-center/capabilities/loading.tsx | 5 + .../app/sports-center/capabilities/page.tsx | 3 + frontend/app/sports-center/cashier/error.tsx | 7 + .../app/sports-center/cashier/loading.tsx | 5 + frontend/app/sports-center/cashier/page.tsx | 3 + .../catalog/age-groups/error.tsx | 7 + .../catalog/age-groups/loading.tsx | 5 + .../sports-center/catalog/age-groups/page.tsx | 3 + .../catalog/expiration-policies/error.tsx | 7 + .../catalog/expiration-policies/loading.tsx | 5 + .../catalog/expiration-policies/page.tsx | 3 + .../catalog/freezing-rules/error.tsx | 7 + .../catalog/freezing-rules/loading.tsx | 5 + .../catalog/freezing-rules/page.tsx | 3 + .../sports-center/catalog/packages/error.tsx | 7 + .../catalog/packages/loading.tsx | 5 + .../sports-center/catalog/packages/page.tsx | 3 + .../app/sports-center/catalog/plans/error.tsx | 7 + .../sports-center/catalog/plans/loading.tsx | 5 + .../app/sports-center/catalog/plans/page.tsx | 3 + .../catalog/pricing-models/error.tsx | 7 + .../catalog/pricing-models/loading.tsx | 5 + .../catalog/pricing-models/page.tsx | 3 + .../catalog/renewal-policies/error.tsx | 7 + .../catalog/renewal-policies/loading.tsx | 5 + .../catalog/renewal-policies/page.tsx | 3 + .../app/sports-center/catalog/rules/error.tsx | 7 + .../sports-center/catalog/rules/loading.tsx | 5 + .../app/sports-center/catalog/rules/page.tsx | 3 + .../catalog/sport-categories/error.tsx | 7 + .../catalog/sport-categories/loading.tsx | 5 + .../catalog/sport-categories/page.tsx | 3 + .../app/sports-center/challenges/error.tsx | 7 + .../app/sports-center/challenges/loading.tsx | 5 + .../app/sports-center/challenges/page.tsx | 3 + frontend/app/sports-center/classes/error.tsx | 7 + .../app/sports-center/classes/loading.tsx | 5 + frontend/app/sports-center/classes/page.tsx | 3 + frontend/app/sports-center/coach/error.tsx | 7 + frontend/app/sports-center/coach/loading.tsx | 5 + .../sports-center/coach/messages/error.tsx | 7 + .../sports-center/coach/messages/loading.tsx | 5 + .../app/sports-center/coach/messages/page.tsx | 3 + frontend/app/sports-center/coach/page.tsx | 3 + .../sports-center/coach/schedule/error.tsx | 7 + .../sports-center/coach/schedule/loading.tsx | 5 + .../app/sports-center/coach/schedule/page.tsx | 3 + frontend/app/sports-center/coaches/error.tsx | 7 + .../app/sports-center/coaches/loading.tsx | 5 + frontend/app/sports-center/coaches/page.tsx | 3 + .../app/sports-center/competitions/error.tsx | 7 + .../sports-center/competitions/loading.tsx | 5 + .../app/sports-center/competitions/page.tsx | 3 + .../competitions/results/error.tsx | 7 + .../competitions/results/loading.tsx | 5 + .../competitions/results/page.tsx | 3 + .../competitions/teams/error.tsx | 7 + .../competitions/teams/loading.tsx | 5 + .../sports-center/competitions/teams/page.tsx | 3 + frontend/app/sports-center/courts/error.tsx | 7 + frontend/app/sports-center/courts/loading.tsx | 5 + frontend/app/sports-center/courts/page.tsx | 3 + .../sports-center/device-providers/error.tsx | 7 + .../device-providers/loading.tsx | 5 + .../sports-center/device-providers/page.tsx | 3 + frontend/app/sports-center/devices/error.tsx | 7 + .../app/sports-center/devices/loading.tsx | 5 + frontend/app/sports-center/devices/page.tsx | 3 + .../digital-membership/error.tsx | 7 + .../digital-membership/loading.tsx | 5 + .../sports-center/digital-membership/page.tsx | 3 + .../app/sports-center/equipment/error.tsx | 7 + .../app/sports-center/equipment/loading.tsx | 5 + frontend/app/sports-center/equipment/page.tsx | 3 + frontend/app/sports-center/events/error.tsx | 7 + frontend/app/sports-center/events/loading.tsx | 5 + frontend/app/sports-center/events/page.tsx | 3 + .../sports-center/exercise-library/error.tsx | 7 + .../exercise-library/loading.tsx | 5 + .../sports-center/exercise-library/page.tsx | 3 + .../app/sports-center/facilities/error.tsx | 7 + .../app/sports-center/facilities/loading.tsx | 5 + .../app/sports-center/facilities/page.tsx | 3 + frontend/app/sports-center/families/error.tsx | 7 + .../app/sports-center/families/loading.tsx | 5 + frontend/app/sports-center/families/page.tsx | 3 + frontend/app/sports-center/health/error.tsx | 7 + frontend/app/sports-center/health/loading.tsx | 5 + frontend/app/sports-center/health/page.tsx | 3 + frontend/app/sports-center/hub/page.tsx | 3 + .../integrations/accounting/error.tsx | 7 + .../integrations/accounting/loading.tsx | 5 + .../integrations/accounting/page.tsx | 3 + .../sports-center/integrations/ai/error.tsx | 7 + .../sports-center/integrations/ai/loading.tsx | 5 + .../sports-center/integrations/ai/page.tsx | 3 + .../integrations/communication/error.tsx | 7 + .../integrations/communication/loading.tsx | 5 + .../integrations/communication/page.tsx | 3 + .../sports-center/integrations/crm/error.tsx | 7 + .../integrations/crm/loading.tsx | 5 + .../sports-center/integrations/crm/page.tsx | 3 + .../integrations/loyalty/error.tsx | 7 + .../integrations/loyalty/loading.tsx | 5 + .../integrations/loyalty/page.tsx | 3 + frontend/app/sports-center/layout.tsx | 5 + .../app/sports-center/locker-rooms/error.tsx | 7 + .../sports-center/locker-rooms/loading.tsx | 5 + .../app/sports-center/locker-rooms/page.tsx | 3 + frontend/app/sports-center/lockers/error.tsx | 7 + .../app/sports-center/lockers/loading.tsx | 5 + frontend/app/sports-center/lockers/page.tsx | 3 + .../sports-center/medical-records/error.tsx | 7 + .../sports-center/medical-records/loading.tsx | 5 + .../sports-center/medical-records/page.tsx | 3 + frontend/app/sports-center/members/error.tsx | 7 + .../app/sports-center/members/loading.tsx | 5 + frontend/app/sports-center/members/page.tsx | 3 + .../sports-center/membership-cards/error.tsx | 7 + .../membership-cards/loading.tsx | 5 + .../sports-center/membership-cards/page.tsx | 3 + .../sports-center/membership-types/error.tsx | 7 + .../membership-types/loading.tsx | 5 + .../sports-center/membership-types/page.tsx | 3 + .../app/sports-center/memberships/error.tsx | 7 + .../app/sports-center/memberships/loading.tsx | 5 + .../app/sports-center/memberships/page.tsx | 3 + .../app/sports-center/notifications/error.tsx | 7 + .../sports-center/notifications/loading.tsx | 5 + .../app/sports-center/notifications/page.tsx | 3 + frontend/app/sports-center/owner/page.tsx | 3 + frontend/app/sports-center/page.tsx | 5 + frontend/app/sports-center/parent/error.tsx | 7 + frontend/app/sports-center/parent/loading.tsx | 5 + frontend/app/sports-center/parent/page.tsx | 3 + .../app/sports-center/permissions/error.tsx | 7 + .../app/sports-center/permissions/loading.tsx | 5 + .../app/sports-center/permissions/page.tsx | 3 + .../app/sports-center/qr-access/error.tsx | 7 + .../app/sports-center/qr-access/loading.tsx | 5 + frontend/app/sports-center/qr-access/page.tsx | 3 + .../reception/check-in/error.tsx | 7 + .../reception/check-in/loading.tsx | 5 + .../sports-center/reception/check-in/page.tsx | 3 + .../app/sports-center/reception/error.tsx | 7 + .../app/sports-center/reception/loading.tsx | 5 + frontend/app/sports-center/reception/page.tsx | 3 + .../reception/qr-scanner/error.tsx | 7 + .../reception/qr-scanner/loading.tsx | 5 + .../reception/qr-scanner/page.tsx | 3 + frontend/app/sports-center/reports/error.tsx | 7 + .../app/sports-center/reports/loading.tsx | 5 + frontend/app/sports-center/reports/page.tsx | 3 + frontend/app/sports-center/roles/error.tsx | 7 + frontend/app/sports-center/roles/loading.tsx | 5 + frontend/app/sports-center/roles/page.tsx | 3 + frontend/app/sports-center/rooms/error.tsx | 7 + frontend/app/sports-center/rooms/loading.tsx | 5 + frontend/app/sports-center/rooms/page.tsx | 3 + frontend/app/sports-center/sessions/error.tsx | 7 + .../app/sports-center/sessions/loading.tsx | 5 + frontend/app/sports-center/sessions/page.tsx | 3 + frontend/app/sports-center/settings/error.tsx | 7 + .../app/sports-center/settings/loading.tsx | 5 + frontend/app/sports-center/settings/page.tsx | 3 + .../sports-center/sports-centers/error.tsx | 7 + .../sports-center/sports-centers/loading.tsx | 5 + .../app/sports-center/sports-centers/page.tsx | 3 + frontend/app/sports-center/sports/error.tsx | 7 + frontend/app/sports-center/sports/loading.tsx | 5 + frontend/app/sports-center/sports/page.tsx | 3 + .../sports-center/staff/assignments/error.tsx | 7 + .../staff/assignments/loading.tsx | 5 + .../sports-center/staff/assignments/page.tsx | 3 + .../staff/availability/error.tsx | 7 + .../staff/availability/loading.tsx | 5 + .../sports-center/staff/availability/page.tsx | 3 + .../staff/certificates/error.tsx | 7 + .../staff/certificates/loading.tsx | 5 + .../sports-center/staff/certificates/page.tsx | 3 + .../app/sports-center/staff/skills/error.tsx | 7 + .../sports-center/staff/skills/loading.tsx | 5 + .../app/sports-center/staff/skills/page.tsx | 3 + .../staff/working-hours/error.tsx | 7 + .../staff/working-hours/loading.tsx | 5 + .../staff/working-hours/page.tsx | 3 + frontend/app/sports-center/support/error.tsx | 7 + .../app/sports-center/support/loading.tsx | 5 + frontend/app/sports-center/support/page.tsx | 3 + .../training/exercises/error.tsx | 7 + .../training/exercises/loading.tsx | 5 + .../sports-center/training/exercises/page.tsx | 3 + .../training/measurements/error.tsx | 7 + .../training/measurements/loading.tsx | 5 + .../training/measurements/page.tsx | 3 + .../training/nutrition/error.tsx | 7 + .../training/nutrition/loading.tsx | 5 + .../sports-center/training/nutrition/page.tsx | 3 + .../sports-center/training/programs/error.tsx | 7 + .../training/programs/loading.tsx | 5 + .../sports-center/training/programs/page.tsx | 3 + .../sports-center/training/progress/error.tsx | 7 + .../training/progress/loading.tsx | 5 + .../sports-center/training/progress/page.tsx | 3 + .../training/workout-assignments/error.tsx | 7 + .../training/workout-assignments/loading.tsx | 5 + .../training/workout-assignments/page.tsx | 3 + .../training/workout-plans/error.tsx | 7 + .../training/workout-plans/loading.tsx | 5 + .../training/workout-plans/page.tsx | 3 + .../sports-center/workout-programs/error.tsx | 7 + .../workout-programs/loading.tsx | 5 + .../sports-center/workout-programs/page.tsx | 3 + frontend/components/ds/Button.tsx | 18 +- frontend/docs/README.md | 24 + frontend/docs/accounting-migration-report.md | 190 + frontend/docs/beauty-migration-report.md | 240 + frontend/docs/dependency-report.md | 288 ++ frontend/docs/frontend-architecture-audit.md | 389 ++ frontend/docs/frontend-architecture.md | 114 +- frontend/docs/frontend-migration-plan.md | 265 + frontend/docs/healthcare-migration-report.md | 199 + frontend/docs/import-report.md | 377 ++ frontend/docs/module-boundaries.md | 288 ++ frontend/docs/refactor-risk-analysis.md | 318 ++ frontend/docs/shared-components-report.md | 327 ++ frontend/hooks/useBeautyLookups.ts | 2 + frontend/hooks/useHealthcareDoctorContext.ts | 2 + frontend/hooks/useHealthcareLookups.ts | 2 + frontend/hooks/useHealthcarePatientContext.ts | 2 + frontend/lib/accounting-api.ts | 1858 +------ frontend/lib/accounting-nav.ts | 336 +- frontend/lib/accounting-scoreboard.ts | 101 +- frontend/lib/beauty-business-api.ts | 2 + frontend/lib/beauty-business-nav.ts | 121 + frontend/lib/beauty-portals.ts | 2 + frontend/lib/healthcare-api.ts | 2 + frontend/lib/healthcare-portals.ts | 2 + frontend/lib/sports-center-api.ts | 2 + frontend/modules/beauty/README.md | 48 + frontend/modules/beauty/calendar/README.md | 3 + frontend/modules/beauty/charts/README.md | 3 + .../beauty/components/BeautyBusinessShell.tsx | 194 + .../beauty/components/BeautyPortalShell.tsx | 188 + .../beauty/components/PublicBeautyLayout.tsx | 59 + .../beauty/components/createPortalLayout.tsx | 43 + frontend/modules/beauty/constants/portals.ts | 321 ++ .../beauty/design-system/BeautyCards.tsx | 288 ++ .../beauty/design-system/BeautyPrimitives.tsx | 97 + .../beauty/design-system/BeautyStatusChip.tsx | 50 + .../beauty/design-system/BeautyTablePage.tsx | 68 + .../modules/beauty/design-system/index.ts | 5 + .../modules/beauty/design-system/tokens.ts | 34 + .../beauty/features/owner/appointments.tsx | 213 + .../features/owner/booking-schedules.tsx | 54 + .../features/owner/booking-waiting-list.tsx | 44 + .../beauty/features/owner/branches.tsx | 156 + .../features/owner/catalog-categories.tsx | 48 + .../features/owner/catalog-services.tsx | 166 + .../beauty/features/owner/customers.tsx | 156 + .../features/owner/marketing-campaigns.tsx | 141 + .../features/owner/marketing-integrations.tsx | 98 + .../beauty/features/owner/organizations.tsx | 245 + .../features/owner/packages-memberships.tsx | 54 + .../beauty/features/owner/packages.tsx | 54 + .../beauty/features/owner/salon-policies.tsx | 48 + .../beauty/features/owner/salon-rooms.tsx | 48 + .../beauty/features/owner/salon-stations.tsx | 47 + .../beauty/features/owner/settings.tsx | 168 + .../features/owner/staff-commissions.tsx | 49 + .../modules/beauty/features/owner/staff.tsx | 200 + frontend/modules/beauty/forms/README.md | 3 + .../modules/beauty/hooks/useBeautyLookups.ts | 82 + frontend/modules/beauty/index.ts | 8 + frontend/modules/beauty/pages/admin.tsx | 164 + frontend/modules/beauty/pages/customer.tsx | 442 ++ frontend/modules/beauty/pages/hub.tsx | 202 + frontend/modules/beauty/pages/mobile.tsx | 47 + frontend/modules/beauty/pages/owner.tsx | 179 + frontend/modules/beauty/pages/public.tsx | 753 +++ frontend/modules/beauty/pages/reception.tsx | 197 + frontend/modules/beauty/pages/shared.tsx | 313 ++ .../modules/beauty/pages/staff-portal.tsx | 158 + .../beauty/services/beauty-business-api.ts | 1446 ++++++ frontend/modules/beauty/tables/README.md | 3 + frontend/modules/beauty/types/index.ts | 12 + frontend/modules/beauty/utils/README.md | 3 + .../components/SportsCenterBreadcrumbs.tsx | 16 + .../components/SportsCenterFeatureGate.tsx | 25 + .../components/SportsCenterListCrudPage.tsx | 360 ++ .../components/SportsCenterPortalShell.tsx | 173 + .../components/createPortalLayout.tsx | 63 + .../sports-center/constants/portals.ts | 362 ++ .../design-system/SportsCenterStatusChip.tsx | 26 + .../design-system/SportsCenterTablePage.tsx | 78 + .../sports-center/design-system/index.ts | 3 + .../sports-center/design-system/tokens.ts | 40 + .../sports-center/features/accessLogs.tsx | 28 + .../sports-center/features/ageGroups.tsx | 41 + .../sports-center/features/analytics.tsx | 85 + .../sports-center/features/athlete.tsx | 112 + .../sports-center/features/attendance.tsx | 39 + .../features/attendanceGateways.tsx | 40 + .../sports-center/features/bookings.tsx | 39 + .../sports-center/features/branches.tsx | 45 + .../sports-center/features/capabilities.tsx | 43 + .../sports-center/features/coaches.tsx | 44 + .../features/competitionResults.tsx | 33 + .../sports-center/features/competitions.tsx | 46 + .../modules/sports-center/features/courts.tsx | 40 + .../sports-center/features/dashboard.tsx | 74 + .../features/deviceProviders.tsx | 40 + .../sports-center/features/devices.tsx | 45 + .../features/digitalMembership.tsx | 38 + .../sports-center/features/equipment.tsx | 42 + .../modules/sports-center/features/events.tsx | 40 + .../sports-center/features/exercises.tsx | 42 + .../features/expirationPolicies.tsx | 41 + .../sports-center/features/facilities.tsx | 40 + .../sports-center/features/families.tsx | 42 + .../sports-center/features/freezingRules.tsx | 41 + .../modules/sports-center/features/health.tsx | 44 + .../modules/sports-center/features/hub.tsx | 72 + .../sports-center/features/integrations.tsx | 82 + .../sports-center/features/lockerRooms.tsx | 40 + .../sports-center/features/lockers.tsx | 41 + .../sports-center/features/measurements.tsx | 33 + .../sports-center/features/medicalRecords.tsx | 37 + .../sports-center/features/members.tsx | 48 + .../features/membershipCards.tsx | 38 + .../features/membershipPackages.tsx | 41 + .../features/membershipPlans.tsx | 41 + .../features/membershipRules.tsx | 41 + .../features/membershipTypes.tsx | 45 + .../sports-center/features/memberships.tsx | 36 + .../sports-center/features/nutrition.tsx | 38 + .../sports-center/features/permissions.tsx | 40 + .../sports-center/features/pricingModels.tsx | 41 + .../sports-center/features/progress.tsx | 33 + .../sports-center/features/reception.tsx | 73 + .../features/renewalPolicies.tsx | 41 + .../modules/sports-center/features/roles.tsx | 40 + .../modules/sports-center/features/rooms.tsx | 40 + .../sports-center/features/sessions.tsx | 39 + .../sports-center/features/settings.tsx | 41 + .../features/sportCategories.tsx | 41 + .../modules/sports-center/features/sports.tsx | 44 + .../sports-center/features/sportsCenters.tsx | 40 + .../features/staffAssignments.tsx | 34 + .../features/staffAvailability.tsx | 35 + .../features/staffCertificates.tsx | 43 + .../sports-center/features/staffSkills.tsx | 39 + .../features/staffWorkingHours.tsx | 34 + .../modules/sports-center/features/teams.tsx | 39 + .../features/trainingPrograms.tsx | 42 + .../features/workoutAssignments.tsx | 38 + .../sports-center/features/workoutPlans.tsx | 33 + .../hooks/useSportsCenterCapabilities.ts | 19 + .../hooks/useSportsCenterLookups.ts | 22 + frontend/modules/sports-center/index.ts | 3 + .../modules/sports-center/pages/shared.tsx | 42 + .../services/sports-center-api.ts | 360 ++ frontend/modules/sports-center/types/index.ts | 70 + frontend/next.config.mjs | 21 + frontend/package-lock.json | 4304 ++++++++++++++++- frontend/package.json | 5 + .../scripts/fix-accounting-collisions.mjs | 34 + frontend/scripts/fix-accounting-exports.mjs | 61 + .../scripts/generate-healthcare-routes.mjs | 246 + .../scripts/generate-sports-center-routes.mjs | 126 + .../generate-sports-center-special-routes.mjs | 67 + .../scripts/migrate-accounting-imports.mjs | 56 + frontend/scripts/migrate-accounting-pages.mjs | 85 + frontend/scripts/migrate-beauty-imports.mjs | 50 + .../scripts/migrate-healthcare-imports.mjs | 63 + frontend/scripts/recreate-owner-routes.mjs | 40 + .../scripts/validate-accounting-bundle.mjs | 37 + .../scripts/validate-accounting-circular.mjs | 75 + .../scripts/validate-accounting-imports.mjs | 91 + .../scripts/validate-accounting-routes.mjs | 63 + frontend/scripts/validate-architecture.mjs | 11 +- frontend/scripts/validate-beauty-bundle.mjs | 41 + frontend/scripts/validate-beauty-imports.mjs | 88 + frontend/scripts/validate-beauty-routes.mjs | 85 + .../scripts/validate-healthcare-bundle.mjs | 37 + .../scripts/validate-healthcare-circular.mjs | 79 + .../scripts/validate-healthcare-imports.mjs | 92 + .../scripts/validate-healthcare-routes.mjs | 67 + frontend/shared/README.md | 68 + frontend/shared/api/README.md | 29 + frontend/shared/calendar/README.md | 25 + frontend/shared/charts/README.md | 25 + frontend/shared/constants/README.md | 26 + frontend/shared/design-system/README.md | 30 + frontend/shared/forms/README.md | 31 + frontend/shared/hooks/README.md | 26 + frontend/shared/icons/README.md | 24 + frontend/shared/layouts/README.md | 34 + frontend/shared/providers/README.md | 27 + frontend/shared/tables/README.md | 26 + frontend/shared/theme/README.md | 23 + frontend/shared/types/README.md | 25 + frontend/shared/ui/README.md | 30 + frontend/shared/utils/README.md | 25 + .../components}/AccountingShell.tsx | 4 +- .../components}/BusinessDocsPage.tsx | 6 +- .../components}/CompletionScoreboard.tsx | 4 +- .../accounting/components}/DomainScreens.tsx | 6 +- .../accounting/components}/EntityCombobox.tsx | 4 +- .../components}/OperationalDocumentPage.tsx | 6 +- .../components}/SpecializedOpsPage.tsx | 6 +- .../components}/WorkflowScreens.tsx | 4 +- .../accounting/constants/accounting-nav.ts | 334 ++ frontend/src/modules/accounting/index.ts | 5 + .../layout/AccountingLayoutGate.tsx | 62 + frontend/src/modules/accounting/pages/ai.tsx | 7 + .../modules/accounting/pages/ai/analytics.tsx | 7 + .../modules/accounting/pages/ai/anomalies.tsx | 7 + .../modules/accounting/pages/ai/documents.tsx | 7 + .../modules/accounting/pages/ai/forecasts.tsx | 7 + .../src/modules/accounting/pages/ai/qa.tsx | 7 + .../accounting/pages/ai/recommendations.tsx | 7 + .../accounting/pages/ai/reconciliation.tsx | 7 + .../src/modules/accounting/pages/assets.tsx | 422 ++ .../accounting/pages/assets/accumulated.tsx | 3 + .../accounting/pages/assets/dashboard.tsx | 5 + .../accounting/pages/assets/depreciate.tsx | 5 + .../accounting/pages/assets/dispose.tsx | 3 + .../accounting/pages/assets/schedule.tsx | 5 + .../accounting/pages/assets/transfers.tsx | 3 + .../accounting/pages/assets/valuation.tsx | 3 + .../src/modules/accounting/pages/audit.tsx | 136 + .../accounting/pages/budget/control.tsx | 23 + .../accounting/pages/budget/definitions.tsx | 23 + .../accounting/pages/budget/forecast.tsx | 23 + .../accounting/pages/budget/operational.tsx | 23 + .../accounting/pages/budget/performance.tsx | 23 + .../accounting/pages/budget/reports.tsx | 23 + .../accounting/pages/budget/scenarios.tsx | 23 + .../accounting/pages/budget/variance.tsx | 23 + .../accounting/pages/chart-of-accounts.tsx | 644 +++ .../accounting/pages/compliance/approvals.tsx | 3 + .../accounting/pages/compliance/controls.tsx | 3 + .../accounting/pages/compliance/policies.tsx | 5 + .../accounting/pages/compliance/records.tsx | 3 + .../accounting/pages/compliance/risks.tsx | 5 + .../accounting/pages/compliance/sod.tsx | 3 + .../pages/compliance/violations.tsx | 3 + .../modules/accounting/pages/cost-centers.tsx | 271 ++ .../modules/accounting/pages/currencies.tsx | 255 + .../modules/accounting/pages/customers.tsx | 409 ++ .../modules/accounting/pages/dashboard.tsx | 178 + .../accounting/pages/documents/categories.tsx | 19 + .../accounting/pages/documents/financial.tsx | 19 + .../modules/accounting/pages/documents/hr.tsx | 19 + .../accounting/pages/documents/purchase.tsx | 19 + .../accounting/pages/documents/retention.tsx | 19 + .../accounting/pages/documents/sales.tsx | 19 + .../accounting/pages/documents/search.tsx | 19 + .../accounting/pages/documents/versions.tsx | 19 + .../src/modules/accounting/pages/fiscal.tsx | 579 +++ .../accounting/pages/integration/bank.tsx | 23 + .../accounting/pages/integration/crm.tsx | 23 + .../accounting/pages/integration/gateway.tsx | 23 + .../pages/integration/import-export.tsx | 23 + .../pages/integration/inventory.tsx | 23 + .../accounting/pages/integration/payroll.tsx | 23 + .../accounting/pages/integration/reports.tsx | 23 + .../accounting/pages/integration/webhooks.tsx | 23 + .../pages/inventory/adjustments.tsx | 16 + .../accounting/pages/inventory/issues.tsx | 342 ++ .../accounting/pages/inventory/items.tsx | 7 + .../accounting/pages/inventory/movements.tsx | 23 + .../pages/inventory/receipts-issues.tsx | 18 + .../accounting/pages/inventory/reports.tsx | 8 + .../accounting/pages/inventory/settings.tsx | 7 + .../accounting/pages/inventory/transfers.tsx | 16 + .../accounting/pages/inventory/valuation.tsx | 5 + .../src/modules/accounting/pages/ledger.tsx | 219 + .../modules/accounting/pages/monitoring.tsx | 3 + .../accounting/pages/monitoring/activity.tsx | 3 + .../accounting/pages/monitoring/alerts.tsx | 22 + .../accounting/pages/monitoring/health.tsx | 5 + .../accounting/pages/monitoring/kpis.tsx | 22 + .../pages/monitoring/performance.tsx | 22 + .../accounting/pages/monitoring/recent.tsx | 3 + .../src/modules/accounting/pages/payroll.tsx | 457 ++ .../accounting/pages/payroll/allocation.tsx | 19 + .../accounting/pages/payroll/calculate.tsx | 3 + .../accounting/pages/payroll/contracts.tsx | 3 + .../accounting/pages/payroll/employees.tsx | 5 + .../accounting/pages/payroll/items.tsx | 3 + .../accounting/pages/payroll/payments.tsx | 3 + .../accounting/pages/payroll/reports.tsx | 3 + .../accounting/pages/payroll/structures.tsx | 3 + .../src/modules/accounting/pages/projects.tsx | 295 ++ .../pages/purchase/goods-receipts.tsx | 19 + .../accounting/pages/purchase/invoices.tsx | 17 + .../accounting/pages/purchase/orders.tsx | 16 + .../accounting/pages/purchase/prepayments.tsx | 47 + .../accounting/pages/purchase/requests.tsx | 16 + .../accounting/pages/purchase/returns.tsx | 417 ++ .../accounting/pages/purchase/settlements.tsx | 7 + .../src/modules/accounting/pages/reports.tsx | 663 +++ .../accounting/pages/sales/invoices.tsx | 17 + .../accounting/pages/sales/opportunities.tsx | 25 + .../modules/accounting/pages/sales/orders.tsx | 16 + .../accounting/pages/sales/pre-receipts.tsx | 47 + .../accounting/pages/sales/proformas.tsx | 16 + .../accounting/pages/sales/returns.tsx | 17 + .../accounting/pages/sales/settlements.tsx | 7 + .../src/modules/accounting/pages/settings.tsx | 197 + .../pages/settings/auto-posting.tsx | 187 + .../accounting/pages/settings/backup.tsx | 18 + .../accounting/pages/settings/company.tsx | 179 + .../accounting/pages/settings/general.tsx | 67 + .../modules/accounting/pages/settings/tax.tsx | 18 + .../src/modules/accounting/pages/setup.tsx | 289 ++ .../modules/accounting/pages/suppliers.tsx | 123 + .../src/modules/accounting/pages/treasury.tsx | 490 ++ .../accounting/pages/treasury/banks.tsx | 5 + .../accounting/pages/treasury/cash-boxes.tsx | 5 + .../accounting/pages/treasury/cheques.tsx | 7 + .../accounting/pages/treasury/cheques/new.tsx | 7 + .../accounting/pages/treasury/facilities.tsx | 25 + .../accounting/pages/treasury/guarantees.tsx | 25 + .../pages/treasury/receipts-payments.tsx | 7 + .../pages/treasury/reconciliation.tsx | 7 + .../accounting/pages/treasury/transfers.tsx | 7 + .../src/modules/accounting/pages/vouchers.tsx | 241 + .../accounting/pages/vouchers/adjustments.tsx | 2 + .../modules/accounting/pages/vouchers/id.tsx | 550 +++ .../modules/accounting/pages/vouchers/new.tsx | 389 ++ .../accounting/pages/vouchers/recurring.tsx | 23 + .../accounting/pages/vouchers/templates.tsx | 22 + .../accounting/services/accounting-api.ts | 1856 +++++++ .../src/modules/accounting/types/index.ts | 2 + .../accounting/utils/accounting-scoreboard.ts | 99 + .../components/HealthcarePortalShell.tsx | 187 + .../components/PublicHealthcareLayout.tsx | 59 + .../components/createPortalLayout.tsx | 43 + .../modules/healthcare/constants/portals.ts | 302 ++ .../design-system/HealthcareCards.tsx | 275 ++ .../design-system/MedicalStatusChip.tsx | 50 + .../modules/healthcare/design-system/index.ts | 3 + .../healthcare/design-system/tokens.ts | 33 + .../hooks/useHealthcareDoctorContext.ts | 32 + .../healthcare/hooks/useHealthcareLookups.ts | 53 + .../hooks/useHealthcarePatientContext.ts | 32 + frontend/src/modules/healthcare/index.ts | 10 + .../src/modules/healthcare/pages/admin.tsx | 288 ++ .../src/modules/healthcare/pages/clinic.tsx | 278 ++ .../src/modules/healthcare/pages/doctor.tsx | 537 ++ .../src/modules/healthcare/pages/hospital.tsx | 239 + frontend/src/modules/healthcare/pages/hub.tsx | 191 + .../src/modules/healthcare/pages/patient.tsx | 552 +++ .../src/modules/healthcare/pages/pharmacy.tsx | 141 + .../src/modules/healthcare/pages/public.tsx | 467 ++ .../modules/healthcare/pages/reception.tsx | 280 ++ .../src/modules/healthcare/pages/shared.tsx | 333 ++ .../healthcare/services/healthcare-api.ts | 1322 +++++ .../src/modules/healthcare/types/index.ts | 9 + frontend/src/shared/index.ts | 2 + frontend/src/shared/ui/index.ts | 3 + frontend/src/shared/ui/page-states.tsx | 18 + frontend/tailwind.config.ts | 2 + frontend/tsconfig.json | 8 +- frontend/tsconfig.tsbuildinfo | 2 +- 983 files changed, 41472 insertions(+), 11725 deletions(-) create mode 100644 frontend/app/api/beauty-business/[...path]/route.ts create mode 100644 frontend/app/api/healthcare/[...path]/route.ts create mode 100644 frontend/app/api/sports-center/[...path]/route.ts create mode 100644 frontend/app/beauty/(owner)/appointments/page.tsx create mode 100644 frontend/app/beauty/(owner)/booking/schedules/page.tsx create mode 100644 frontend/app/beauty/(owner)/booking/waiting-list/page.tsx create mode 100644 frontend/app/beauty/(owner)/branches/page.tsx create mode 100644 frontend/app/beauty/(owner)/catalog/categories/page.tsx create mode 100644 frontend/app/beauty/(owner)/catalog/services/page.tsx create mode 100644 frontend/app/beauty/(owner)/customers/page.tsx create mode 100644 frontend/app/beauty/(owner)/layout.tsx create mode 100644 frontend/app/beauty/(owner)/marketing/campaigns/page.tsx create mode 100644 frontend/app/beauty/(owner)/marketing/integrations/page.tsx create mode 100644 frontend/app/beauty/(owner)/organizations/page.tsx create mode 100644 frontend/app/beauty/(owner)/packages/memberships/page.tsx create mode 100644 frontend/app/beauty/(owner)/packages/page.tsx create mode 100644 frontend/app/beauty/(owner)/page.tsx create mode 100644 frontend/app/beauty/(owner)/salon/policies/page.tsx create mode 100644 frontend/app/beauty/(owner)/salon/rooms/page.tsx create mode 100644 frontend/app/beauty/(owner)/salon/stations/page.tsx create mode 100644 frontend/app/beauty/(owner)/settings/page.tsx create mode 100644 frontend/app/beauty/(owner)/staff/commissions/page.tsx create mode 100644 frontend/app/beauty/(owner)/staff/page.tsx create mode 100644 frontend/app/beauty/admin/analytics/page.tsx create mode 100644 frontend/app/beauty/admin/branches/page.tsx create mode 100644 frontend/app/beauty/admin/customers/page.tsx create mode 100644 frontend/app/beauty/admin/layout.tsx create mode 100644 frontend/app/beauty/admin/monitoring/page.tsx create mode 100644 frontend/app/beauty/admin/organizations/page.tsx create mode 100644 frontend/app/beauty/admin/page.tsx create mode 100644 frontend/app/beauty/admin/permissions/page.tsx create mode 100644 frontend/app/beauty/admin/reports/page.tsx create mode 100644 frontend/app/beauty/admin/settings/page.tsx create mode 100644 frontend/app/beauty/admin/staff/page.tsx create mode 100644 frontend/app/beauty/auth/2fa/page.tsx create mode 100644 frontend/app/beauty/auth/forgot-password/page.tsx create mode 100644 frontend/app/beauty/auth/login/page.tsx create mode 100644 frontend/app/beauty/auth/otp/page.tsx create mode 100644 frontend/app/beauty/auth/profile-completion/page.tsx create mode 100644 frontend/app/beauty/auth/register/page.tsx create mode 100644 frontend/app/beauty/customer/appointments/book/page.tsx create mode 100644 frontend/app/beauty/customer/appointments/past/page.tsx create mode 100644 frontend/app/beauty/customer/appointments/upcoming/page.tsx create mode 100644 frontend/app/beauty/customer/favorites/centers/page.tsx create mode 100644 frontend/app/beauty/customer/favorites/page.tsx create mode 100644 frontend/app/beauty/customer/favorites/staff/page.tsx create mode 100644 frontend/app/beauty/customer/invoices/page.tsx create mode 100644 frontend/app/beauty/customer/layout.tsx create mode 100644 frontend/app/beauty/customer/loyalty/page.tsx create mode 100644 frontend/app/beauty/customer/memberships/page.tsx create mode 100644 frontend/app/beauty/customer/messages/page.tsx create mode 100644 frontend/app/beauty/customer/notifications/page.tsx create mode 100644 frontend/app/beauty/customer/packages/page.tsx create mode 100644 frontend/app/beauty/customer/page.tsx create mode 100644 frontend/app/beauty/customer/payments/page.tsx create mode 100644 frontend/app/beauty/customer/profile/page.tsx create mode 100644 frontend/app/beauty/customer/reviews/page.tsx create mode 100644 frontend/app/beauty/customer/sessions/page.tsx create mode 100644 frontend/app/beauty/customer/settings/page.tsx create mode 100644 frontend/app/beauty/customer/wallet/page.tsx create mode 100644 frontend/app/beauty/hub/page.tsx create mode 100644 frontend/app/beauty/layout.tsx create mode 100644 frontend/app/beauty/mobile/[portal]/page.tsx create mode 100644 frontend/app/beauty/owner/accounting-integration/page.tsx create mode 100644 frontend/app/beauty/owner/analytics/page.tsx create mode 100644 frontend/app/beauty/owner/calendar/page.tsx create mode 100644 frontend/app/beauty/owner/coupons/page.tsx create mode 100644 frontend/app/beauty/owner/crm-integration/page.tsx create mode 100644 frontend/app/beauty/owner/layout.tsx create mode 100644 frontend/app/beauty/owner/marketing/page.tsx create mode 100644 frontend/app/beauty/page.tsx create mode 100644 frontend/app/beauty/reception/calendar/page.tsx create mode 100644 frontend/app/beauty/reception/check-in/page.tsx create mode 100644 frontend/app/beauty/reception/check-out/page.tsx create mode 100644 frontend/app/beauty/reception/layout.tsx create mode 100644 frontend/app/beauty/reception/page.tsx create mode 100644 frontend/app/beauty/reception/payments/page.tsx create mode 100644 frontend/app/beauty/reception/queue/page.tsx create mode 100644 frontend/app/beauty/reception/reports/page.tsx create mode 100644 frontend/app/beauty/reception/walk-in/page.tsx create mode 100644 frontend/app/beauty/site/about/page.tsx create mode 100644 frontend/app/beauty/site/book/page.tsx create mode 100644 frontend/app/beauty/site/book/success/page.tsx create mode 100644 frontend/app/beauty/site/campaigns/page.tsx create mode 100644 frontend/app/beauty/site/center/[id]/page.tsx create mode 100644 frontend/app/beauty/site/contact/page.tsx create mode 100644 frontend/app/beauty/site/faq/page.tsx create mode 100644 frontend/app/beauty/site/features/page.tsx create mode 100644 frontend/app/beauty/site/find-laser/page.tsx create mode 100644 frontend/app/beauty/site/find-salon/page.tsx create mode 100644 frontend/app/beauty/site/find-spa/page.tsx create mode 100644 frontend/app/beauty/site/gallery/page.tsx create mode 100644 frontend/app/beauty/site/layout.tsx create mode 100644 frontend/app/beauty/site/packages/page.tsx create mode 100644 frontend/app/beauty/site/page.tsx create mode 100644 frontend/app/beauty/site/pricing/page.tsx create mode 100644 frontend/app/beauty/site/reviews/page.tsx create mode 100644 frontend/app/beauty/site/salon/[id]/page.tsx create mode 100644 frontend/app/beauty/site/search/page.tsx create mode 100644 frontend/app/beauty/site/service/[id]/page.tsx create mode 100644 frontend/app/beauty/site/staff/[id]/page.tsx create mode 100644 frontend/app/beauty/site/tracking/[id]/page.tsx create mode 100644 frontend/app/beauty/staff-portal/appointments/page.tsx create mode 100644 frontend/app/beauty/staff-portal/commission/page.tsx create mode 100644 frontend/app/beauty/staff-portal/layout.tsx create mode 100644 frontend/app/beauty/staff-portal/notifications/page.tsx create mode 100644 frontend/app/beauty/staff-portal/page.tsx create mode 100644 frontend/app/beauty/staff-portal/schedule/page.tsx create mode 100644 frontend/app/beauty/staff-portal/settings/page.tsx create mode 100644 frontend/app/healthcare/admin/analytics/page.tsx create mode 100644 frontend/app/healthcare/admin/clinics/page.tsx create mode 100644 frontend/app/healthcare/admin/doctors/page.tsx create mode 100644 frontend/app/healthcare/admin/layout.tsx create mode 100644 frontend/app/healthcare/admin/logs/page.tsx create mode 100644 frontend/app/healthcare/admin/monitoring/page.tsx create mode 100644 frontend/app/healthcare/admin/organizations/page.tsx create mode 100644 frontend/app/healthcare/admin/page.tsx create mode 100644 frontend/app/healthcare/admin/patients/page.tsx create mode 100644 frontend/app/healthcare/admin/permissions/page.tsx create mode 100644 frontend/app/healthcare/admin/pharmacies/page.tsx create mode 100644 frontend/app/healthcare/admin/reports/page.tsx create mode 100644 frontend/app/healthcare/admin/settings/page.tsx create mode 100644 frontend/app/healthcare/admin/users/page.tsx create mode 100644 frontend/app/healthcare/appointments/page.tsx create mode 100644 frontend/app/healthcare/auth/login/page.tsx create mode 100644 frontend/app/healthcare/branches/page.tsx create mode 100644 frontend/app/healthcare/clinic-management/page.tsx create mode 100644 frontend/app/healthcare/clinic/accounting-integration/page.tsx create mode 100644 frontend/app/healthcare/clinic/crm-integration/page.tsx create mode 100644 frontend/app/healthcare/clinic/departments/page.tsx create mode 100644 frontend/app/healthcare/clinic/doctors/page.tsx create mode 100644 frontend/app/healthcare/clinic/layout.tsx create mode 100644 frontend/app/healthcare/clinic/page.tsx create mode 100644 frontend/app/healthcare/clinic/patients/page.tsx create mode 100644 frontend/app/healthcare/clinic/receptionists/page.tsx create mode 100644 frontend/app/healthcare/clinic/reports/page.tsx create mode 100644 frontend/app/healthcare/clinic/resources/page.tsx create mode 100644 frontend/app/healthcare/clinic/rooms/page.tsx create mode 100644 frontend/app/healthcare/clinic/schedules/page.tsx create mode 100644 frontend/app/healthcare/clinics/page.tsx create mode 100644 frontend/app/healthcare/delivery/page.tsx create mode 100644 frontend/app/healthcare/departments/page.tsx create mode 100644 frontend/app/healthcare/doctor-panel/page.tsx create mode 100644 frontend/app/healthcare/doctor/analytics/page.tsx create mode 100644 frontend/app/healthcare/doctor/appointments/page.tsx create mode 100644 frontend/app/healthcare/doctor/availability/page.tsx create mode 100644 frontend/app/healthcare/doctor/income/page.tsx create mode 100644 frontend/app/healthcare/doctor/layout.tsx create mode 100644 frontend/app/healthcare/doctor/leaves/page.tsx create mode 100644 frontend/app/healthcare/doctor/medical-records/page.tsx create mode 100644 frontend/app/healthcare/doctor/messages/page.tsx create mode 100644 frontend/app/healthcare/doctor/notifications/page.tsx create mode 100644 frontend/app/healthcare/doctor/page.tsx create mode 100644 frontend/app/healthcare/doctor/patients/page.tsx create mode 100644 frontend/app/healthcare/doctor/prescriptions/page.tsx create mode 100644 frontend/app/healthcare/doctor/reports/page.tsx create mode 100644 frontend/app/healthcare/doctor/schedule/calendar/page.tsx create mode 100644 frontend/app/healthcare/doctor/schedule/today/page.tsx create mode 100644 frontend/app/healthcare/doctor/settings/page.tsx create mode 100644 frontend/app/healthcare/doctors/page.tsx create mode 100644 frontend/app/healthcare/hospital/appointments/page.tsx create mode 100644 frontend/app/healthcare/hospital/beds/page.tsx create mode 100644 frontend/app/healthcare/hospital/clinics/page.tsx create mode 100644 frontend/app/healthcare/hospital/departments/page.tsx create mode 100644 frontend/app/healthcare/hospital/doctors/page.tsx create mode 100644 frontend/app/healthcare/hospital/layout.tsx create mode 100644 frontend/app/healthcare/hospital/page.tsx create mode 100644 frontend/app/healthcare/hospital/reports/page.tsx create mode 100644 frontend/app/healthcare/hospital/resources/page.tsx create mode 100644 frontend/app/healthcare/hospital/staff/page.tsx create mode 100644 frontend/app/healthcare/hub/page.tsx create mode 100644 frontend/app/healthcare/layout.tsx create mode 100644 frontend/app/healthcare/medical-records/page.tsx create mode 100644 frontend/app/healthcare/mobile/[portal]/page.tsx create mode 100644 frontend/app/healthcare/page.tsx create mode 100644 frontend/app/healthcare/patient-portal/page.tsx create mode 100644 frontend/app/healthcare/patient/appointments/book/page.tsx create mode 100644 frontend/app/healthcare/patient/appointments/past/page.tsx create mode 100644 frontend/app/healthcare/patient/appointments/upcoming/page.tsx create mode 100644 frontend/app/healthcare/patient/family/page.tsx create mode 100644 frontend/app/healthcare/patient/favorites/page.tsx create mode 100644 frontend/app/healthcare/patient/invoices/page.tsx create mode 100644 frontend/app/healthcare/patient/lab-results/page.tsx create mode 100644 frontend/app/healthcare/patient/layout.tsx create mode 100644 frontend/app/healthcare/patient/medical-history/page.tsx create mode 100644 frontend/app/healthcare/patient/messages/page.tsx create mode 100644 frontend/app/healthcare/patient/notifications/page.tsx create mode 100644 frontend/app/healthcare/patient/page.tsx create mode 100644 frontend/app/healthcare/patient/payments/page.tsx create mode 100644 frontend/app/healthcare/patient/prescriptions/page.tsx create mode 100644 frontend/app/healthcare/patient/profile/page.tsx create mode 100644 frontend/app/healthcare/patient/reviews/page.tsx create mode 100644 frontend/app/healthcare/patient/settings/page.tsx create mode 100644 frontend/app/healthcare/patients/page.tsx create mode 100644 frontend/app/healthcare/pharmacy-portal/delivered/page.tsx create mode 100644 frontend/app/healthcare/pharmacy-portal/delivery/page.tsx create mode 100644 frontend/app/healthcare/pharmacy-portal/incoming/page.tsx create mode 100644 frontend/app/healthcare/pharmacy-portal/layout.tsx create mode 100644 frontend/app/healthcare/pharmacy-portal/page.tsx create mode 100644 frontend/app/healthcare/pharmacy-portal/preparation/page.tsx create mode 100644 frontend/app/healthcare/pharmacy-portal/ready/page.tsx create mode 100644 frontend/app/healthcare/pharmacy-portal/reports/page.tsx create mode 100644 frontend/app/healthcare/pharmacy/page.tsx create mode 100644 frontend/app/healthcare/reception/calendar/page.tsx create mode 100644 frontend/app/healthcare/reception/check-in/page.tsx create mode 100644 frontend/app/healthcare/reception/check-out/page.tsx create mode 100644 frontend/app/healthcare/reception/doctors/page.tsx create mode 100644 frontend/app/healthcare/reception/layout.tsx create mode 100644 frontend/app/healthcare/reception/page.tsx create mode 100644 frontend/app/healthcare/reception/patients/page.tsx create mode 100644 frontend/app/healthcare/reception/payments/page.tsx create mode 100644 frontend/app/healthcare/reception/queue/page.tsx create mode 100644 frontend/app/healthcare/reception/reports/page.tsx create mode 100644 frontend/app/healthcare/reception/walk-in/page.tsx create mode 100644 frontend/app/healthcare/settings/page.tsx create mode 100644 frontend/app/healthcare/site/about/page.tsx create mode 100644 frontend/app/healthcare/site/book/page.tsx create mode 100644 frontend/app/healthcare/site/book/success/page.tsx create mode 100644 frontend/app/healthcare/site/clinic/[id]/page.tsx create mode 100644 frontend/app/healthcare/site/contact/page.tsx create mode 100644 frontend/app/healthcare/site/doctor/[id]/page.tsx create mode 100644 frontend/app/healthcare/site/faq/page.tsx create mode 100644 frontend/app/healthcare/site/features/page.tsx create mode 100644 frontend/app/healthcare/site/find-clinic/page.tsx create mode 100644 frontend/app/healthcare/site/find-doctor/page.tsx create mode 100644 frontend/app/healthcare/site/find-hospital/page.tsx create mode 100644 frontend/app/healthcare/site/hospital/[id]/page.tsx create mode 100644 frontend/app/healthcare/site/layout.tsx create mode 100644 frontend/app/healthcare/site/page.tsx create mode 100644 frontend/app/healthcare/site/pricing/page.tsx create mode 100644 frontend/app/healthcare/site/search/page.tsx create mode 100644 frontend/app/healthcare/site/tracking/[id]/page.tsx create mode 100644 frontend/app/sports-center/access-logs/error.tsx create mode 100644 frontend/app/sports-center/access-logs/loading.tsx create mode 100644 frontend/app/sports-center/access-logs/page.tsx create mode 100644 frontend/app/sports-center/admin/error.tsx create mode 100644 frontend/app/sports-center/admin/loading.tsx create mode 100644 frontend/app/sports-center/admin/page.tsx create mode 100644 frontend/app/sports-center/analytics/error.tsx create mode 100644 frontend/app/sports-center/analytics/loading.tsx create mode 100644 frontend/app/sports-center/analytics/page.tsx create mode 100644 frontend/app/sports-center/athlete/achievements/error.tsx create mode 100644 frontend/app/sports-center/athlete/achievements/loading.tsx create mode 100644 frontend/app/sports-center/athlete/achievements/page.tsx create mode 100644 frontend/app/sports-center/athlete/attendance/error.tsx create mode 100644 frontend/app/sports-center/athlete/attendance/loading.tsx create mode 100644 frontend/app/sports-center/athlete/attendance/page.tsx create mode 100644 frontend/app/sports-center/athlete/bookings/error.tsx create mode 100644 frontend/app/sports-center/athlete/bookings/loading.tsx create mode 100644 frontend/app/sports-center/athlete/bookings/page.tsx create mode 100644 frontend/app/sports-center/athlete/error.tsx create mode 100644 frontend/app/sports-center/athlete/loading.tsx create mode 100644 frontend/app/sports-center/athlete/measurements/error.tsx create mode 100644 frontend/app/sports-center/athlete/measurements/loading.tsx create mode 100644 frontend/app/sports-center/athlete/measurements/page.tsx create mode 100644 frontend/app/sports-center/athlete/membership/error.tsx create mode 100644 frontend/app/sports-center/athlete/membership/loading.tsx create mode 100644 frontend/app/sports-center/athlete/membership/page.tsx create mode 100644 frontend/app/sports-center/athlete/nutrition/error.tsx create mode 100644 frontend/app/sports-center/athlete/nutrition/loading.tsx create mode 100644 frontend/app/sports-center/athlete/nutrition/page.tsx create mode 100644 frontend/app/sports-center/athlete/page.tsx create mode 100644 frontend/app/sports-center/athlete/profile/error.tsx create mode 100644 frontend/app/sports-center/athlete/profile/loading.tsx create mode 100644 frontend/app/sports-center/athlete/profile/page.tsx create mode 100644 frontend/app/sports-center/athlete/progress/error.tsx create mode 100644 frontend/app/sports-center/athlete/progress/loading.tsx create mode 100644 frontend/app/sports-center/athlete/progress/page.tsx create mode 100644 frontend/app/sports-center/athlete/qr/error.tsx create mode 100644 frontend/app/sports-center/athlete/qr/loading.tsx create mode 100644 frontend/app/sports-center/athlete/qr/page.tsx create mode 100644 frontend/app/sports-center/athlete/workout/error.tsx create mode 100644 frontend/app/sports-center/athlete/workout/loading.tsx create mode 100644 frontend/app/sports-center/athlete/workout/page.tsx create mode 100644 frontend/app/sports-center/attendance-gateways/error.tsx create mode 100644 frontend/app/sports-center/attendance-gateways/loading.tsx create mode 100644 frontend/app/sports-center/attendance-gateways/page.tsx create mode 100644 frontend/app/sports-center/attendance/error.tsx create mode 100644 frontend/app/sports-center/attendance/loading.tsx create mode 100644 frontend/app/sports-center/attendance/page.tsx create mode 100644 frontend/app/sports-center/audit-logs/error.tsx create mode 100644 frontend/app/sports-center/audit-logs/loading.tsx create mode 100644 frontend/app/sports-center/audit-logs/page.tsx create mode 100644 frontend/app/sports-center/bookings/error.tsx create mode 100644 frontend/app/sports-center/bookings/loading.tsx create mode 100644 frontend/app/sports-center/bookings/page.tsx create mode 100644 frontend/app/sports-center/branches/error.tsx create mode 100644 frontend/app/sports-center/branches/loading.tsx create mode 100644 frontend/app/sports-center/branches/page.tsx create mode 100644 frontend/app/sports-center/calendar/error.tsx create mode 100644 frontend/app/sports-center/calendar/loading.tsx create mode 100644 frontend/app/sports-center/calendar/page.tsx create mode 100644 frontend/app/sports-center/capabilities/error.tsx create mode 100644 frontend/app/sports-center/capabilities/loading.tsx create mode 100644 frontend/app/sports-center/capabilities/page.tsx create mode 100644 frontend/app/sports-center/cashier/error.tsx create mode 100644 frontend/app/sports-center/cashier/loading.tsx create mode 100644 frontend/app/sports-center/cashier/page.tsx create mode 100644 frontend/app/sports-center/catalog/age-groups/error.tsx create mode 100644 frontend/app/sports-center/catalog/age-groups/loading.tsx create mode 100644 frontend/app/sports-center/catalog/age-groups/page.tsx create mode 100644 frontend/app/sports-center/catalog/expiration-policies/error.tsx create mode 100644 frontend/app/sports-center/catalog/expiration-policies/loading.tsx create mode 100644 frontend/app/sports-center/catalog/expiration-policies/page.tsx create mode 100644 frontend/app/sports-center/catalog/freezing-rules/error.tsx create mode 100644 frontend/app/sports-center/catalog/freezing-rules/loading.tsx create mode 100644 frontend/app/sports-center/catalog/freezing-rules/page.tsx create mode 100644 frontend/app/sports-center/catalog/packages/error.tsx create mode 100644 frontend/app/sports-center/catalog/packages/loading.tsx create mode 100644 frontend/app/sports-center/catalog/packages/page.tsx create mode 100644 frontend/app/sports-center/catalog/plans/error.tsx create mode 100644 frontend/app/sports-center/catalog/plans/loading.tsx create mode 100644 frontend/app/sports-center/catalog/plans/page.tsx create mode 100644 frontend/app/sports-center/catalog/pricing-models/error.tsx create mode 100644 frontend/app/sports-center/catalog/pricing-models/loading.tsx create mode 100644 frontend/app/sports-center/catalog/pricing-models/page.tsx create mode 100644 frontend/app/sports-center/catalog/renewal-policies/error.tsx create mode 100644 frontend/app/sports-center/catalog/renewal-policies/loading.tsx create mode 100644 frontend/app/sports-center/catalog/renewal-policies/page.tsx create mode 100644 frontend/app/sports-center/catalog/rules/error.tsx create mode 100644 frontend/app/sports-center/catalog/rules/loading.tsx create mode 100644 frontend/app/sports-center/catalog/rules/page.tsx create mode 100644 frontend/app/sports-center/catalog/sport-categories/error.tsx create mode 100644 frontend/app/sports-center/catalog/sport-categories/loading.tsx create mode 100644 frontend/app/sports-center/catalog/sport-categories/page.tsx create mode 100644 frontend/app/sports-center/challenges/error.tsx create mode 100644 frontend/app/sports-center/challenges/loading.tsx create mode 100644 frontend/app/sports-center/challenges/page.tsx create mode 100644 frontend/app/sports-center/classes/error.tsx create mode 100644 frontend/app/sports-center/classes/loading.tsx create mode 100644 frontend/app/sports-center/classes/page.tsx create mode 100644 frontend/app/sports-center/coach/error.tsx create mode 100644 frontend/app/sports-center/coach/loading.tsx create mode 100644 frontend/app/sports-center/coach/messages/error.tsx create mode 100644 frontend/app/sports-center/coach/messages/loading.tsx create mode 100644 frontend/app/sports-center/coach/messages/page.tsx create mode 100644 frontend/app/sports-center/coach/page.tsx create mode 100644 frontend/app/sports-center/coach/schedule/error.tsx create mode 100644 frontend/app/sports-center/coach/schedule/loading.tsx create mode 100644 frontend/app/sports-center/coach/schedule/page.tsx create mode 100644 frontend/app/sports-center/coaches/error.tsx create mode 100644 frontend/app/sports-center/coaches/loading.tsx create mode 100644 frontend/app/sports-center/coaches/page.tsx create mode 100644 frontend/app/sports-center/competitions/error.tsx create mode 100644 frontend/app/sports-center/competitions/loading.tsx create mode 100644 frontend/app/sports-center/competitions/page.tsx create mode 100644 frontend/app/sports-center/competitions/results/error.tsx create mode 100644 frontend/app/sports-center/competitions/results/loading.tsx create mode 100644 frontend/app/sports-center/competitions/results/page.tsx create mode 100644 frontend/app/sports-center/competitions/teams/error.tsx create mode 100644 frontend/app/sports-center/competitions/teams/loading.tsx create mode 100644 frontend/app/sports-center/competitions/teams/page.tsx create mode 100644 frontend/app/sports-center/courts/error.tsx create mode 100644 frontend/app/sports-center/courts/loading.tsx create mode 100644 frontend/app/sports-center/courts/page.tsx create mode 100644 frontend/app/sports-center/device-providers/error.tsx create mode 100644 frontend/app/sports-center/device-providers/loading.tsx create mode 100644 frontend/app/sports-center/device-providers/page.tsx create mode 100644 frontend/app/sports-center/devices/error.tsx create mode 100644 frontend/app/sports-center/devices/loading.tsx create mode 100644 frontend/app/sports-center/devices/page.tsx create mode 100644 frontend/app/sports-center/digital-membership/error.tsx create mode 100644 frontend/app/sports-center/digital-membership/loading.tsx create mode 100644 frontend/app/sports-center/digital-membership/page.tsx create mode 100644 frontend/app/sports-center/equipment/error.tsx create mode 100644 frontend/app/sports-center/equipment/loading.tsx create mode 100644 frontend/app/sports-center/equipment/page.tsx create mode 100644 frontend/app/sports-center/events/error.tsx create mode 100644 frontend/app/sports-center/events/loading.tsx create mode 100644 frontend/app/sports-center/events/page.tsx create mode 100644 frontend/app/sports-center/exercise-library/error.tsx create mode 100644 frontend/app/sports-center/exercise-library/loading.tsx create mode 100644 frontend/app/sports-center/exercise-library/page.tsx create mode 100644 frontend/app/sports-center/facilities/error.tsx create mode 100644 frontend/app/sports-center/facilities/loading.tsx create mode 100644 frontend/app/sports-center/facilities/page.tsx create mode 100644 frontend/app/sports-center/families/error.tsx create mode 100644 frontend/app/sports-center/families/loading.tsx create mode 100644 frontend/app/sports-center/families/page.tsx create mode 100644 frontend/app/sports-center/health/error.tsx create mode 100644 frontend/app/sports-center/health/loading.tsx create mode 100644 frontend/app/sports-center/health/page.tsx create mode 100644 frontend/app/sports-center/hub/page.tsx create mode 100644 frontend/app/sports-center/integrations/accounting/error.tsx create mode 100644 frontend/app/sports-center/integrations/accounting/loading.tsx create mode 100644 frontend/app/sports-center/integrations/accounting/page.tsx create mode 100644 frontend/app/sports-center/integrations/ai/error.tsx create mode 100644 frontend/app/sports-center/integrations/ai/loading.tsx create mode 100644 frontend/app/sports-center/integrations/ai/page.tsx create mode 100644 frontend/app/sports-center/integrations/communication/error.tsx create mode 100644 frontend/app/sports-center/integrations/communication/loading.tsx create mode 100644 frontend/app/sports-center/integrations/communication/page.tsx create mode 100644 frontend/app/sports-center/integrations/crm/error.tsx create mode 100644 frontend/app/sports-center/integrations/crm/loading.tsx create mode 100644 frontend/app/sports-center/integrations/crm/page.tsx create mode 100644 frontend/app/sports-center/integrations/loyalty/error.tsx create mode 100644 frontend/app/sports-center/integrations/loyalty/loading.tsx create mode 100644 frontend/app/sports-center/integrations/loyalty/page.tsx create mode 100644 frontend/app/sports-center/layout.tsx create mode 100644 frontend/app/sports-center/locker-rooms/error.tsx create mode 100644 frontend/app/sports-center/locker-rooms/loading.tsx create mode 100644 frontend/app/sports-center/locker-rooms/page.tsx create mode 100644 frontend/app/sports-center/lockers/error.tsx create mode 100644 frontend/app/sports-center/lockers/loading.tsx create mode 100644 frontend/app/sports-center/lockers/page.tsx create mode 100644 frontend/app/sports-center/medical-records/error.tsx create mode 100644 frontend/app/sports-center/medical-records/loading.tsx create mode 100644 frontend/app/sports-center/medical-records/page.tsx create mode 100644 frontend/app/sports-center/members/error.tsx create mode 100644 frontend/app/sports-center/members/loading.tsx create mode 100644 frontend/app/sports-center/members/page.tsx create mode 100644 frontend/app/sports-center/membership-cards/error.tsx create mode 100644 frontend/app/sports-center/membership-cards/loading.tsx create mode 100644 frontend/app/sports-center/membership-cards/page.tsx create mode 100644 frontend/app/sports-center/membership-types/error.tsx create mode 100644 frontend/app/sports-center/membership-types/loading.tsx create mode 100644 frontend/app/sports-center/membership-types/page.tsx create mode 100644 frontend/app/sports-center/memberships/error.tsx create mode 100644 frontend/app/sports-center/memberships/loading.tsx create mode 100644 frontend/app/sports-center/memberships/page.tsx create mode 100644 frontend/app/sports-center/notifications/error.tsx create mode 100644 frontend/app/sports-center/notifications/loading.tsx create mode 100644 frontend/app/sports-center/notifications/page.tsx create mode 100644 frontend/app/sports-center/owner/page.tsx create mode 100644 frontend/app/sports-center/page.tsx create mode 100644 frontend/app/sports-center/parent/error.tsx create mode 100644 frontend/app/sports-center/parent/loading.tsx create mode 100644 frontend/app/sports-center/parent/page.tsx create mode 100644 frontend/app/sports-center/permissions/error.tsx create mode 100644 frontend/app/sports-center/permissions/loading.tsx create mode 100644 frontend/app/sports-center/permissions/page.tsx create mode 100644 frontend/app/sports-center/qr-access/error.tsx create mode 100644 frontend/app/sports-center/qr-access/loading.tsx create mode 100644 frontend/app/sports-center/qr-access/page.tsx create mode 100644 frontend/app/sports-center/reception/check-in/error.tsx create mode 100644 frontend/app/sports-center/reception/check-in/loading.tsx create mode 100644 frontend/app/sports-center/reception/check-in/page.tsx create mode 100644 frontend/app/sports-center/reception/error.tsx create mode 100644 frontend/app/sports-center/reception/loading.tsx create mode 100644 frontend/app/sports-center/reception/page.tsx create mode 100644 frontend/app/sports-center/reception/qr-scanner/error.tsx create mode 100644 frontend/app/sports-center/reception/qr-scanner/loading.tsx create mode 100644 frontend/app/sports-center/reception/qr-scanner/page.tsx create mode 100644 frontend/app/sports-center/reports/error.tsx create mode 100644 frontend/app/sports-center/reports/loading.tsx create mode 100644 frontend/app/sports-center/reports/page.tsx create mode 100644 frontend/app/sports-center/roles/error.tsx create mode 100644 frontend/app/sports-center/roles/loading.tsx create mode 100644 frontend/app/sports-center/roles/page.tsx create mode 100644 frontend/app/sports-center/rooms/error.tsx create mode 100644 frontend/app/sports-center/rooms/loading.tsx create mode 100644 frontend/app/sports-center/rooms/page.tsx create mode 100644 frontend/app/sports-center/sessions/error.tsx create mode 100644 frontend/app/sports-center/sessions/loading.tsx create mode 100644 frontend/app/sports-center/sessions/page.tsx create mode 100644 frontend/app/sports-center/settings/error.tsx create mode 100644 frontend/app/sports-center/settings/loading.tsx create mode 100644 frontend/app/sports-center/settings/page.tsx create mode 100644 frontend/app/sports-center/sports-centers/error.tsx create mode 100644 frontend/app/sports-center/sports-centers/loading.tsx create mode 100644 frontend/app/sports-center/sports-centers/page.tsx create mode 100644 frontend/app/sports-center/sports/error.tsx create mode 100644 frontend/app/sports-center/sports/loading.tsx create mode 100644 frontend/app/sports-center/sports/page.tsx create mode 100644 frontend/app/sports-center/staff/assignments/error.tsx create mode 100644 frontend/app/sports-center/staff/assignments/loading.tsx create mode 100644 frontend/app/sports-center/staff/assignments/page.tsx create mode 100644 frontend/app/sports-center/staff/availability/error.tsx create mode 100644 frontend/app/sports-center/staff/availability/loading.tsx create mode 100644 frontend/app/sports-center/staff/availability/page.tsx create mode 100644 frontend/app/sports-center/staff/certificates/error.tsx create mode 100644 frontend/app/sports-center/staff/certificates/loading.tsx create mode 100644 frontend/app/sports-center/staff/certificates/page.tsx create mode 100644 frontend/app/sports-center/staff/skills/error.tsx create mode 100644 frontend/app/sports-center/staff/skills/loading.tsx create mode 100644 frontend/app/sports-center/staff/skills/page.tsx create mode 100644 frontend/app/sports-center/staff/working-hours/error.tsx create mode 100644 frontend/app/sports-center/staff/working-hours/loading.tsx create mode 100644 frontend/app/sports-center/staff/working-hours/page.tsx create mode 100644 frontend/app/sports-center/support/error.tsx create mode 100644 frontend/app/sports-center/support/loading.tsx create mode 100644 frontend/app/sports-center/support/page.tsx create mode 100644 frontend/app/sports-center/training/exercises/error.tsx create mode 100644 frontend/app/sports-center/training/exercises/loading.tsx create mode 100644 frontend/app/sports-center/training/exercises/page.tsx create mode 100644 frontend/app/sports-center/training/measurements/error.tsx create mode 100644 frontend/app/sports-center/training/measurements/loading.tsx create mode 100644 frontend/app/sports-center/training/measurements/page.tsx create mode 100644 frontend/app/sports-center/training/nutrition/error.tsx create mode 100644 frontend/app/sports-center/training/nutrition/loading.tsx create mode 100644 frontend/app/sports-center/training/nutrition/page.tsx create mode 100644 frontend/app/sports-center/training/programs/error.tsx create mode 100644 frontend/app/sports-center/training/programs/loading.tsx create mode 100644 frontend/app/sports-center/training/programs/page.tsx create mode 100644 frontend/app/sports-center/training/progress/error.tsx create mode 100644 frontend/app/sports-center/training/progress/loading.tsx create mode 100644 frontend/app/sports-center/training/progress/page.tsx create mode 100644 frontend/app/sports-center/training/workout-assignments/error.tsx create mode 100644 frontend/app/sports-center/training/workout-assignments/loading.tsx create mode 100644 frontend/app/sports-center/training/workout-assignments/page.tsx create mode 100644 frontend/app/sports-center/training/workout-plans/error.tsx create mode 100644 frontend/app/sports-center/training/workout-plans/loading.tsx create mode 100644 frontend/app/sports-center/training/workout-plans/page.tsx create mode 100644 frontend/app/sports-center/workout-programs/error.tsx create mode 100644 frontend/app/sports-center/workout-programs/loading.tsx create mode 100644 frontend/app/sports-center/workout-programs/page.tsx create mode 100644 frontend/docs/README.md create mode 100644 frontend/docs/accounting-migration-report.md create mode 100644 frontend/docs/beauty-migration-report.md create mode 100644 frontend/docs/dependency-report.md create mode 100644 frontend/docs/frontend-architecture-audit.md create mode 100644 frontend/docs/frontend-migration-plan.md create mode 100644 frontend/docs/healthcare-migration-report.md create mode 100644 frontend/docs/import-report.md create mode 100644 frontend/docs/module-boundaries.md create mode 100644 frontend/docs/refactor-risk-analysis.md create mode 100644 frontend/docs/shared-components-report.md create mode 100644 frontend/hooks/useBeautyLookups.ts create mode 100644 frontend/hooks/useHealthcareDoctorContext.ts create mode 100644 frontend/hooks/useHealthcareLookups.ts create mode 100644 frontend/hooks/useHealthcarePatientContext.ts create mode 100644 frontend/lib/beauty-business-api.ts create mode 100644 frontend/lib/beauty-business-nav.ts create mode 100644 frontend/lib/beauty-portals.ts create mode 100644 frontend/lib/healthcare-api.ts create mode 100644 frontend/lib/healthcare-portals.ts create mode 100644 frontend/lib/sports-center-api.ts create mode 100644 frontend/modules/beauty/README.md create mode 100644 frontend/modules/beauty/calendar/README.md create mode 100644 frontend/modules/beauty/charts/README.md create mode 100644 frontend/modules/beauty/components/BeautyBusinessShell.tsx create mode 100644 frontend/modules/beauty/components/BeautyPortalShell.tsx create mode 100644 frontend/modules/beauty/components/PublicBeautyLayout.tsx create mode 100644 frontend/modules/beauty/components/createPortalLayout.tsx create mode 100644 frontend/modules/beauty/constants/portals.ts create mode 100644 frontend/modules/beauty/design-system/BeautyCards.tsx create mode 100644 frontend/modules/beauty/design-system/BeautyPrimitives.tsx create mode 100644 frontend/modules/beauty/design-system/BeautyStatusChip.tsx create mode 100644 frontend/modules/beauty/design-system/BeautyTablePage.tsx create mode 100644 frontend/modules/beauty/design-system/index.ts create mode 100644 frontend/modules/beauty/design-system/tokens.ts create mode 100644 frontend/modules/beauty/features/owner/appointments.tsx create mode 100644 frontend/modules/beauty/features/owner/booking-schedules.tsx create mode 100644 frontend/modules/beauty/features/owner/booking-waiting-list.tsx create mode 100644 frontend/modules/beauty/features/owner/branches.tsx create mode 100644 frontend/modules/beauty/features/owner/catalog-categories.tsx create mode 100644 frontend/modules/beauty/features/owner/catalog-services.tsx create mode 100644 frontend/modules/beauty/features/owner/customers.tsx create mode 100644 frontend/modules/beauty/features/owner/marketing-campaigns.tsx create mode 100644 frontend/modules/beauty/features/owner/marketing-integrations.tsx create mode 100644 frontend/modules/beauty/features/owner/organizations.tsx create mode 100644 frontend/modules/beauty/features/owner/packages-memberships.tsx create mode 100644 frontend/modules/beauty/features/owner/packages.tsx create mode 100644 frontend/modules/beauty/features/owner/salon-policies.tsx create mode 100644 frontend/modules/beauty/features/owner/salon-rooms.tsx create mode 100644 frontend/modules/beauty/features/owner/salon-stations.tsx create mode 100644 frontend/modules/beauty/features/owner/settings.tsx create mode 100644 frontend/modules/beauty/features/owner/staff-commissions.tsx create mode 100644 frontend/modules/beauty/features/owner/staff.tsx create mode 100644 frontend/modules/beauty/forms/README.md create mode 100644 frontend/modules/beauty/hooks/useBeautyLookups.ts create mode 100644 frontend/modules/beauty/index.ts create mode 100644 frontend/modules/beauty/pages/admin.tsx create mode 100644 frontend/modules/beauty/pages/customer.tsx create mode 100644 frontend/modules/beauty/pages/hub.tsx create mode 100644 frontend/modules/beauty/pages/mobile.tsx create mode 100644 frontend/modules/beauty/pages/owner.tsx create mode 100644 frontend/modules/beauty/pages/public.tsx create mode 100644 frontend/modules/beauty/pages/reception.tsx create mode 100644 frontend/modules/beauty/pages/shared.tsx create mode 100644 frontend/modules/beauty/pages/staff-portal.tsx create mode 100644 frontend/modules/beauty/services/beauty-business-api.ts create mode 100644 frontend/modules/beauty/tables/README.md create mode 100644 frontend/modules/beauty/types/index.ts create mode 100644 frontend/modules/beauty/utils/README.md create mode 100644 frontend/modules/sports-center/components/SportsCenterBreadcrumbs.tsx create mode 100644 frontend/modules/sports-center/components/SportsCenterFeatureGate.tsx create mode 100644 frontend/modules/sports-center/components/SportsCenterListCrudPage.tsx create mode 100644 frontend/modules/sports-center/components/SportsCenterPortalShell.tsx create mode 100644 frontend/modules/sports-center/components/createPortalLayout.tsx create mode 100644 frontend/modules/sports-center/constants/portals.ts create mode 100644 frontend/modules/sports-center/design-system/SportsCenterStatusChip.tsx create mode 100644 frontend/modules/sports-center/design-system/SportsCenterTablePage.tsx create mode 100644 frontend/modules/sports-center/design-system/index.ts create mode 100644 frontend/modules/sports-center/design-system/tokens.ts create mode 100644 frontend/modules/sports-center/features/accessLogs.tsx create mode 100644 frontend/modules/sports-center/features/ageGroups.tsx create mode 100644 frontend/modules/sports-center/features/analytics.tsx create mode 100644 frontend/modules/sports-center/features/athlete.tsx create mode 100644 frontend/modules/sports-center/features/attendance.tsx create mode 100644 frontend/modules/sports-center/features/attendanceGateways.tsx create mode 100644 frontend/modules/sports-center/features/bookings.tsx create mode 100644 frontend/modules/sports-center/features/branches.tsx create mode 100644 frontend/modules/sports-center/features/capabilities.tsx create mode 100644 frontend/modules/sports-center/features/coaches.tsx create mode 100644 frontend/modules/sports-center/features/competitionResults.tsx create mode 100644 frontend/modules/sports-center/features/competitions.tsx create mode 100644 frontend/modules/sports-center/features/courts.tsx create mode 100644 frontend/modules/sports-center/features/dashboard.tsx create mode 100644 frontend/modules/sports-center/features/deviceProviders.tsx create mode 100644 frontend/modules/sports-center/features/devices.tsx create mode 100644 frontend/modules/sports-center/features/digitalMembership.tsx create mode 100644 frontend/modules/sports-center/features/equipment.tsx create mode 100644 frontend/modules/sports-center/features/events.tsx create mode 100644 frontend/modules/sports-center/features/exercises.tsx create mode 100644 frontend/modules/sports-center/features/expirationPolicies.tsx create mode 100644 frontend/modules/sports-center/features/facilities.tsx create mode 100644 frontend/modules/sports-center/features/families.tsx create mode 100644 frontend/modules/sports-center/features/freezingRules.tsx create mode 100644 frontend/modules/sports-center/features/health.tsx create mode 100644 frontend/modules/sports-center/features/hub.tsx create mode 100644 frontend/modules/sports-center/features/integrations.tsx create mode 100644 frontend/modules/sports-center/features/lockerRooms.tsx create mode 100644 frontend/modules/sports-center/features/lockers.tsx create mode 100644 frontend/modules/sports-center/features/measurements.tsx create mode 100644 frontend/modules/sports-center/features/medicalRecords.tsx create mode 100644 frontend/modules/sports-center/features/members.tsx create mode 100644 frontend/modules/sports-center/features/membershipCards.tsx create mode 100644 frontend/modules/sports-center/features/membershipPackages.tsx create mode 100644 frontend/modules/sports-center/features/membershipPlans.tsx create mode 100644 frontend/modules/sports-center/features/membershipRules.tsx create mode 100644 frontend/modules/sports-center/features/membershipTypes.tsx create mode 100644 frontend/modules/sports-center/features/memberships.tsx create mode 100644 frontend/modules/sports-center/features/nutrition.tsx create mode 100644 frontend/modules/sports-center/features/permissions.tsx create mode 100644 frontend/modules/sports-center/features/pricingModels.tsx create mode 100644 frontend/modules/sports-center/features/progress.tsx create mode 100644 frontend/modules/sports-center/features/reception.tsx create mode 100644 frontend/modules/sports-center/features/renewalPolicies.tsx create mode 100644 frontend/modules/sports-center/features/roles.tsx create mode 100644 frontend/modules/sports-center/features/rooms.tsx create mode 100644 frontend/modules/sports-center/features/sessions.tsx create mode 100644 frontend/modules/sports-center/features/settings.tsx create mode 100644 frontend/modules/sports-center/features/sportCategories.tsx create mode 100644 frontend/modules/sports-center/features/sports.tsx create mode 100644 frontend/modules/sports-center/features/sportsCenters.tsx create mode 100644 frontend/modules/sports-center/features/staffAssignments.tsx create mode 100644 frontend/modules/sports-center/features/staffAvailability.tsx create mode 100644 frontend/modules/sports-center/features/staffCertificates.tsx create mode 100644 frontend/modules/sports-center/features/staffSkills.tsx create mode 100644 frontend/modules/sports-center/features/staffWorkingHours.tsx create mode 100644 frontend/modules/sports-center/features/teams.tsx create mode 100644 frontend/modules/sports-center/features/trainingPrograms.tsx create mode 100644 frontend/modules/sports-center/features/workoutAssignments.tsx create mode 100644 frontend/modules/sports-center/features/workoutPlans.tsx create mode 100644 frontend/modules/sports-center/hooks/useSportsCenterCapabilities.ts create mode 100644 frontend/modules/sports-center/hooks/useSportsCenterLookups.ts create mode 100644 frontend/modules/sports-center/index.ts create mode 100644 frontend/modules/sports-center/pages/shared.tsx create mode 100644 frontend/modules/sports-center/services/sports-center-api.ts create mode 100644 frontend/modules/sports-center/types/index.ts create mode 100644 frontend/scripts/fix-accounting-collisions.mjs create mode 100644 frontend/scripts/fix-accounting-exports.mjs create mode 100644 frontend/scripts/generate-healthcare-routes.mjs create mode 100644 frontend/scripts/generate-sports-center-routes.mjs create mode 100644 frontend/scripts/generate-sports-center-special-routes.mjs create mode 100644 frontend/scripts/migrate-accounting-imports.mjs create mode 100644 frontend/scripts/migrate-accounting-pages.mjs create mode 100644 frontend/scripts/migrate-beauty-imports.mjs create mode 100644 frontend/scripts/migrate-healthcare-imports.mjs create mode 100644 frontend/scripts/recreate-owner-routes.mjs create mode 100644 frontend/scripts/validate-accounting-bundle.mjs create mode 100644 frontend/scripts/validate-accounting-circular.mjs create mode 100644 frontend/scripts/validate-accounting-imports.mjs create mode 100644 frontend/scripts/validate-accounting-routes.mjs create mode 100644 frontend/scripts/validate-beauty-bundle.mjs create mode 100644 frontend/scripts/validate-beauty-imports.mjs create mode 100644 frontend/scripts/validate-beauty-routes.mjs create mode 100644 frontend/scripts/validate-healthcare-bundle.mjs create mode 100644 frontend/scripts/validate-healthcare-circular.mjs create mode 100644 frontend/scripts/validate-healthcare-imports.mjs create mode 100644 frontend/scripts/validate-healthcare-routes.mjs create mode 100644 frontend/shared/README.md create mode 100644 frontend/shared/api/README.md create mode 100644 frontend/shared/calendar/README.md create mode 100644 frontend/shared/charts/README.md create mode 100644 frontend/shared/constants/README.md create mode 100644 frontend/shared/design-system/README.md create mode 100644 frontend/shared/forms/README.md create mode 100644 frontend/shared/hooks/README.md create mode 100644 frontend/shared/icons/README.md create mode 100644 frontend/shared/layouts/README.md create mode 100644 frontend/shared/providers/README.md create mode 100644 frontend/shared/tables/README.md create mode 100644 frontend/shared/theme/README.md create mode 100644 frontend/shared/types/README.md create mode 100644 frontend/shared/ui/README.md create mode 100644 frontend/shared/utils/README.md rename frontend/{components/accounting => src/modules/accounting/components}/AccountingShell.tsx (95%) rename frontend/{components/accounting => src/modules/accounting/components}/BusinessDocsPage.tsx (96%) rename frontend/{components/accounting => src/modules/accounting/components}/CompletionScoreboard.tsx (94%) rename frontend/{components/accounting => src/modules/accounting/components}/DomainScreens.tsx (97%) rename frontend/{components/accounting => src/modules/accounting/components}/EntityCombobox.tsx (95%) rename frontend/{components/accounting => src/modules/accounting/components}/OperationalDocumentPage.tsx (96%) rename frontend/{components/accounting => src/modules/accounting/components}/SpecializedOpsPage.tsx (96%) rename frontend/{components/accounting => src/modules/accounting/components}/WorkflowScreens.tsx (97%) create mode 100644 frontend/src/modules/accounting/constants/accounting-nav.ts create mode 100644 frontend/src/modules/accounting/index.ts create mode 100644 frontend/src/modules/accounting/layout/AccountingLayoutGate.tsx create mode 100644 frontend/src/modules/accounting/pages/ai.tsx create mode 100644 frontend/src/modules/accounting/pages/ai/analytics.tsx create mode 100644 frontend/src/modules/accounting/pages/ai/anomalies.tsx create mode 100644 frontend/src/modules/accounting/pages/ai/documents.tsx create mode 100644 frontend/src/modules/accounting/pages/ai/forecasts.tsx create mode 100644 frontend/src/modules/accounting/pages/ai/qa.tsx create mode 100644 frontend/src/modules/accounting/pages/ai/recommendations.tsx create mode 100644 frontend/src/modules/accounting/pages/ai/reconciliation.tsx create mode 100644 frontend/src/modules/accounting/pages/assets.tsx create mode 100644 frontend/src/modules/accounting/pages/assets/accumulated.tsx create mode 100644 frontend/src/modules/accounting/pages/assets/dashboard.tsx create mode 100644 frontend/src/modules/accounting/pages/assets/depreciate.tsx create mode 100644 frontend/src/modules/accounting/pages/assets/dispose.tsx create mode 100644 frontend/src/modules/accounting/pages/assets/schedule.tsx create mode 100644 frontend/src/modules/accounting/pages/assets/transfers.tsx create mode 100644 frontend/src/modules/accounting/pages/assets/valuation.tsx create mode 100644 frontend/src/modules/accounting/pages/audit.tsx create mode 100644 frontend/src/modules/accounting/pages/budget/control.tsx create mode 100644 frontend/src/modules/accounting/pages/budget/definitions.tsx create mode 100644 frontend/src/modules/accounting/pages/budget/forecast.tsx create mode 100644 frontend/src/modules/accounting/pages/budget/operational.tsx create mode 100644 frontend/src/modules/accounting/pages/budget/performance.tsx create mode 100644 frontend/src/modules/accounting/pages/budget/reports.tsx create mode 100644 frontend/src/modules/accounting/pages/budget/scenarios.tsx create mode 100644 frontend/src/modules/accounting/pages/budget/variance.tsx create mode 100644 frontend/src/modules/accounting/pages/chart-of-accounts.tsx create mode 100644 frontend/src/modules/accounting/pages/compliance/approvals.tsx create mode 100644 frontend/src/modules/accounting/pages/compliance/controls.tsx create mode 100644 frontend/src/modules/accounting/pages/compliance/policies.tsx create mode 100644 frontend/src/modules/accounting/pages/compliance/records.tsx create mode 100644 frontend/src/modules/accounting/pages/compliance/risks.tsx create mode 100644 frontend/src/modules/accounting/pages/compliance/sod.tsx create mode 100644 frontend/src/modules/accounting/pages/compliance/violations.tsx create mode 100644 frontend/src/modules/accounting/pages/cost-centers.tsx create mode 100644 frontend/src/modules/accounting/pages/currencies.tsx create mode 100644 frontend/src/modules/accounting/pages/customers.tsx create mode 100644 frontend/src/modules/accounting/pages/dashboard.tsx create mode 100644 frontend/src/modules/accounting/pages/documents/categories.tsx create mode 100644 frontend/src/modules/accounting/pages/documents/financial.tsx create mode 100644 frontend/src/modules/accounting/pages/documents/hr.tsx create mode 100644 frontend/src/modules/accounting/pages/documents/purchase.tsx create mode 100644 frontend/src/modules/accounting/pages/documents/retention.tsx create mode 100644 frontend/src/modules/accounting/pages/documents/sales.tsx create mode 100644 frontend/src/modules/accounting/pages/documents/search.tsx create mode 100644 frontend/src/modules/accounting/pages/documents/versions.tsx create mode 100644 frontend/src/modules/accounting/pages/fiscal.tsx create mode 100644 frontend/src/modules/accounting/pages/integration/bank.tsx create mode 100644 frontend/src/modules/accounting/pages/integration/crm.tsx create mode 100644 frontend/src/modules/accounting/pages/integration/gateway.tsx create mode 100644 frontend/src/modules/accounting/pages/integration/import-export.tsx create mode 100644 frontend/src/modules/accounting/pages/integration/inventory.tsx create mode 100644 frontend/src/modules/accounting/pages/integration/payroll.tsx create mode 100644 frontend/src/modules/accounting/pages/integration/reports.tsx create mode 100644 frontend/src/modules/accounting/pages/integration/webhooks.tsx create mode 100644 frontend/src/modules/accounting/pages/inventory/adjustments.tsx create mode 100644 frontend/src/modules/accounting/pages/inventory/issues.tsx create mode 100644 frontend/src/modules/accounting/pages/inventory/items.tsx create mode 100644 frontend/src/modules/accounting/pages/inventory/movements.tsx create mode 100644 frontend/src/modules/accounting/pages/inventory/receipts-issues.tsx create mode 100644 frontend/src/modules/accounting/pages/inventory/reports.tsx create mode 100644 frontend/src/modules/accounting/pages/inventory/settings.tsx create mode 100644 frontend/src/modules/accounting/pages/inventory/transfers.tsx create mode 100644 frontend/src/modules/accounting/pages/inventory/valuation.tsx create mode 100644 frontend/src/modules/accounting/pages/ledger.tsx create mode 100644 frontend/src/modules/accounting/pages/monitoring.tsx create mode 100644 frontend/src/modules/accounting/pages/monitoring/activity.tsx create mode 100644 frontend/src/modules/accounting/pages/monitoring/alerts.tsx create mode 100644 frontend/src/modules/accounting/pages/monitoring/health.tsx create mode 100644 frontend/src/modules/accounting/pages/monitoring/kpis.tsx create mode 100644 frontend/src/modules/accounting/pages/monitoring/performance.tsx create mode 100644 frontend/src/modules/accounting/pages/monitoring/recent.tsx create mode 100644 frontend/src/modules/accounting/pages/payroll.tsx create mode 100644 frontend/src/modules/accounting/pages/payroll/allocation.tsx create mode 100644 frontend/src/modules/accounting/pages/payroll/calculate.tsx create mode 100644 frontend/src/modules/accounting/pages/payroll/contracts.tsx create mode 100644 frontend/src/modules/accounting/pages/payroll/employees.tsx create mode 100644 frontend/src/modules/accounting/pages/payroll/items.tsx create mode 100644 frontend/src/modules/accounting/pages/payroll/payments.tsx create mode 100644 frontend/src/modules/accounting/pages/payroll/reports.tsx create mode 100644 frontend/src/modules/accounting/pages/payroll/structures.tsx create mode 100644 frontend/src/modules/accounting/pages/projects.tsx create mode 100644 frontend/src/modules/accounting/pages/purchase/goods-receipts.tsx create mode 100644 frontend/src/modules/accounting/pages/purchase/invoices.tsx create mode 100644 frontend/src/modules/accounting/pages/purchase/orders.tsx create mode 100644 frontend/src/modules/accounting/pages/purchase/prepayments.tsx create mode 100644 frontend/src/modules/accounting/pages/purchase/requests.tsx create mode 100644 frontend/src/modules/accounting/pages/purchase/returns.tsx create mode 100644 frontend/src/modules/accounting/pages/purchase/settlements.tsx create mode 100644 frontend/src/modules/accounting/pages/reports.tsx create mode 100644 frontend/src/modules/accounting/pages/sales/invoices.tsx create mode 100644 frontend/src/modules/accounting/pages/sales/opportunities.tsx create mode 100644 frontend/src/modules/accounting/pages/sales/orders.tsx create mode 100644 frontend/src/modules/accounting/pages/sales/pre-receipts.tsx create mode 100644 frontend/src/modules/accounting/pages/sales/proformas.tsx create mode 100644 frontend/src/modules/accounting/pages/sales/returns.tsx create mode 100644 frontend/src/modules/accounting/pages/sales/settlements.tsx create mode 100644 frontend/src/modules/accounting/pages/settings.tsx create mode 100644 frontend/src/modules/accounting/pages/settings/auto-posting.tsx create mode 100644 frontend/src/modules/accounting/pages/settings/backup.tsx create mode 100644 frontend/src/modules/accounting/pages/settings/company.tsx create mode 100644 frontend/src/modules/accounting/pages/settings/general.tsx create mode 100644 frontend/src/modules/accounting/pages/settings/tax.tsx create mode 100644 frontend/src/modules/accounting/pages/setup.tsx create mode 100644 frontend/src/modules/accounting/pages/suppliers.tsx create mode 100644 frontend/src/modules/accounting/pages/treasury.tsx create mode 100644 frontend/src/modules/accounting/pages/treasury/banks.tsx create mode 100644 frontend/src/modules/accounting/pages/treasury/cash-boxes.tsx create mode 100644 frontend/src/modules/accounting/pages/treasury/cheques.tsx create mode 100644 frontend/src/modules/accounting/pages/treasury/cheques/new.tsx create mode 100644 frontend/src/modules/accounting/pages/treasury/facilities.tsx create mode 100644 frontend/src/modules/accounting/pages/treasury/guarantees.tsx create mode 100644 frontend/src/modules/accounting/pages/treasury/receipts-payments.tsx create mode 100644 frontend/src/modules/accounting/pages/treasury/reconciliation.tsx create mode 100644 frontend/src/modules/accounting/pages/treasury/transfers.tsx create mode 100644 frontend/src/modules/accounting/pages/vouchers.tsx create mode 100644 frontend/src/modules/accounting/pages/vouchers/adjustments.tsx create mode 100644 frontend/src/modules/accounting/pages/vouchers/id.tsx create mode 100644 frontend/src/modules/accounting/pages/vouchers/new.tsx create mode 100644 frontend/src/modules/accounting/pages/vouchers/recurring.tsx create mode 100644 frontend/src/modules/accounting/pages/vouchers/templates.tsx create mode 100644 frontend/src/modules/accounting/services/accounting-api.ts create mode 100644 frontend/src/modules/accounting/types/index.ts create mode 100644 frontend/src/modules/accounting/utils/accounting-scoreboard.ts create mode 100644 frontend/src/modules/healthcare/components/HealthcarePortalShell.tsx create mode 100644 frontend/src/modules/healthcare/components/PublicHealthcareLayout.tsx create mode 100644 frontend/src/modules/healthcare/components/createPortalLayout.tsx create mode 100644 frontend/src/modules/healthcare/constants/portals.ts create mode 100644 frontend/src/modules/healthcare/design-system/HealthcareCards.tsx create mode 100644 frontend/src/modules/healthcare/design-system/MedicalStatusChip.tsx create mode 100644 frontend/src/modules/healthcare/design-system/index.ts create mode 100644 frontend/src/modules/healthcare/design-system/tokens.ts create mode 100644 frontend/src/modules/healthcare/hooks/useHealthcareDoctorContext.ts create mode 100644 frontend/src/modules/healthcare/hooks/useHealthcareLookups.ts create mode 100644 frontend/src/modules/healthcare/hooks/useHealthcarePatientContext.ts create mode 100644 frontend/src/modules/healthcare/index.ts create mode 100644 frontend/src/modules/healthcare/pages/admin.tsx create mode 100644 frontend/src/modules/healthcare/pages/clinic.tsx create mode 100644 frontend/src/modules/healthcare/pages/doctor.tsx create mode 100644 frontend/src/modules/healthcare/pages/hospital.tsx create mode 100644 frontend/src/modules/healthcare/pages/hub.tsx create mode 100644 frontend/src/modules/healthcare/pages/patient.tsx create mode 100644 frontend/src/modules/healthcare/pages/pharmacy.tsx create mode 100644 frontend/src/modules/healthcare/pages/public.tsx create mode 100644 frontend/src/modules/healthcare/pages/reception.tsx create mode 100644 frontend/src/modules/healthcare/pages/shared.tsx create mode 100644 frontend/src/modules/healthcare/services/healthcare-api.ts create mode 100644 frontend/src/modules/healthcare/types/index.ts create mode 100644 frontend/src/shared/index.ts create mode 100644 frontend/src/shared/ui/index.ts create mode 100644 frontend/src/shared/ui/page-states.tsx diff --git a/frontend/.eslintrc.json b/frontend/.eslintrc.json index 07d588b..b5cc80a 100644 --- a/frontend/.eslintrc.json +++ b/frontend/.eslintrc.json @@ -2,7 +2,7 @@ "extends": "next/core-web-vitals", "overrides": [ { - "files": ["app/accounting/**/*", "components/accounting/**/*"], + "files": ["app/accounting/**/*", "src/modules/accounting/**/*"], "rules": { "no-restricted-imports": [ "error", @@ -13,7 +13,9 @@ "@/components/beauty/**", "@/components/healthcare/**", "@/modules/beauty/**", - "@/modules/healthcare/**" + "@/modules/healthcare/**", + "@/src/modules/beauty/**", + "@/src/modules/healthcare/**" ], "message": "Accounting must not import beauty or healthcare modules." } @@ -34,7 +36,9 @@ "@/components/accounting/**", "@/components/healthcare/**", "@/modules/accounting/**", - "@/modules/healthcare/**" + "@/modules/healthcare/**", + "@/src/modules/accounting/**", + "@/src/modules/healthcare/**" ], "message": "Beauty must not import accounting or healthcare modules." } @@ -56,7 +60,8 @@ "@/components/beauty/**", "@/modules/beauty/**", "@/modules/accounting/**", - "@/src/modules/beauty/**" + "@/src/modules/beauty/**", + "@/src/modules/accounting/**" ], "message": "Healthcare must not import accounting or beauty modules." } @@ -79,7 +84,9 @@ "@/components/healthcare/**", "@/modules/beauty/**", "@/modules/healthcare/**", - "@/modules/accounting/**" + "@/modules/accounting/**", + "@/src/modules/accounting/**", + "@/src/modules/healthcare/**" ], "message": "CRM must not import accounting, beauty, or healthcare modules." } @@ -93,6 +100,7 @@ "components/ds/**/*", "shared/**/*", "components/providers/**/*", + "src/shared/**/*", "components/AuthGuard.tsx", "components/AdminAuthGuard.tsx", "components/ThemeProvider.tsx", @@ -111,6 +119,9 @@ "@/components/healthcare/**", "@/modules/beauty/**", "@/modules/healthcare/**", + "@/modules/hospitality/**", + "@/src/modules/healthcare/**", + "@/src/modules/accounting/**", "@/modules/accounting/**", "@/modules/crm/**" ], diff --git a/frontend/app/accounting/ai/analytics/page.tsx b/frontend/app/accounting/ai/analytics/page.tsx index 3804f8f..3a738d9 100644 --- a/frontend/app/accounting/ai/analytics/page.tsx +++ b/frontend/app/accounting/ai/analytics/page.tsx @@ -1,7 +1,3 @@ -"use client"; - -import { BlockedModulePage } from "@/components/accounting/BusinessDocsPage"; - -export default function Page() { - return ; -} +"use client"; + +export { AiAnalyticsPage as default } from "@/src/modules/accounting/pages/ai/analytics"; diff --git a/frontend/app/accounting/ai/anomalies/page.tsx b/frontend/app/accounting/ai/anomalies/page.tsx index c2d3433..481f14d 100644 --- a/frontend/app/accounting/ai/anomalies/page.tsx +++ b/frontend/app/accounting/ai/anomalies/page.tsx @@ -1,7 +1,3 @@ -"use client"; - -import { BlockedModulePage } from "@/components/accounting/BusinessDocsPage"; - -export default function Page() { - return ; -} +"use client"; + +export { AiAnomaliesPage as default } from "@/src/modules/accounting/pages/ai/anomalies"; diff --git a/frontend/app/accounting/ai/documents/page.tsx b/frontend/app/accounting/ai/documents/page.tsx index 93c288f..63b2210 100644 --- a/frontend/app/accounting/ai/documents/page.tsx +++ b/frontend/app/accounting/ai/documents/page.tsx @@ -1,7 +1,3 @@ -"use client"; - -import { BlockedModulePage } from "@/components/accounting/BusinessDocsPage"; - -export default function Page() { - return ; -} +"use client"; + +export { AiDocumentsPage as default } from "@/src/modules/accounting/pages/ai/documents"; diff --git a/frontend/app/accounting/ai/forecasts/page.tsx b/frontend/app/accounting/ai/forecasts/page.tsx index e5e07e8..273f822 100644 --- a/frontend/app/accounting/ai/forecasts/page.tsx +++ b/frontend/app/accounting/ai/forecasts/page.tsx @@ -1,7 +1,3 @@ -"use client"; - -import { BlockedModulePage } from "@/components/accounting/BusinessDocsPage"; - -export default function Page() { - return ; -} +"use client"; + +export { AiForecastsPage as default } from "@/src/modules/accounting/pages/ai/forecasts"; diff --git a/frontend/app/accounting/ai/page.tsx b/frontend/app/accounting/ai/page.tsx index d654b68..72b8a98 100644 --- a/frontend/app/accounting/ai/page.tsx +++ b/frontend/app/accounting/ai/page.tsx @@ -1,7 +1,3 @@ -"use client"; - -import { BlockedModulePage } from "@/components/accounting/BusinessDocsPage"; - -export default function Page() { - return ; -} +"use client"; + +export { AiPage as default } from "@/src/modules/accounting/pages/ai"; diff --git a/frontend/app/accounting/ai/qa/page.tsx b/frontend/app/accounting/ai/qa/page.tsx index 725eefb..964536a 100644 --- a/frontend/app/accounting/ai/qa/page.tsx +++ b/frontend/app/accounting/ai/qa/page.tsx @@ -1,7 +1,3 @@ -"use client"; - -import { BlockedModulePage } from "@/components/accounting/BusinessDocsPage"; - -export default function Page() { - return ; -} +"use client"; + +export { AiQaPage as default } from "@/src/modules/accounting/pages/ai/qa"; diff --git a/frontend/app/accounting/ai/recommendations/page.tsx b/frontend/app/accounting/ai/recommendations/page.tsx index 9264c62..b929e18 100644 --- a/frontend/app/accounting/ai/recommendations/page.tsx +++ b/frontend/app/accounting/ai/recommendations/page.tsx @@ -1,7 +1,3 @@ -"use client"; - -import { BlockedModulePage } from "@/components/accounting/BusinessDocsPage"; - -export default function Page() { - return ; -} +"use client"; + +export { AiRecommendationsPage as default } from "@/src/modules/accounting/pages/ai/recommendations"; diff --git a/frontend/app/accounting/ai/reconciliation/page.tsx b/frontend/app/accounting/ai/reconciliation/page.tsx index d6fd2d8..9d3f8d7 100644 --- a/frontend/app/accounting/ai/reconciliation/page.tsx +++ b/frontend/app/accounting/ai/reconciliation/page.tsx @@ -1,7 +1,3 @@ -"use client"; - -import { BlockedModulePage } from "@/components/accounting/BusinessDocsPage"; - -export default function Page() { - return ; -} +"use client"; + +export { AiReconciliationPage as default } from "@/src/modules/accounting/pages/ai/reconciliation"; diff --git a/frontend/app/accounting/assets/accumulated/page.tsx b/frontend/app/accounting/assets/accumulated/page.tsx index 7a9ef1d..4cf58ec 100644 --- a/frontend/app/accounting/assets/accumulated/page.tsx +++ b/frontend/app/accounting/assets/accumulated/page.tsx @@ -1,3 +1,3 @@ -"use client"; -import { AssetAccumulatedPage } from "@/components/accounting/WorkflowScreens"; -export default function Page() { return ; } +"use client"; + +export { AssetsAccumulatedPage as default } from "@/src/modules/accounting/pages/assets/accumulated"; diff --git a/frontend/app/accounting/assets/dashboard/page.tsx b/frontend/app/accounting/assets/dashboard/page.tsx index 5a512a4..11eb47b 100644 --- a/frontend/app/accounting/assets/dashboard/page.tsx +++ b/frontend/app/accounting/assets/dashboard/page.tsx @@ -1,5 +1,3 @@ -import { redirect } from "next/navigation"; - -export default function Page() { - redirect("/accounting/assets"); -} +"use client"; + +export { AssetsDashboardPage as default } from "@/src/modules/accounting/pages/assets/dashboard"; diff --git a/frontend/app/accounting/assets/depreciate/page.tsx b/frontend/app/accounting/assets/depreciate/page.tsx index 5a512a4..5c7bbf1 100644 --- a/frontend/app/accounting/assets/depreciate/page.tsx +++ b/frontend/app/accounting/assets/depreciate/page.tsx @@ -1,5 +1,3 @@ -import { redirect } from "next/navigation"; - -export default function Page() { - redirect("/accounting/assets"); -} +"use client"; + +export { AssetsDepreciatePage as default } from "@/src/modules/accounting/pages/assets/depreciate"; diff --git a/frontend/app/accounting/assets/dispose/page.tsx b/frontend/app/accounting/assets/dispose/page.tsx index 657f19c..6714516 100644 --- a/frontend/app/accounting/assets/dispose/page.tsx +++ b/frontend/app/accounting/assets/dispose/page.tsx @@ -1,3 +1,3 @@ -"use client"; -import { AssetDisposalsPage } from "@/components/accounting/WorkflowScreens"; -export default function Page() { return ; } +"use client"; + +export { AssetsDisposePage as default } from "@/src/modules/accounting/pages/assets/dispose"; diff --git a/frontend/app/accounting/assets/page.tsx b/frontend/app/accounting/assets/page.tsx index 9c919a0..267a201 100644 --- a/frontend/app/accounting/assets/page.tsx +++ b/frontend/app/accounting/assets/page.tsx @@ -1,422 +1,3 @@ -"use client"; - -import { useState } from "react"; -import { useForm } from "react-hook-form"; -import { z } from "zod"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; -import { toast } from "sonner"; -import { Calendar, Plus } from "lucide-react"; -import { accountingApi } from "@/lib/accounting-api"; -import { useTenantId } from "@/hooks/useTenantId"; -import { formatMoney } from "@/lib/utils"; -import { - PageHeader, - Button, - Dialog, - Drawer, - Input, - DataTable, - EmptyState, - LoadingState, - ErrorState, - Badge, - Tabs, - FormField, - Select, - MoneyInput, -} from "@/components/ds"; - -const categorySchema = z.object({ - code: z.string().min(1, "کد الزامی است"), - name: z.string().min(1, "نام الزامی است"), - default_useful_life_months: z.number().int().min(1).optional(), -}); - -const assetSchema = z.object({ - code: z.string().min(1, "کد الزامی است"), - name: z.string().min(1, "نام الزامی است"), - category_id: z.string().optional(), - acquisition_cost: z.string().optional(), - residual_value: z.string().optional(), -}); - -const depreciateSchema = z.object({ - expense_account_id: z.string().min(1, "حساب هزینه را انتخاب کنید"), - accumulated_account_id: z.string().min(1, "حساب استهلاک انباشته را انتخاب کنید"), -}); - -type AssetRow = { id: string; code: string; name: string; status: string }; -type TabId = "categories" | "assets"; - -export default function AssetsPage() { - const { tenantId } = useTenantId(); - const qc = useQueryClient(); - const [tab, setTab] = useState("assets"); - const [categoryOpen, setCategoryOpen] = useState(false); - const [assetOpen, setAssetOpen] = useState(false); - const [depreciateAsset, setDepreciateAsset] = useState(null); - const [scheduleAsset, setScheduleAsset] = useState(null); - - const categoriesQ = useQuery({ - queryKey: ["accounting", tenantId, "asset-categories"], - queryFn: () => accountingApi.assets.listCategories(tenantId!), - enabled: !!tenantId, - }); - const assetsQ = useQuery({ - queryKey: ["accounting", tenantId, "assets"], - queryFn: () => accountingApi.assets.list(tenantId!), - enabled: !!tenantId, - }); - const accountsQ = useQuery({ - queryKey: ["accounting", tenantId, "accounts"], - queryFn: () => accountingApi.accounts.list(tenantId!), - enabled: !!tenantId, - }); - const scheduleQ = useQuery({ - queryKey: ["accounting", tenantId, "asset-schedule", scheduleAsset?.id], - queryFn: () => accountingApi.assets.schedule(tenantId!, scheduleAsset!.id), - enabled: !!tenantId && !!scheduleAsset, - }); - - const categoryForm = useForm>({ - resolver: zodResolver(categorySchema), - defaultValues: { code: "", name: "", default_useful_life_months: 60 }, - }); - const assetForm = useForm>({ - resolver: zodResolver(assetSchema), - defaultValues: { code: "", name: "", category_id: "", acquisition_cost: "0", residual_value: "0" }, - }); - const depreciateForm = useForm>({ - resolver: zodResolver(depreciateSchema), - defaultValues: { expense_account_id: "", accumulated_account_id: "" }, - }); - - const postableAccounts = (accountsQ.data ?? []).filter((a) => a.is_postable && a.status === "active"); - - const invalidateCategories = () => - qc.invalidateQueries({ queryKey: ["accounting", tenantId, "asset-categories"] }); - const invalidateAssets = () => qc.invalidateQueries({ queryKey: ["accounting", tenantId, "assets"] }); - - const createCategoryM = useMutation({ - mutationFn: (d: z.infer) => - accountingApi.assets.createCategory(tenantId!, { - code: d.code, - name: d.name, - default_useful_life_months: d.default_useful_life_months, - }), - onSuccess: async () => { - toast.success("دسته‌بندی ایجاد شد"); - setCategoryOpen(false); - categoryForm.reset(); - await invalidateCategories(); - }, - onError: (e: Error) => toast.error(e.message), - }); - - const createAssetM = useMutation({ - mutationFn: (d: z.infer) => - accountingApi.assets.create(tenantId!, { - code: d.code, - name: d.name, - category_id: d.category_id || undefined, - acquisition_cost: d.acquisition_cost, - residual_value: d.residual_value, - }), - onSuccess: async () => { - toast.success("دارایی ایجاد شد"); - setAssetOpen(false); - assetForm.reset(); - await invalidateAssets(); - }, - onError: (e: Error) => toast.error(e.message), - }); - - const activateM = useMutation({ - mutationFn: (id: string) => accountingApi.assets.activate(tenantId!, id), - onSuccess: async () => { - toast.success("دارایی فعال شد"); - await invalidateAssets(); - }, - onError: (e: Error) => toast.error(e.message), - }); - - const depreciateM = useMutation({ - mutationFn: (d: z.infer) => - accountingApi.assets.depreciate(tenantId!, depreciateAsset!.id, d), - onSuccess: async (res) => { - toast.success(`استهلاک ثبت شد — مبلغ ${formatMoney(res.amount)}`); - setDepreciateAsset(null); - depreciateForm.reset(); - await invalidateAssets(); - }, - onError: (e: Error) => toast.error(e.message), - }); - - if (!tenantId) return ; - const loading = categoriesQ.isLoading || assetsQ.isLoading || accountsQ.isLoading; - if (loading) return ; - const err = categoriesQ.error || assetsQ.error || accountsQ.error; - if (err) { - return ( - { - void categoriesQ.refetch(); - void assetsQ.refetch(); - void accountsQ.refetch(); - }} - /> - ); - } - - const statusTone = (s: string) => - s === "active" ? "success" : s === "draft" ? "default" : "warning"; - - const tabAction = - tab === "categories" ? ( - - ) : ( - - ); - - const scheduleRows = (scheduleQ.data?.schedule ?? []) as Record[]; - const scheduleColumns = - scheduleRows.length > 0 - ? Object.keys(scheduleRows[0]).map((k) => ({ key: k, header: k })) - : [{ key: "period", header: "دوره" }]; - - return ( -
- - - setTab(id as TabId)} - items={[ - { id: "assets", label: "دارایی‌ها" }, - { id: "categories", label: "دسته‌بندی‌ها" }, - ]} - /> - - {tab === "categories" && ( - String(r.default_useful_life_months ?? "—"), - }, - ]} - rows={(categoriesQ.data ?? []) as unknown as Record[]} - empty={ - setCategoryOpen(true)}>ایجاد دسته} /> - } - /> - )} - - {tab === "assets" && ( - {String(r.status)}, - }, - { - key: "actions", - header: "عملیات", - render: (r) => { - const row = r as unknown as AssetRow; - return ( -
- {row.status !== "active" && ( - - )} - {row.status === "active" && ( - - )} - -
- ); - }, - }, - ]} - rows={(assetsQ.data ?? []) as unknown as Record[]} - empty={ setAssetOpen(true)}>ایجاد دارایی} />} - /> - )} - - setCategoryOpen(false)} title="دسته‌بندی جدید"> -
createCategoryM.mutate(d))}> - - - - - - - - - -
- - -
-
-
- - setAssetOpen(false)} title="دارایی جدید"> -
createAssetM.mutate(d))}> - - - - - - - - - - - - - - - -
- - -
-
-
- - setDepreciateAsset(null)} - title="ثبت استهلاک" - description={depreciateAsset ? `${depreciateAsset.code} — ${depreciateAsset.name}` : undefined} - > -
depreciateM.mutate(d))}> - - - - - - -
- - -
-
-
- - setScheduleAsset(null)} - title="برنامه استهلاک" - description={scheduleAsset ? `${scheduleAsset.code} — ${scheduleAsset.name}` : undefined} - width="lg" - > - {scheduleQ.isLoading ? ( - - ) : scheduleQ.error ? ( - scheduleQ.refetch()} /> - ) : ( - ({ - ...c, - render: (r) => { - const v = r[c.key]; - if (typeof v === "number" || (typeof v === "string" && /^\d/.test(v))) { - return formatMoney(String(v)); - } - return String(v ?? "—"); - }, - }))} - rows={scheduleRows} - empty={} - /> - )} - -
- ); -} +"use client"; + +export { AssetsPage as default } from "@/src/modules/accounting/pages/assets"; diff --git a/frontend/app/accounting/assets/schedule/page.tsx b/frontend/app/accounting/assets/schedule/page.tsx index a738647..243813d 100644 --- a/frontend/app/accounting/assets/schedule/page.tsx +++ b/frontend/app/accounting/assets/schedule/page.tsx @@ -1,5 +1,3 @@ -import { AssetSchedulePage } from "@/components/accounting/DomainScreens"; - -export default function Page() { - return ; -} +"use client"; + +export { AssetsSchedulePage as default } from "@/src/modules/accounting/pages/assets/schedule"; diff --git a/frontend/app/accounting/assets/transfers/page.tsx b/frontend/app/accounting/assets/transfers/page.tsx index c60a5f4..23db370 100644 --- a/frontend/app/accounting/assets/transfers/page.tsx +++ b/frontend/app/accounting/assets/transfers/page.tsx @@ -1,3 +1,3 @@ -"use client"; -import { AssetTransfersPage } from "@/components/accounting/WorkflowScreens"; -export default function Page() { return ; } +"use client"; + +export { AssetsTransfersPage as default } from "@/src/modules/accounting/pages/assets/transfers"; diff --git a/frontend/app/accounting/assets/valuation/page.tsx b/frontend/app/accounting/assets/valuation/page.tsx index efa6a10..a4d06f2 100644 --- a/frontend/app/accounting/assets/valuation/page.tsx +++ b/frontend/app/accounting/assets/valuation/page.tsx @@ -1,3 +1,3 @@ -"use client"; -import { AssetRevaluationsPage } from "@/components/accounting/WorkflowScreens"; -export default function Page() { return ; } +"use client"; + +export { AssetsValuationPage as default } from "@/src/modules/accounting/pages/assets/valuation"; diff --git a/frontend/app/accounting/audit/page.tsx b/frontend/app/accounting/audit/page.tsx index 0aa16a0..1895edf 100644 --- a/frontend/app/accounting/audit/page.tsx +++ b/frontend/app/accounting/audit/page.tsx @@ -1,136 +1,3 @@ -"use client"; - -import { useState } from "react"; -import { useQuery } from "@tanstack/react-query"; -import { accountingApi } from "@/lib/accounting-api"; -import { useTenantId } from "@/hooks/useTenantId"; -import { - PageHeader, - DataTable, - EmptyState, - LoadingState, - ErrorState, - JalaliDateText, - Tabs, - Badge, -} from "@/components/ds"; - -type TabId = "compliance" | "posting"; - -export default function AuditPage() { - const { tenantId } = useTenantId(); - const [tab, setTab] = useState("compliance"); - - const complianceQ = useQuery({ - queryKey: ["accounting", tenantId, "compliance-audit"], - queryFn: () => accountingApi.compliance.listAudit(tenantId!), - enabled: !!tenantId && tab === "compliance", - }); - - const postingQ = useQuery({ - queryKey: ["accounting", tenantId, "posting-audit-logs"], - queryFn: () => accountingApi.vouchers.auditLogs(tenantId!), - enabled: !!tenantId && tab === "posting", - }); - - const activeQ = tab === "compliance" ? complianceQ : postingQ; - - if (!tenantId) return ; - if (activeQ.isLoading) return ; - if (activeQ.error) { - return activeQ.refetch()} />; - } - - return ( -
- - - setTab(id as TabId)} - items={[ - { id: "compliance", label: "رکوردهای انطباق" }, - { id: "posting", label: "لاگ ثبت اسناد" }, - ]} - /> - - {tab === "compliance" && ( - , - }, - { key: "action", header: "عملیات" }, - { key: "resource_type", header: "منبع" }, - { - key: "actor_user_id", - header: "عامل", - render: (r) => ( - - {String(r.actor_user_id ?? "—")} - - ), - }, - ]} - rows={(complianceQ.data ?? []) as unknown as Record[]} - empty={ - - } - /> - )} - - {tab === "posting" && ( - , - }, - { - key: "operation", - header: "عملیات", - render: (r) => {String(r.operation)}, - }, - { key: "voucher_number", header: "شماره سند", render: (r) => String(r.voucher_number ?? "—") }, - { key: "resource_type", header: "نوع منبع" }, - { - key: "resource_id", - header: "شناسه", - render: (r) => ( - - {String(r.resource_id ?? "—")} - - ), - }, - { - key: "actor_user_id", - header: "عامل", - render: (r) => ( - - {String(r.actor_user_id ?? "—")} - - ), - }, - ]} - rows={(postingQ.data ?? []) as unknown as Record[]} - empty={ - - } - /> - )} -
- ); -} +"use client"; + +export { AuditPage as default } from "@/src/modules/accounting/pages/audit"; diff --git a/frontend/app/accounting/budget/control/page.tsx b/frontend/app/accounting/budget/control/page.tsx index 8e4da4e..e52984a 100644 --- a/frontend/app/accounting/budget/control/page.tsx +++ b/frontend/app/accounting/budget/control/page.tsx @@ -1,23 +1,3 @@ -"use client"; -import { SpecializedOpsPage } from "@/components/accounting/SpecializedOpsPage"; -export default function Page() { - return ( - - ); -} +"use client"; + +export { BudgetControlPage as default } from "@/src/modules/accounting/pages/budget/control"; diff --git a/frontend/app/accounting/budget/definitions/page.tsx b/frontend/app/accounting/budget/definitions/page.tsx index 07353d2..659bfdf 100644 --- a/frontend/app/accounting/budget/definitions/page.tsx +++ b/frontend/app/accounting/budget/definitions/page.tsx @@ -1,23 +1,3 @@ -"use client"; -import { SpecializedOpsPage } from "@/components/accounting/SpecializedOpsPage"; -export default function Page() { - return ( - - ); -} +"use client"; + +export { BudgetDefinitionsPage as default } from "@/src/modules/accounting/pages/budget/definitions"; diff --git a/frontend/app/accounting/budget/forecast/page.tsx b/frontend/app/accounting/budget/forecast/page.tsx index e1d42c7..e7d7124 100644 --- a/frontend/app/accounting/budget/forecast/page.tsx +++ b/frontend/app/accounting/budget/forecast/page.tsx @@ -1,23 +1,3 @@ -"use client"; -import { SpecializedOpsPage } from "@/components/accounting/SpecializedOpsPage"; -export default function Page() { - return ( - - ); -} +"use client"; + +export { BudgetForecastPage as default } from "@/src/modules/accounting/pages/budget/forecast"; diff --git a/frontend/app/accounting/budget/operational/page.tsx b/frontend/app/accounting/budget/operational/page.tsx index ad7c01e..bef5648 100644 --- a/frontend/app/accounting/budget/operational/page.tsx +++ b/frontend/app/accounting/budget/operational/page.tsx @@ -1,23 +1,3 @@ -"use client"; -import { SpecializedOpsPage } from "@/components/accounting/SpecializedOpsPage"; -export default function Page() { - return ( - - ); -} +"use client"; + +export { BudgetOperationalPage as default } from "@/src/modules/accounting/pages/budget/operational"; diff --git a/frontend/app/accounting/budget/performance/page.tsx b/frontend/app/accounting/budget/performance/page.tsx index ab80f33..c758730 100644 --- a/frontend/app/accounting/budget/performance/page.tsx +++ b/frontend/app/accounting/budget/performance/page.tsx @@ -1,23 +1,3 @@ -"use client"; -import { SpecializedOpsPage } from "@/components/accounting/SpecializedOpsPage"; -export default function Page() { - return ( - - ); -} +"use client"; + +export { BudgetPerformancePage as default } from "@/src/modules/accounting/pages/budget/performance"; diff --git a/frontend/app/accounting/budget/reports/page.tsx b/frontend/app/accounting/budget/reports/page.tsx index 8bb844e..8c6f8fd 100644 --- a/frontend/app/accounting/budget/reports/page.tsx +++ b/frontend/app/accounting/budget/reports/page.tsx @@ -1,23 +1,3 @@ -"use client"; -import { SpecializedOpsPage } from "@/components/accounting/SpecializedOpsPage"; -export default function Page() { - return ( - - ); -} +"use client"; + +export { BudgetReportsPage as default } from "@/src/modules/accounting/pages/budget/reports"; diff --git a/frontend/app/accounting/budget/scenarios/page.tsx b/frontend/app/accounting/budget/scenarios/page.tsx index 1575df7..6a6351f 100644 --- a/frontend/app/accounting/budget/scenarios/page.tsx +++ b/frontend/app/accounting/budget/scenarios/page.tsx @@ -1,23 +1,3 @@ -"use client"; -import { SpecializedOpsPage } from "@/components/accounting/SpecializedOpsPage"; -export default function Page() { - return ( - - ); -} +"use client"; + +export { BudgetScenariosPage as default } from "@/src/modules/accounting/pages/budget/scenarios"; diff --git a/frontend/app/accounting/budget/variance/page.tsx b/frontend/app/accounting/budget/variance/page.tsx index fde46ca..1b33052 100644 --- a/frontend/app/accounting/budget/variance/page.tsx +++ b/frontend/app/accounting/budget/variance/page.tsx @@ -1,23 +1,3 @@ -"use client"; -import { SpecializedOpsPage } from "@/components/accounting/SpecializedOpsPage"; -export default function Page() { - return ( - - ); -} +"use client"; + +export { BudgetVariancePage as default } from "@/src/modules/accounting/pages/budget/variance"; diff --git a/frontend/app/accounting/chart-of-accounts/page.tsx b/frontend/app/accounting/chart-of-accounts/page.tsx index a7aa766..c153548 100644 --- a/frontend/app/accounting/chart-of-accounts/page.tsx +++ b/frontend/app/accounting/chart-of-accounts/page.tsx @@ -1,644 +1,3 @@ -"use client"; - -import { useMemo, useState } from "react"; -import { useForm } from "react-hook-form"; -import { z } from "zod"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; -import { toast } from "sonner"; -import { Plus, Archive, Pencil } from "lucide-react"; -import { accountingApi, type Account, type ChartOfAccounts } from "@/lib/accounting-api"; -import { useTenantId } from "@/hooks/useTenantId"; -import { - PageHeader, - Button, - Dialog, - Input, - Label, - FieldError, - Textarea, - DataTable, - EmptyState, - LoadingState, - ErrorState, - Badge, - Select, - Drawer, - TableToolbar, - Tabs, - Checkbox, -} from "@/components/ds"; - -const chartSchema = z.object({ - code: z.string().min(1, "کد الزامی است"), - name: z.string().min(1, "نام الزامی است"), - description: z.string().optional(), - is_default: z.boolean().optional(), -}); - -const accountSchema = z.object({ - chart_id: z.string().uuid("دفتر حساب را انتخاب کنید"), - code: z.string().min(1, "کد الزامی است"), - name: z.string().min(1, "نام الزامی است"), - account_type: z.string().min(1), - account_category: z.string().min(1), - parent_id: z.string().optional(), - is_group: z.boolean().optional(), - is_postable: z.boolean().optional(), - description: z.string().optional(), -}); - -type ChartForm = z.infer; -const editChartSchema = chartSchema.omit({ code: true }).extend({ code: z.string().optional() }); -type EditChartForm = z.infer; -type AccountForm = z.infer; - -const ACCOUNT_TYPES = [ - { value: "asset", label: "دارایی" }, - { value: "liability", label: "بدهی" }, - { value: "equity", label: "حقوق صاحبان سهام" }, - { value: "revenue", label: "درآمد" }, - { value: "expense", label: "هزینه" }, -]; - -const ACCOUNT_CATEGORIES = [ - { value: "current_asset", label: "دارایی جاری" }, - { value: "non_current_asset", label: "دارایی غیرجاری" }, - { value: "current_liability", label: "بدهی جاری" }, - { value: "non_current_liability", label: "بدهی غیرجاری" }, - { value: "equity", label: "حقوق صاحبان سهام" }, - { value: "operating_revenue", label: "درآمد عملیاتی" }, - { value: "other_revenue", label: "سایر درآمدها" }, - { value: "operating_expense", label: "هزینه عملیاتی" }, - { value: "other_expense", label: "سایر هزینه‌ها" }, -]; - -export default function ChartOfAccountsPage() { - const { tenantId } = useTenantId(); - const qc = useQueryClient(); - const [tab, setTab] = useState("accounts"); - const [chartOpen, setChartOpen] = useState(false); - const [accountOpen, setAccountOpen] = useState(false); - const [editChart, setEditChart] = useState(null); - const [selected, setSelected] = useState(null); - const [filterChart, setFilterChart] = useState(""); - const [search, setSearch] = useState(""); - const [showInactive, setShowInactive] = useState(false); - - const chartsQ = useQuery({ - queryKey: ["accounting", tenantId, "charts"], - queryFn: () => accountingApi.charts.list(tenantId!), - enabled: !!tenantId, - }); - const accountsQ = useQuery({ - queryKey: ["accounting", tenantId, "accounts", filterChart], - queryFn: () => accountingApi.accounts.list(tenantId!, 1, 500, filterChart || undefined), - enabled: !!tenantId, - }); - - const chartForm = useForm({ - resolver: zodResolver(chartSchema), - defaultValues: { code: "", name: "", description: "", is_default: false }, - }); - const accountForm = useForm({ - resolver: zodResolver(accountSchema), - defaultValues: { - chart_id: "", - code: "", - name: "", - account_type: "asset", - account_category: "current_asset", - parent_id: "", - is_group: false, - is_postable: true, - description: "", - }, - }); - const editChartForm = useForm({ - resolver: zodResolver(editChartSchema), - }); - const editAccountForm = useForm({ - defaultValues: { name: "", status: "active", description: "", is_postable: true }, - }); - - const invalidate = async () => { - await qc.invalidateQueries({ queryKey: ["accounting", tenantId, "charts"] }); - await qc.invalidateQueries({ queryKey: ["accounting", tenantId, "accounts"] }); - }; - - const createChart = useMutation({ - mutationFn: (data: ChartForm) => accountingApi.charts.create(tenantId!, data), - onSuccess: async () => { - toast.success("دفتر حساب ایجاد شد"); - setChartOpen(false); - chartForm.reset(); - await invalidate(); - }, - onError: (e: Error) => toast.error(e.message), - }); - - const updateChart = useMutation({ - mutationFn: (data: ChartForm) => - accountingApi.charts.update(tenantId!, editChart!.id, { - name: data.name, - description: data.description, - is_default: data.is_default, - }), - onSuccess: async () => { - toast.success("دفتر به‌روز شد"); - setEditChart(null); - await invalidate(); - }, - onError: (e: Error) => toast.error(e.message), - }); - - const archiveChart = useMutation({ - mutationFn: (id: string) => accountingApi.charts.archive(tenantId!, id), - onSuccess: async () => { - toast.success("دفتر آرشیو شد"); - await invalidate(); - }, - onError: (e: Error) => toast.error(e.message), - }); - - const createAccount = useMutation({ - mutationFn: (data: AccountForm) => - accountingApi.accounts.create(tenantId!, { - ...data, - parent_id: data.parent_id || null, - is_postable: data.is_postable ?? true, - is_group: data.is_group ?? false, - }), - onSuccess: async () => { - toast.success("حساب ایجاد شد"); - setAccountOpen(false); - await invalidate(); - }, - onError: (e: Error) => toast.error(e.message), - }); - - const updateAccount = useMutation({ - mutationFn: (body: { name: string; status: string; description?: string; is_postable: boolean }) => - accountingApi.accounts.update(tenantId!, selected!.id, body), - onSuccess: async () => { - toast.success("حساب به‌روز شد"); - setSelected(null); - await invalidate(); - }, - onError: (e: Error) => toast.error(e.message), - }); - - const archiveAccount = useMutation({ - mutationFn: (id: string) => accountingApi.accounts.archive(tenantId!, id), - onSuccess: async () => { - toast.success("حساب آرشیو شد"); - setSelected(null); - await invalidate(); - }, - onError: (e: Error) => toast.error(e.message), - }); - - const rows = useMemo(() => { - let list = accountsQ.data ?? []; - if (!showInactive) list = list.filter((a) => a.status === "active"); - if (search.trim()) { - const q = search.trim().toLowerCase(); - list = list.filter( - (a) => a.code.toLowerCase().includes(q) || a.name.toLowerCase().includes(q) - ); - } - return [...list].sort((a, b) => a.code.localeCompare(b.code, "fa")); - }, [accountsQ.data, search, showInactive]); - - if (!tenantId) return ; - if (chartsQ.isLoading || accountsQ.isLoading) return ; - if (chartsQ.error || accountsQ.error) { - return ( - { - void chartsQ.refetch(); - void accountsQ.refetch(); - }} - /> - ); - } - - const chartName = (id: string) => chartsQ.data?.find((c) => c.id === id)?.name ?? id; - - return ( -
- - - - - } - /> - - - - {tab === "charts" ? ( -
- {chartsQ.data?.map((c) => ( -
-
-
-

{c.name}

-

- {c.code} -

-
-
- {c.is_default ? پیش‌فرض : null} - - {c.is_active ? "فعال" : "آرشیو"} - -
-
-
- - {c.is_active ? ( - - ) : null} - -
-
- ))} - {!chartsQ.data?.length ? ( - setChartOpen(true)}> - ایجاد دفتر - - } - /> - ) : null} -
- ) : ( - <> - - - setShowInactive(e.target.checked)} - /> - - } - /> - - {/* Mobile cards */} -
- {rows.map((r) => ( - - ))} - {!rows.length ? : null} -
- -
- ( - - {String(r.code)} - - ), - }, - { key: "name", header: "نام" }, - { - key: "chart_id", - header: "دفتر", - render: (r) => chartName(String(r.chart_id)), - }, - { - key: "account_type", - header: "نوع", - render: (r) => - ACCOUNT_TYPES.find((t) => t.value === r.account_type)?.label ?? String(r.account_type), - }, - { - key: "status", - header: "وضعیت", - render: (r) => ( - {String(r.status)} - ), - }, - { - key: "id", - header: "", - render: (r) => ( - - ), - }, - ]} - rows={rows as unknown as Record[]} - empty={ - setChartOpen(true)}> - ایجاد دفتر حساب - - } - /> - } - /> -
- - )} - - setChartOpen(false)} title="ایجاد دفتر حساب"> -
createChart.mutate(d))}> -
- - - {chartForm.formState.errors.code?.message} -
-
- - - {chartForm.formState.errors.name?.message} -
-
- -