import type { JsonResult } from "../../../shared/api/types";
import type { DocumentDetail, DocumentSummary } from "../documentTypes";

export const summary: DocumentSummary = {
  id: "1",
  documentName: "主案",
  summary: "概述",
  documentType: "MAIN",
  status: "PUBLISHED",
  securityLevel: "INTERNAL",
  visibilityType: "ALL_AUTHENTICATED",
  visibilitySummary: "全员",
  categoryId: "2",
  categoryName: "分类",
  categoryPath: "/分类",
  parentDocumentId: null,
  rootDocumentId: null,
  attachmentType: null,
  fileExtension: "docx",
  tags: ["标签"],
  childCount: 1,
  attachmentCount: 1,
  viewCount: 2,
  downloadCount: 3,
  createdByName: "管理员",
  createdAt: "2026-07-23T01:00:00Z",
  updatedAt: "2026-07-23T02:00:00Z",
  rowVersion: 1,
  allowedActions: ["VIEW"],
};

export const detail: DocumentDetail = {
  ...summary,
  originalFileName: "main.docx",
  mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  fileSize: 1024,
  fileHash: "a".repeat(64),
  permissionSummary: {
    organizationCount: 1,
    userCount: 2,
    inheritedFromMainPlan: false,
  },
};

export function result<T>(data: T): JsonResult<T> {
  return { data, message: "success", requestId: "request-id", httpStatus: 200, headers: new Headers() };
}
