// Mock data for the dealership onboarding system

export type UserRole =
  | 'DD-ZM'
  | 'DD_ZM'
  | 'RBM'
  | 'DD'
  | 'ZBH'
  | 'DD Lead'
  | 'DD_LEAD'
  | 'DD Head'
  | 'DD_HEAD'
  | 'NBH'
  | 'DD Admin'
  | 'DD_ADMIN'
  | 'Legal Admin'
  | 'LEGAL_ADMIN'
  | 'Super Admin'
  | 'SUPER_ADMIN'
  | 'DD AM'
  | 'FDD'
  | 'DDL'
  | 'Finance'
  | 'Finance Admin'
  | 'FINANCE_ADMIN'
  | 'Dealer'
  | 'ASM'
  | 'CCO'
  | 'CEO'
  | 'Prospective Dealer';

export type ApplicationStatus =
  | 'Submitted'
  | 'Questionnaire Pending'
  | 'Questionnaire Completed'
  | 'Shortlisted'
  | 'In Review'
  | 'Level 1 Interview Pending'
  | 'Level 1 Approved'
  | 'Level 2 Interview Pending'
  | 'Level 2 Approved'
  | 'Level 2 Recommended'
  | 'Level 3 Interview Pending'
  | 'Level 3 Approved'
  | 'FDD Verification'
  | 'Payment Pending'
  | 'LOI In Progress'
  | 'LOI Approved'
  | 'Security Details In Progress'
  | 'Security Details Approved'
  | 'Security Details'
  | 'LOI Issued In Progress'
  | 'LOI Issued'
  | 'Statutory Work In Progress'
  | 'Statutory Work Completed'
  | 'Architecture Work In Progress'
  | 'Architecture Work Completed'
  | 'Dealer Code Generation In Progress'
  | 'Dealer Code Generation'
  | 'Dealer Code Generated'
  | 'Architecture Team Assigned'
  | 'Architecture Document Upload'
  | 'Architecture Team Completion'
  | 'Statutory GST'
  | 'Statutory PAN'
  | 'Statutory Nodal'
  | 'Statutory Check'
  | 'Statutory Partnership'
  | 'Statutory Firm Reg'
  | 'Statutory Rental'
  | 'Statutory Virtual Code'
  | 'Statutory Domain'
  | 'Statutory MSD'
  | 'Statutory LOI Ack'
  | 'LOA Pending'
  | 'LOA Issued'
  | 'EOR In Progress'
  | 'EOR Complete'
  | 'Inauguration'
  | 'Approved'
  | 'Rejected'
  | 'Disqualified'
  | 'Onboarded';

export interface Application {
  id: string;
  registrationNumber: string;
  name: string;
  email: string;
  phone: string;
  age: number;
  education: string;
  residentialAddress: string;
  businessAddress: string;
  preferredLocation: string;
  state: string;
  ownsBike?: boolean;
  ownRoyalEnfield?: string;
  royalEnfieldModel?: string;
  existingDealer?: string;
  companyName?: string;
  source?: string;
  description?: string;
  address?: string;
  pincode?: string;
  locationType?: string;
  constitutionType?: string;
  pastExperience: string;
  status: ApplicationStatus;
  questionnaireMarks?: number;
  rank?: number;
  totalApplicantsAtLocation?: number;
  submissionDate: string;
  deadline?: string;
  assignedUsers: string[];
  progress: number;
  tags?: ('Approved' | 'Recommended')[];
  isShortlisted?: boolean; // Track if DD has shortlisted this application
  level1InterviewDate?: string;
  level2InterviewDate?: string;
  level3InterviewDate?: string;
  loiApprovalDate?: string;
  fddDate?: string;
  securityDetailsDate?: string;
  loiIssueDate?: string;
  dealerCodeDate?: string;
  eorDate?: string;
  loaDate?: string;
  eorCompleteDate?: string;
  architectureAssignedDate?: string;
  architectureDocumentDate?: string;
  architectureCompletionDate?: string;
  inaugurationDate?: string;
  onboardedDate?: string;
  questionnaireDate?: string;
  shortlistDate?: string;
  progressTracking?: any[];
  questionnaireResponses?: any[]; // added for response view
  stageApprovals?: any[];
  participants?: Participant[];
  architectureAssignedTo?: string;
  architectureStatus?: string;
  dealerCode?: any;
  dealer?: any;
  zoneId?: string;
  regionId?: string;
  areaId?: string;
  districtId?: string;
  fddAssignments?: any[];
  statutoryStatus?: string;
  panNumber?: string;
  gstNumber?: string;
  bankName?: string;
  accountNumber?: string;
  ifscCode?: string;
  branchName?: string;
  accountHolderName?: string;
  registeredAddress?: string;
}

export interface Participant {
  id: string;
  userId: string;
  participantType: string;
  joinedMethod: string;
  user?: {
    name: string;
    email: string;
    role: string;
  };
}

export interface User {
  id: string;
  name: string;
  email: string;
  password: string;
  role: UserRole;
  roleCode?: string;
  avatar?: string;
}

export interface AuditLog {
  id: string;
  action: string;
  user: string;
  timestamp: string;
  details: string;
}

export interface Document {
  id: string;
  name: string;
  type: string;
  uploadDate: string;
  status: 'Verified' | 'Pending' | 'Rejected';
  uploader?: string;
  url?: string;
}

