TorbatYar/frontend/modules/hospitality/features/venues.tsx
Mortezakoohjani 065c053c16 Add complete Torbat Food hospitality frontend connected to backend APIs.
Introduces modules/hospitality with 54 routes, BFF proxy, capability-gated nav, CRUD factory, and architecture validation docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 20:54:26 +03:30

54 lines
1.7 KiB
TypeScript

"use client";
import { createHospitalityListPage } from "@/modules/hospitality/components/HospitalityListCrudPage";
import { hospitalityApi } from "@/modules/hospitality/services/hospitality-api";
import { venueFormatLabels } from "@/modules/hospitality/design-system/tokens";
export const BranchesPage = createHospitalityListPage({
title: "مکان‌ها (Venues)",
description: "مدیریت مکان‌های مهمان‌نوازی — کافه، رستوران، فست‌فود و …",
breadcrumb: "مکان‌ها",
resourceKey: "venues",
bundleFeature: null,
permission: "hospitality.venues.view",
api: hospitalityApi.venues,
columns: [
{ key: "code", header: "کد" },
{ key: "name", header: "نام" },
{
key: "venue_format",
header: "نوع",
render: (r) => venueFormatLabels[String(r.venue_format)] ?? String(r.venue_format),
},
{ key: "status", header: "وضعیت", type: "status" },
{ key: "currency_code", header: "ارز" },
],
createFields: [
{ name: "code", label: "کد", required: true },
{ name: "name", label: "نام", required: true },
{
name: "venue_format",
label: "نوع کسب‌وکار",
type: "select",
required: true,
options: Object.entries(venueFormatLabels).map(([value, label]) => ({ value, label })),
},
],
editFields: [
{ name: "name", label: "نام", required: true },
{
name: "status",
label: "وضعیت",
type: "select",
options: [
{ value: "draft", label: "پیش‌نویس" },
{ value: "active", label: "فعال" },
{ value: "inactive", label: "غیرفعال" },
],
},
],
filterDeleted: true,
});
export default BranchesPage;