feat: emlak CRM iskelet kurulumu
- schema.ts tamamen yeniden yazıldı (properties, customers, customer_searches, property_matches, presentations, investors, activities, tenant_settings) - Sidebar emlak modüllerine güncellendi (İlanlar, Müşteriler, Yatırımcılar, Sunumlar, Aktiviteler) - Eski CRM lib dosyaları temizlendi (finance, invoice, lead, task, software, vs.) - Yeni modül dizinleri oluşturuldu (stub pages) - command-search emlak navigasyonuna güncellendi - site-header temizlendi - Typecheck: 0 hata (chart.tsx template hariç)
This commit is contained in:
@@ -1,54 +1,8 @@
|
||||
import type { Metadata } from "next";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { UsageBanner } from "@/components/billing/usage-banner";
|
||||
import { listCustomers } from "@/lib/appwrite/customer-queries";
|
||||
import { getPlanUsage } from "@/lib/appwrite/plan-limits";
|
||||
import { requireTenant } from "@/lib/appwrite/tenant-guard";
|
||||
import { CustomersClient } from "./components/customers-client";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "İşletmem — Müşteriler",
|
||||
};
|
||||
|
||||
export default async function CustomersPage() {
|
||||
let ctx;
|
||||
try {
|
||||
ctx = await requireTenant();
|
||||
} catch {
|
||||
redirect("/onboarding");
|
||||
}
|
||||
|
||||
const [customers, usage] = await Promise.all([
|
||||
listCustomers(ctx.tenantId),
|
||||
getPlanUsage(ctx),
|
||||
]);
|
||||
|
||||
export default function CustomersPage() {
|
||||
return (
|
||||
<div className="flex-1 space-y-6 px-6 pt-0">
|
||||
<div className="flex flex-col gap-1">
|
||||
<p className="text-muted-foreground text-sm">{ctx.settings?.companyName ?? "Çalışma alanı"}</p>
|
||||
<h1 className="text-2xl font-bold tracking-tight">Müşteriler</h1>
|
||||
<p className="text-muted-foreground text-sm">
|
||||
Müşterilerinizi yönetin, hizmet ve yazılım ilişkilerini buradan kurun.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<UsageBanner usage={usage} resource="customers" />
|
||||
|
||||
<CustomersClient
|
||||
customers={customers.map((c) => ({
|
||||
id: c.$id,
|
||||
name: c.name,
|
||||
email: c.email ?? "",
|
||||
phone: c.phone ?? "",
|
||||
taxId: c.taxId ?? "",
|
||||
address: c.address ?? "",
|
||||
notes: c.notes ?? "",
|
||||
status: (c.status ?? "active") as "active" | "passive",
|
||||
createdAt: c.$createdAt,
|
||||
}))}
|
||||
/>
|
||||
<div className="flex flex-1 flex-col gap-4 p-4">
|
||||
<h1 className="text-2xl font-bold">Müşteriler</h1>
|
||||
<p className="text-muted-foreground">Yakında...</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user