export interface WorkNote {
  id: string;
  user: string;
  avatar?: string;
  message: string;
  timestamp: string;
  attachments?: string[];
  mentions?: string[];
}

export interface InterviewScore {
  user: string;
  role: string;
  score?: number;
  remarks: string;
  feedback?: string;
}

export interface QuestionnaireResponse {
  id: string;
  question: string;
  answer: string;
  category: string;
  marksScored: number;
  totalMarks: number;
}

// Mock test users for different roles
export const mockUsers: User[] = [
    {
    id: '15',
    name: 'Super Admin',
    email: 'admin@royalenfield.com',
    password: 'Admin@123',
    role: 'Super Admin',
  },
  {
    id: '13',
    name: 'piyush',
    email: 'piyush@royalenfield.com',
    password: 'Admin@123',
    role: 'DD-ZM',
  },
  {
    id: '14',
    name: 'manish',
    email: 'manish@royalenfield.com',
    password: 'Admin@123',
    role: 'RBM',
  },
  {
    id: '14',
    name: 'manav',
    email: 'manav@royalenfield.com',
    password: 'Admin@123',
    role: 'ZBH',
  },

  {
    id: '5',
    name: 'Jaya',
    email: 'jaya@royalenfield.com',
    password: 'Admin@123',
    role: 'DD Lead',
  },

  {
    id: '14',
    name: 'ganesh',
    email: 'ganesh@royalenfield.com',
    password: 'Admin@123',
    role: 'DD Head',
  },
 {
    id: '16',
    name: 'Yashwin',
    email: 'yashwin@royalenfield.com',
    password: 'Admin@123',
    role: 'NBH',
  },
    {
    id: '15',
    name: 'FDD Team',
    email: 'fdd@royalenfield.com',
    password: 'Admin@123',
    role: 'FDD',
  },
  {
    id: '13',
    name: 'Finance Admin',
    email: 'finance@royalenfield.com',
    password: 'Admin@123',
    role: 'Finance',
  },
  {
    id: '13',
    name: 'abhishek',
    email: 'abhishek@royalenfield.com',
    password: 'Admin@123',
    role: 'ASM',
  },
  {
    id: '18',
    name: 'Lince',
    email: 'lince@royalenfield.com',
    password: 'Admin@123',
    role: 'DD Admin',
  },
  {
    id: '18',
    name: 'Legal Admin',
    email: 'legal@royalenfield.com',
    password: 'Admin@123',
    role: 'Legal Admin',
  },
  {
    id: '18',
    name: 'CEO',
    email: 'ceo@royalenfield.com',
    password: 'Admin@123',
    role: 'CEO',
  },
  {
    id: '18',
    name: 'CCO',
    email: 'cco@royalenfield.com',
    password: 'Admin@123',
    role: 'CCO',
  },
];

// Mock current user (default)
export let currentUser: User = mockUsers[0];

// Mock data arrays (emptied to use API data)
export const mockApplications: Application[] = [];

export const dashboardStats = {
  totalApplications: 0,
  loaIssued: 0,
  level1Pending: 0,
  level2Pending: 0,
  level3Pending: 0,
  eorInProgress: 0,
  disqualified: 0,
  pendingReminders: 0,
  shortlistedToday: 0,
  pendingShortlisting: 0
};

export const recentActivities: any[] = [];
export const mockAuditLogs: AuditLog[] = [];
export const mockDocuments: Document[] = [];
export const mockWorkNotes: WorkNote[] = [];
export const mockLevel1Scores: InterviewScore[] = [];

export const locations: string[] = [];
export const states: string[] = [];

export const mockQuestionnaireResponses: QuestionnaireResponse[] = [];

// F&F Department Types
export const departments = [
  'Warranty Department',
  'Accessories Department',
  'Sales Department',
  'RTO Department',
  'Service Department',
  'Parts Department',
  'Finance Department',
  'Insurance Department',
  'Inventory Department',
  'Marketing Department',
  'HR Department',
  'IT Department',
  'Legal Department',
  'Quality Department',
  'Logistics Department',
  'Customer Relations Department'
];

// F&F Related Interfaces
export interface DepartmentResponse {
  id: string;
  departmentName: string;
  status: 'Pending' | 'Dues' | 'No Dues';
  remarks?: string;
  description?: string;
  amountType?: 'Payable Amount' | 'Receivable Amount';
  amount?: number;
  documentUrl?: string;
  submittedDate?: string;
  submittedBy?: string;
}

export interface FnFCase {
  id: string;
  caseNumber: string;
  dealerName: string;
  dealerCode: string;
  dealershipName: string;
  location: string;
  requestType: 'Resignation' | 'Termination';
  originalRequestId: string;
  status: 'New' | 'In Progress' | 'Under Review' | 'Completed';
  submittedOn: string;
  departmentResponses: DepartmentResponse[];
  financeReportStatus: 'Pending' | 'In Progress' | 'Completed';
  financeRemarks?: string;
  totalPayableAmount?: number;
  totalRecoveryAmount?: number;
  completedOn?: string;
  lastOperationalDateSales: string;
  lastOperationalDateServices: string;
  gst: string;
  typeOfClosure: 'Partial' | 'Complete';
}

export const mockFnFCases: FnFCase[] = [];