"use client";

import { createDeliveryListPage } from "@/modules/delivery/components/DeliveryListCrudPage";
import { deliveryApi } from "@/modules/delivery/services/delivery-api";

export const ExternalProvidersPage = createDeliveryListPage({
  title: "ارائه‌دهندگان خارجی",
  breadcrumb: "ارائه‌دهندگان خارجی",
  resourceKey: "externalProviders",
  permission: "delivery.external_providers.view",
  api: deliveryApi.externalProviders,
  columns: [
    { key: "code", header: "کد" },
    { key: "name", header: "نام" },
    { key: "status", header: "وضعیت", type: "status" },
    { key: "created_at", header: "ایجاد", type: "datetime" },
  ],
  createFields: [
    { name: "organization_id", label: "سازمان", type: "organization", required: true },
    { name: "code", label: "کد", required: true },
    { name: "name", label: "نام", required: true },
    { name: "provider_kind", label: "نوع", type: "select", options: [
      { value: "routing_engine", label: "مسیریابی" },
      { value: "fleet", label: "ناوگان" },
      { value: "courier", label: "پیک" },
      { value: "maps", label: "نقشه" },
    ]},
  ],
});

export default ExternalProvidersPage;
