feat: complete admission workspace
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import { BedDouble, DoorOpen, History, Wrench } from "lucide-react";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Table } from "@/components/ui/table";
|
||||
import { getCurrentAuthContext } from "@/modules/core/server/auth";
|
||||
import { hasPermission } from "@/modules/core/server/permissions";
|
||||
import { readData } from "@/modules/core/server/store";
|
||||
import { BedsWorkspace } from "@/modules/facilities/components/BedsWorkspace";
|
||||
|
||||
export default async function BedsPage(): Promise<React.ReactElement> {
|
||||
const context = await getCurrentAuthContext();
|
||||
@@ -25,211 +22,15 @@ export default async function BedsPage(): Promise<React.ReactElement> {
|
||||
const admissions = organizationId
|
||||
? data.admissions.filter((admission) => admission.organizationId === organizationId)
|
||||
: data.admissions;
|
||||
|
||||
const occupiedBeds = beds.filter((bed) => bed.status === "occupied").length;
|
||||
const maintenanceBeds = beds.filter((bed) => bed.status === "maintenance").length;
|
||||
const occupancyRate = beds.length > 0 ? Math.round((occupiedBeds / beds.length) * 100) : 0;
|
||||
const elders = organizationId ? data.elders.filter((elder) => elder.organizationId === organizationId) : data.elders;
|
||||
|
||||
return (
|
||||
<div className="mx-auto flex w-full max-w-7xl flex-col gap-5">
|
||||
<section className="flex flex-col gap-4 border-b pb-5 lg:flex-row lg:items-end lg:justify-between">
|
||||
<div>
|
||||
<Badge variant="success">Facility + Admission</Badge>
|
||||
<h1 className="mt-3 text-3xl font-semibold tracking-normal">床位房间</h1>
|
||||
<p className="mt-2 text-sm text-muted-foreground">房间主数据、床位状态、当前占用和入住历史。</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="grid gap-4 md:grid-cols-2 xl:grid-cols-4">
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0">
|
||||
<div>
|
||||
<CardDescription>房间</CardDescription>
|
||||
<CardTitle className="mt-2 text-3xl">{rooms.length}</CardTitle>
|
||||
</div>
|
||||
<DoorOpen className="size-5 text-primary" aria-hidden="true" />
|
||||
</CardHeader>
|
||||
</Card>
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0">
|
||||
<div>
|
||||
<CardDescription>床位</CardDescription>
|
||||
<CardTitle className="mt-2 text-3xl">{beds.length}</CardTitle>
|
||||
</div>
|
||||
<BedDouble className="size-5 text-primary" aria-hidden="true" />
|
||||
</CardHeader>
|
||||
<CardContent className="pt-0">
|
||||
<p className="text-sm text-muted-foreground">占用率 {occupancyRate}%</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Card className={maintenanceBeds > 0 ? "border-amber-200 bg-amber-50/70" : undefined}>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0">
|
||||
<div>
|
||||
<CardDescription className={maintenanceBeds > 0 ? "text-amber-700" : undefined}>维修床位</CardDescription>
|
||||
<CardTitle className={maintenanceBeds > 0 ? "mt-2 text-3xl text-amber-700" : "mt-2 text-3xl"}>
|
||||
{maintenanceBeds}
|
||||
</CardTitle>
|
||||
</div>
|
||||
<Wrench className={maintenanceBeds > 0 ? "size-5 text-amber-700" : "size-5 text-primary"} aria-hidden="true" />
|
||||
</CardHeader>
|
||||
</Card>
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0">
|
||||
<div>
|
||||
<CardDescription>入住历史</CardDescription>
|
||||
<CardTitle className="mt-2 text-3xl">{admissions.length}</CardTitle>
|
||||
</div>
|
||||
<History className="size-5 text-primary" aria-hidden="true" />
|
||||
</CardHeader>
|
||||
</Card>
|
||||
</section>
|
||||
|
||||
<section className="grid gap-4 xl:grid-cols-[0.9fr_1.1fr]">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>房间台账</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="overflow-x-auto rounded-md border">
|
||||
<Table className="w-full min-w-[620px] text-sm">
|
||||
<Table.Header className="bg-secondary text-left text-xs text-muted-foreground">
|
||||
<Table.Row>
|
||||
<Table.Head className="px-4 py-3 font-medium">房间</Table.Head>
|
||||
<Table.Head className="px-4 py-3 font-medium">编号</Table.Head>
|
||||
<Table.Head className="px-4 py-3 font-medium">容量</Table.Head>
|
||||
<Table.Head className="px-4 py-3 font-medium">床位</Table.Head>
|
||||
<Table.Head className="px-4 py-3 font-medium">状态</Table.Head>
|
||||
</Table.Row>
|
||||
</Table.Header>
|
||||
<Table.Body className="divide-y bg-card">
|
||||
{rooms.map((room) => (
|
||||
<Table.Row key={room.id}>
|
||||
<Table.Cell className="px-4 py-3 font-medium">{room.name}</Table.Cell>
|
||||
<Table.Cell className="px-4 py-3 text-muted-foreground">{room.code}</Table.Cell>
|
||||
<Table.Cell className="px-4 py-3">{room.capacity}</Table.Cell>
|
||||
<Table.Cell className="px-4 py-3">
|
||||
{room.occupiedBedCount}/{room.bedCount}
|
||||
</Table.Cell>
|
||||
<Table.Cell className="px-4 py-3">
|
||||
<Badge variant={room.status === "active" ? "success" : "danger"}>{room.status}</Badge>
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
))}
|
||||
{rooms.length === 0 ? (
|
||||
<Table.Row>
|
||||
<Table.Cell className="px-4 py-8 text-center text-muted-foreground" colSpan={5}>
|
||||
暂无房间,请通过 /api/facilities/rooms 创建
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
) : null}
|
||||
</Table.Body>
|
||||
</Table>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>床位状态</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="overflow-x-auto rounded-md border">
|
||||
<Table className="w-full min-w-[700px] text-sm">
|
||||
<Table.Header className="bg-secondary text-left text-xs text-muted-foreground">
|
||||
<Table.Row>
|
||||
<Table.Head className="px-4 py-3 font-medium">房间</Table.Head>
|
||||
<Table.Head className="px-4 py-3 font-medium">床位</Table.Head>
|
||||
<Table.Head className="px-4 py-3 font-medium">状态</Table.Head>
|
||||
<Table.Head className="px-4 py-3 font-medium">当前老人</Table.Head>
|
||||
<Table.Head className="px-4 py-3 font-medium">备注</Table.Head>
|
||||
</Table.Row>
|
||||
</Table.Header>
|
||||
<Table.Body className="divide-y bg-card">
|
||||
{beds.map((bed) => (
|
||||
<Table.Row key={bed.id}>
|
||||
<Table.Cell className="px-4 py-3">{bed.roomName}</Table.Cell>
|
||||
<Table.Cell className="px-4 py-3 font-medium">{bed.code}</Table.Cell>
|
||||
<Table.Cell className="px-4 py-3">
|
||||
<Badge
|
||||
variant={
|
||||
bed.status === "available"
|
||||
? "success"
|
||||
: bed.status === "occupied"
|
||||
? "secondary"
|
||||
: bed.status === "maintenance"
|
||||
? "warning"
|
||||
: "danger"
|
||||
}
|
||||
>
|
||||
{bed.status}
|
||||
</Badge>
|
||||
</Table.Cell>
|
||||
<Table.Cell className="px-4 py-3">{bed.currentElderName ?? "-"}</Table.Cell>
|
||||
<Table.Cell className="px-4 py-3 text-muted-foreground">{bed.notes || "-"}</Table.Cell>
|
||||
</Table.Row>
|
||||
))}
|
||||
{beds.length === 0 ? (
|
||||
<Table.Row>
|
||||
<Table.Cell className="px-4 py-8 text-center text-muted-foreground" colSpan={5}>
|
||||
暂无床位,请通过 /api/facilities/beds 创建
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
) : null}
|
||||
</Table.Body>
|
||||
</Table>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</section>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>入住与换床历史</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="overflow-x-auto rounded-md border">
|
||||
<Table className="w-full min-w-[820px] text-sm">
|
||||
<Table.Header className="bg-secondary text-left text-xs text-muted-foreground">
|
||||
<Table.Row>
|
||||
<Table.Head className="px-4 py-3 font-medium">老人</Table.Head>
|
||||
<Table.Head className="px-4 py-3 font-medium">床位</Table.Head>
|
||||
<Table.Head className="px-4 py-3 font-medium">状态</Table.Head>
|
||||
<Table.Head className="px-4 py-3 font-medium">入住时间</Table.Head>
|
||||
<Table.Head className="px-4 py-3 font-medium">结束时间</Table.Head>
|
||||
<Table.Head className="px-4 py-3 font-medium">备注</Table.Head>
|
||||
</Table.Row>
|
||||
</Table.Header>
|
||||
<Table.Body className="divide-y bg-card">
|
||||
{admissions.map((admission) => (
|
||||
<Table.Row key={admission.id}>
|
||||
<Table.Cell className="px-4 py-3 font-medium">{admission.elderName}</Table.Cell>
|
||||
<Table.Cell className="px-4 py-3">
|
||||
{admission.roomName}-{admission.bedCode}
|
||||
</Table.Cell>
|
||||
<Table.Cell className="px-4 py-3">
|
||||
<Badge variant={admission.status === "active" ? "success" : "secondary"}>{admission.status}</Badge>
|
||||
</Table.Cell>
|
||||
<Table.Cell className="px-4 py-3 text-muted-foreground">
|
||||
{new Date(admission.admittedAt).toLocaleString("zh-CN")}
|
||||
</Table.Cell>
|
||||
<Table.Cell className="px-4 py-3 text-muted-foreground">
|
||||
{admission.dischargedAt ? new Date(admission.dischargedAt).toLocaleString("zh-CN") : "-"}
|
||||
</Table.Cell>
|
||||
<Table.Cell className="px-4 py-3 text-muted-foreground">{admission.notes || "-"}</Table.Cell>
|
||||
</Table.Row>
|
||||
))}
|
||||
{admissions.length === 0 ? (
|
||||
<Table.Row>
|
||||
<Table.Cell className="px-4 py-8 text-center text-muted-foreground" colSpan={6}>
|
||||
暂无入住历史
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
) : null}
|
||||
</Table.Body>
|
||||
</Table>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
<BedsWorkspace
|
||||
initialAdmissions={admissions}
|
||||
initialBeds={beds}
|
||||
initialElders={elders}
|
||||
initialRooms={rooms}
|
||||
permissions={context.permissions}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,75 @@
|
||||
import { DashboardHome } from "@/modules/dashboard/components/DashboardHome";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default function DashboardPage(): React.ReactElement {
|
||||
return <DashboardHome />;
|
||||
import { getCurrentAuthContext } from "@/modules/core/server/auth";
|
||||
import { readData } from "@/modules/core/server/store";
|
||||
import type { BedStatus } from "@/modules/core/types";
|
||||
import { DashboardHome, type DashboardMetric } from "@/modules/dashboard/components/DashboardHome";
|
||||
|
||||
const BED_STATUSES: BedStatus[] = ["available", "occupied", "maintenance", "disabled"];
|
||||
|
||||
export default async function DashboardPage(): Promise<React.ReactElement> {
|
||||
const context = await getCurrentAuthContext();
|
||||
if (!context) {
|
||||
redirect("/login");
|
||||
}
|
||||
|
||||
const data = await readData();
|
||||
const organizationId = context.organization?.id;
|
||||
const elders = organizationId ? data.elders.filter((elder) => elder.organizationId === organizationId) : data.elders;
|
||||
const beds = organizationId ? data.beds.filter((bed) => bed.organizationId === organizationId) : data.beds;
|
||||
const admissions = organizationId
|
||||
? data.admissions.filter((admission) => admission.organizationId === organizationId)
|
||||
: data.admissions;
|
||||
const incidents = organizationId
|
||||
? data.incidents.filter((incident) => !incident.organizationId || incident.organizationId === organizationId)
|
||||
: data.incidents;
|
||||
|
||||
const activeElders = elders.filter((elder) => elder.status === "active").length;
|
||||
const pendingElders = elders.filter((elder) => elder.status === "pending").length;
|
||||
const occupiedBeds = beds.filter((bed) => bed.status === "occupied").length;
|
||||
const availableBeds = beds.filter((bed) => bed.status === "available").length;
|
||||
const activeAdmissions = admissions.filter((admission) => admission.status === "active").length;
|
||||
const openIncidents = incidents.filter((incident) => incident.status !== "closed").length;
|
||||
|
||||
const metrics: DashboardMetric[] = [
|
||||
{ label: "在院老人", value: String(activeElders), trend: `待入住 ${pendingElders}`, icon: "users" },
|
||||
{ label: "床位占用", value: `${occupiedBeds}/${beds.length}`, trend: `空闲 ${availableBeds}`, icon: "beds" },
|
||||
{ label: "当前入住", value: String(activeAdmissions), trend: `历史 ${admissions.length}`, icon: "admissions" },
|
||||
{ label: "未关闭故障", value: String(openIncidents), trend: `总计 ${incidents.length}`, icon: "incidents" },
|
||||
];
|
||||
|
||||
const occupancyData = BED_STATUSES.map((status) => ({
|
||||
label: status,
|
||||
count: beds.filter((bed) => bed.status === status).length,
|
||||
}));
|
||||
|
||||
const recentAdmissions = admissions.slice(0, 6).map((admission) => ({
|
||||
id: admission.id,
|
||||
elderName: admission.elderName,
|
||||
bedLabel: `${admission.roomName}-${admission.bedCode}`,
|
||||
status: admission.status,
|
||||
admittedAt: admission.admittedAt,
|
||||
dischargedAt: admission.dischargedAt,
|
||||
}));
|
||||
|
||||
const visibleIncidents = incidents
|
||||
.filter((incident) => incident.status !== "closed")
|
||||
.slice(0, 6)
|
||||
.map((incident) => ({
|
||||
id: incident.id,
|
||||
severity: incident.severity,
|
||||
status: incident.status,
|
||||
title: incident.title,
|
||||
source: incident.source,
|
||||
createdAt: incident.createdAt,
|
||||
}));
|
||||
|
||||
return (
|
||||
<DashboardHome
|
||||
incidents={visibleIncidents}
|
||||
metrics={metrics}
|
||||
occupancyData={occupancyData}
|
||||
recentAdmissions={recentAdmissions}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,5 +11,10 @@ export default async function EldersPage(): Promise<React.ReactElement> {
|
||||
}
|
||||
|
||||
const data = await readData();
|
||||
return <EldersClient initialElders={data.elders} permissions={context.permissions} />;
|
||||
const organizationId = context.organization?.id;
|
||||
const elders = organizationId
|
||||
? data.elders.filter((elder) => elder.organizationId === organizationId)
|
||||
: data.elders;
|
||||
|
||||
return <EldersClient initialElders={elders} permissions={context.permissions} />;
|
||||
}
|
||||
|
||||
109
app/api/admissions/[id]/route.ts
Normal file
109
app/api/admissions/[id]/route.ts
Normal file
@@ -0,0 +1,109 @@
|
||||
import { and, eq } from "drizzle-orm";
|
||||
|
||||
import { jsonFailure, jsonSuccess, readJsonBody } from "@/modules/core/server/api";
|
||||
import { recordAuditLog } from "@/modules/core/server/audit";
|
||||
import { requirePermission } from "@/modules/core/server/auth";
|
||||
import { getDatabase } from "@/modules/core/server/db";
|
||||
import { admissions, beds, elders } from "@/modules/core/server/schema";
|
||||
|
||||
type RouteContext = {
|
||||
params: Promise<{
|
||||
id: string;
|
||||
}>;
|
||||
};
|
||||
|
||||
type AdmissionRow = typeof admissions.$inferSelect;
|
||||
|
||||
type DischargeResult =
|
||||
| {
|
||||
success: true;
|
||||
admission: AdmissionRow;
|
||||
}
|
||||
| {
|
||||
success: false;
|
||||
reason: string;
|
||||
status: number;
|
||||
};
|
||||
|
||||
function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
return typeof value === "object" && value !== null && !Array.isArray(value);
|
||||
}
|
||||
|
||||
function readString(source: Record<string, unknown>, key: string): string {
|
||||
const value = source[key];
|
||||
return typeof value === "string" ? value.trim() : "";
|
||||
}
|
||||
|
||||
export async function PATCH(request: Request, context: RouteContext): Promise<Response> {
|
||||
const { id } = await context.params;
|
||||
const auth = await requirePermission("admission:manage", {
|
||||
action: "admission.discharge",
|
||||
targetType: "admission",
|
||||
targetId: id,
|
||||
});
|
||||
|
||||
if (!auth.success) {
|
||||
return auth.response;
|
||||
}
|
||||
|
||||
const organizationId = auth.context.organization?.id;
|
||||
if (!organizationId) {
|
||||
return jsonFailure("请选择机构后办理退住", 400);
|
||||
}
|
||||
|
||||
const body = await readJsonBody(request);
|
||||
const notes = isRecord(body) ? readString(body, "notes") : "";
|
||||
|
||||
const database = getDatabase();
|
||||
const result = await database.transaction(async (transaction): Promise<DischargeResult> => {
|
||||
const admissionRows = await transaction
|
||||
.select()
|
||||
.from(admissions)
|
||||
.where(and(eq(admissions.id, id), eq(admissions.organizationId, organizationId)))
|
||||
.limit(1);
|
||||
const admission = admissionRows[0];
|
||||
if (!admission) {
|
||||
return { success: false, reason: "入住记录不存在", status: 404 };
|
||||
}
|
||||
|
||||
if (admission.status !== "active") {
|
||||
return { success: false, reason: "该入住记录已结束", status: 409 };
|
||||
}
|
||||
|
||||
const updatedRows = await transaction
|
||||
.update(admissions)
|
||||
.set({
|
||||
status: "discharged",
|
||||
dischargedAt: new Date(),
|
||||
notes: notes || admission.notes,
|
||||
updatedAt: new Date(),
|
||||
})
|
||||
.where(eq(admissions.id, admission.id))
|
||||
.returning();
|
||||
const updated = updatedRows[0];
|
||||
if (!updated) {
|
||||
return { success: false, reason: "退住记录更新失败", status: 500 };
|
||||
}
|
||||
|
||||
await transaction.update(beds).set({ status: "available", updatedAt: new Date() }).where(eq(beds.id, admission.bedId));
|
||||
await transaction.update(elders).set({ status: "discharged", updatedAt: new Date() }).where(eq(elders.id, admission.elderId));
|
||||
|
||||
return { success: true, admission: updated };
|
||||
});
|
||||
|
||||
if (!result.success) {
|
||||
return jsonFailure(result.reason, result.status);
|
||||
}
|
||||
|
||||
await recordAuditLog({
|
||||
actor: auth.context.account,
|
||||
organizationId,
|
||||
action: "admission.discharge",
|
||||
targetType: "admission",
|
||||
targetId: result.admission.id,
|
||||
result: "success",
|
||||
reason: "办理退住",
|
||||
});
|
||||
|
||||
return jsonSuccess("退住已办理", { admission: result.admission });
|
||||
}
|
||||
@@ -7,6 +7,19 @@ import { getDatabase } from "@/modules/core/server/db";
|
||||
import { admissions, beds, elders } from "@/modules/core/server/schema";
|
||||
import { readData } from "@/modules/core/server/store";
|
||||
|
||||
type AdmissionRow = typeof admissions.$inferSelect;
|
||||
|
||||
type AdmissionMutationResult =
|
||||
| {
|
||||
success: true;
|
||||
admission: AdmissionRow;
|
||||
}
|
||||
| {
|
||||
success: false;
|
||||
reason: string;
|
||||
status: number;
|
||||
};
|
||||
|
||||
function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
return typeof value === "object" && value !== null && !Array.isArray(value);
|
||||
}
|
||||
@@ -62,7 +75,7 @@ export async function POST(request: Request): Promise<Response> {
|
||||
}
|
||||
|
||||
const database = getDatabase();
|
||||
const admission = await database.transaction(async (transaction) => {
|
||||
const mutation = await database.transaction(async (transaction): Promise<AdmissionMutationResult> => {
|
||||
const elderRows = await transaction
|
||||
.select()
|
||||
.from(elders)
|
||||
@@ -70,7 +83,7 @@ export async function POST(request: Request): Promise<Response> {
|
||||
.limit(1);
|
||||
const elder = elderRows[0];
|
||||
if (!elder) {
|
||||
throw new Error("老人档案不存在");
|
||||
return { success: false, reason: "老人档案不存在", status: 404 };
|
||||
}
|
||||
|
||||
const bedRows = await transaction
|
||||
@@ -80,16 +93,22 @@ export async function POST(request: Request): Promise<Response> {
|
||||
.limit(1);
|
||||
const bed = bedRows[0];
|
||||
if (!bed) {
|
||||
throw new Error("床位不存在");
|
||||
return { success: false, reason: "床位不存在", status: 404 };
|
||||
}
|
||||
if (bed.status !== "available") {
|
||||
throw new Error("床位不可分配");
|
||||
return { success: false, reason: "床位不可分配", status: 409 };
|
||||
}
|
||||
|
||||
const activeAdmissions = await transaction
|
||||
.select()
|
||||
.from(admissions)
|
||||
.where(and(eq(admissions.elderId, elderId), eq(admissions.status, "active")));
|
||||
.where(
|
||||
and(
|
||||
eq(admissions.elderId, elderId),
|
||||
eq(admissions.organizationId, organizationId),
|
||||
eq(admissions.status, "active"),
|
||||
),
|
||||
);
|
||||
await Promise.all(
|
||||
activeAdmissions.map((activeAdmission) =>
|
||||
transaction
|
||||
@@ -116,23 +135,27 @@ export async function POST(request: Request): Promise<Response> {
|
||||
.returning();
|
||||
const row = rows[0];
|
||||
if (!row) {
|
||||
throw new Error("入住记录创建失败");
|
||||
return { success: false, reason: "入住记录创建失败", status: 500 };
|
||||
}
|
||||
|
||||
await transaction.update(beds).set({ status: "occupied", updatedAt: new Date() }).where(eq(beds.id, bedId));
|
||||
await transaction.update(elders).set({ status: "active", updatedAt: new Date() }).where(eq(elders.id, elderId));
|
||||
return row;
|
||||
return { success: true, admission: row };
|
||||
});
|
||||
|
||||
if (!mutation.success) {
|
||||
return jsonFailure(mutation.reason, mutation.status);
|
||||
}
|
||||
|
||||
await recordAuditLog({
|
||||
actor: auth.context.account,
|
||||
organizationId,
|
||||
action: "admission.create",
|
||||
targetType: "admission",
|
||||
targetId: admission.id,
|
||||
targetId: mutation.admission.id,
|
||||
result: "success",
|
||||
reason: "办理入住/换床",
|
||||
});
|
||||
|
||||
return jsonSuccess("入住记录已创建", { admission }, 201);
|
||||
return jsonSuccess("入住记录已创建", { admission: mutation.admission }, 201);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user