/**
 * Default attachment document configuration
 * Used for student document uploads, general contracts, etc.
 */
export const ATTACHMENT_DOCUMENT = {
  ATTACHMENT_FILE_ID: 'ATTACHMENT_DOCUMENT',
  ATTACHMENT_TITLE: 'Supported Documents',

  /** Maximum number of old files to retain */
  ATTACHMENT_MAXIMUM_OLD_FILES: 0,

  /** Maximum number of files allowed per upload */
  ATTACHMENT_MAXIMUM_FILES: 5,

  /** Maximum file size per file (in MB) */
  ATTACHMENT_FILE_MAXSIZE_MB: 50,

  /** Allowed file extensions (case-insensitive) */
  ATTACHMENT_FILE_TYPES: [
    'jpg',
    'png',
    'jpeg',
    'pdf',
    'webp',
    'doc',
    'docx',
    'mp4',
    'JPG',
    'PNG',
    'JPEG',
    'PDF',
    'WEBP',
    'DOC',
    'DOCX',
    'MP4',
  ],

  /** Label displayed in the UI for allowed file types */
  ATTACHMENT_FILE_LABEL: 'Allowed: jpg,png,jpeg,pdf,webp,doc,docx,mp4',

  /** Upload path relative to project root */
  ATTACHMENT_FILE_PATH: './uploads/student_documents/',
};

/**
 * Reusable upload configurations
 * Useful for Multer or any file upload middleware
 */
export const UPLOAD_CONFIGS = {
  ATTACHMENT_DOCUMENT: {
    id: 'ATTACHMENT_DOCUMENT',
    title: 'Supported Documents',
    maxOldFiles: 0,
    maxFiles: 5,
    maxSizeMB: 50,
    fileTypes: [
      'jpg',
      'png',
      'jpeg',
      'pdf',
      'webp',
      'doc',
      'docx',
      'mp4',
      'JPG',
      'PNG',
      'JPEG',
      'PDF',
      'WEBP',
      'DOC',
      'DOCX',
      'MP4',
    ],
    fileLabel: 'Allowed: jpg,png,jpeg,pdf,webp,doc,docx,mp4',
    path: './uploads/student_documents/',
  },

  PROFILE_PICTURE: {
    id: 'PROFILE_PICTURE',
    title: 'Profile Picture',
    maxOldFiles: 1,
    maxFiles: 1,
    maxSizeMB: 5,
    fileTypes: ['jpg', 'jpeg', 'png', 'webp'],
    fileLabel: 'Allowed: jpg,jpeg,png,webp',
    path: './uploads/profile_pictures/',
  },

  // Add more upload types as needed
};

/**
 * Upload rules for Multer or API validation
 * Can override default field names if required
 */
export const UPLOAD_RULES = {
  ATTACHMENT_DOCUMENT: {
    /** Default field name in multipart/form-data request */
    FIELD_NAME: 'general_contracts',

    /** Maximum files per request */
    MAX_FILES: 5,

    /** Maximum file size per file (MB) */
    MAX_SIZE_MB: 50,

    /** Allowed file types (extensions, case-insensitive) */
    ALLOWED_TYPES: [
      'jpg',
      'png',
      'jpeg',
      'pdf',
      'webp',
      'doc',
      'docx',
      'mp4',
      'JPG',
      'PNG',
      'JPEG',
      'PDF',
      'WEBP',
      'DOC',
      'DOCX',
      'MP4',
    ],

    /** Destination folder for uploaded files */
    DESTINATION: './uploads/student_documents/',
  },
};
