import { DocumentConfig } from '../../types';
import {
  ImportInspectionDocument,
  ProductInspectionDocument,
  ScreenInspectionDocument,
  BendingInspectionDocument,
  SlatInspectionDocument,
  JointbarInspectionDocument,
} from '@/app/[locale]/(protected)/quality/qms/components/documents';

/**
 * 수입검사 성적서
 */
export const importInspectionConfig: DocumentConfig = {
  type: 'import-inspection',
  title: '수입검사 성적서',
  preset: 'inspection',
  component: ImportInspectionDocument,
};

/**
 * 제품검사 성적서
 */
export const productInspectionConfig: DocumentConfig = {
  type: 'product-inspection',
  title: '제품검사 성적서',
  preset: 'inspection',
  component: ProductInspectionDocument,
};

/**
 * 스크린 중간검사 성적서
 */
export const screenInspectionConfig: DocumentConfig = {
  type: 'screen-inspection',
  title: '스크린 중간검사 성적서',
  preset: 'inspection',
  component: ScreenInspectionDocument,
};

/**
 * 절곡품 중간검사 성적서
 */
export const bendingInspectionConfig: DocumentConfig = {
  type: 'bending-inspection',
  title: '절곡품 중간검사 성적서',
  preset: 'inspection',
  component: BendingInspectionDocument,
};

/**
 * 슬랫 중간검사 성적서
 */
export const slatInspectionConfig: DocumentConfig = {
  type: 'slat-inspection',
  title: '슬랫 중간검사 성적서',
  preset: 'inspection',
  component: SlatInspectionDocument,
};

/**
 * 금속프레임 중간검사 성적서
 */
export const jointbarInspectionConfig: DocumentConfig = {
  type: 'jointbar-inspection',
  title: '금속프레임 중간검사 성적서',
  preset: 'inspection',
  component: JointbarInspectionDocument,
};

/**
 * QMS 문서 Config 맵
 */
export const QMS_DOCUMENT_CONFIGS = {
  'import-inspection': importInspectionConfig,
  'product-inspection': productInspectionConfig,
  'screen-inspection': screenInspectionConfig,
  'bending-inspection': bendingInspectionConfig,
  'slat-inspection': slatInspectionConfig,
  'jointbar-inspection': jointbarInspectionConfig,
} as const;

export type QMSDocumentType = keyof typeof QMS_DOCUMENT_CONFIGS;
