export const users = [
    {
      id: "1",
      name: "Rajesh Sharma",
      email: "rajesh.sharma@example.com",
      role: "Managing Director",
      department: "Management",
      get avatar() {
        return `https://api.dicebear.com/7.x/thumbs/svg?seed=${this.name}&radius=50`
      },
    },
    {
      id: "2",
      name: "Priya Patel",
      email: "priya.patel@example.com",
      role: "Marketing Director",
      department: "Marketing",
      get avatar() {
        return `https://api.dicebear.com/7.x/thumbs/svg?seed=${this.name}&radius=50`
      },
    },
    {
      id: "3",
      name: "Vikram Singh",
      email: "vikram.singh@example.com",
      role: "Sales Manager",
      department: "Sales",
      get avatar() {
        return `https://api.dicebear.com/7.x/thumbs/svg?seed=${this.name}&radius=50`
      },
    },
    {
      id: "4",
      name: "Ananya Desai",
      email: "ananya.desai@example.com",
      role: "Legal Advisor",
      department: "Legal",
      get avatar() {
        return `https://api.dicebear.com/7.x/thumbs/svg?seed=${this.name}&radius=50`
      },
    },
    {
      id: "5",
      name: "Arjun Mehta",
      email: "arjun.mehta@example.com",
      role: "Sales Team Lead",
      department: "Sales",
      get avatar() {
        return `https://api.dicebear.com/7.x/thumbs/svg?seed=${this.name}&radius=50`
      },
    },
    {
      id: "6",
      name: "Neha Gupta",
      email: "neha.gupta@example.com",
      role: "Customer Relations Manager",
      department: "Customer Relations",
      get avatar() {
        return `https://api.dicebear.com/7.x/thumbs/svg?seed=${this.name}&radius=50`
      },
    },
    {
      id: "7",
      name: "Sanjay Kumar",
      email: "sanjay.kumar@example.com",
      role: "Project Director",
      department: "Projects",
      get avatar() {
        return `https://api.dicebear.com/7.x/thumbs/svg?seed=${this.name}&radius=50`
      },
    },
    {
      id: "8",
      name: "Divya Reddy",
      email: "divya.reddy@example.com",
      role: "Finance Manager",
      department: "Finance",
      get avatar() {
        return `https://api.dicebear.com/7.x/thumbs/svg?seed=${this.name}&radius=50`
      },
    },
  ]
  
  // Sample initial sales approval settings
export const initialSalesSettings = [
    {
      id: "1",
      projectId: "1",
      projectName: "Bliss Homes Phase 1",
      requireApproval: true,
      approvalHierarchy: "manager",
      customApprovers: [],
      enableThresholds: true,
      thresholds: [
        {
          amount: 5000000, // 50 lakhs
          approvers: ["3"], // Sales Manager
        },
        {
          amount: 10000000, // 1 crore
          approvers: ["3", "7"], // Sales Manager and Project Director
        },
        {
          amount: 20000000, // 2 crores
          approvers: ["1"], // Managing Director
        },
      ],
      autoApprovalEnabled: true,
      autoApprovalDays: 3,
      notifyApprovers: true,
      notifySalesTeam: true,
      notifyCustomers: false,
      enableDelegation: true,
      status: "active",
    },
    {
      id: "2",
      projectId: "2",
      projectName: "Bliss Homes Phase 2",
      requireApproval: true,
      approvalHierarchy: "team_lead",
      customApprovers: [],
      enableThresholds: false,
      thresholds: [],
      autoApprovalEnabled: false,
      autoApprovalDays: 0,
      notifyApprovers: true,
      notifySalesTeam: true,
      notifyCustomers: false,
      enableDelegation: false,
      status: "active",
    },
    {
      id: "3",
      projectId: "3",
      projectName: "Satyaja Prelude Tower A",
      requireApproval: true,
      approvalHierarchy: "custom",
      customApprovers: ["3", "8"], // Sales Manager and Finance Manager
      enableThresholds: true,
      thresholds: [
        {
          amount: 7500000, // 75 lakhs
          approvers: ["3", "8"], // Sales Manager and Finance Manager
        },
        {
          amount: 15000000, // 1.5 crores
          approvers: ["1"], // Managing Director
        },
      ],
      autoApprovalEnabled: false,
      autoApprovalDays: 0,
      notifyApprovers: true,
      notifySalesTeam: true,
      notifyCustomers: false,
      enableDelegation: true,
      status: "active",
    },
    {
      id: "4",
      projectId: "5",
      projectName: "Bliss Commercial Plaza",
      requireApproval: true,
      approvalHierarchy: "director",
      customApprovers: [],
      enableThresholds: true,
      thresholds: [
        {
          amount: 10000000, // 1 crore
          approvers: ["7"], // Project Director
        },
        {
          amount: 25000000, // 2.5 crores
          approvers: ["1"], // Managing Director
        },
      ],
      autoApprovalEnabled: true,
      autoApprovalDays: 5,
      notifyApprovers: true,
      notifySalesTeam: true,
      notifyCustomers: true,
      enableDelegation: true,
      status: "active",
    },
  ]

  export const getUserNames = (userIds: string[]) => {
    return userIds
      .map((id) => {
        const user = users.find((u) => u.id === id)
        return user ? user.name : ""
      })
      .join(", ")
  }

export const formatApprovalHierarchy = (hierarchy: string, customApprovers: string[]) => {
    switch (hierarchy) {
      case "team_lead":
        return "Team Lead"
      case "manager":
        return "Manager"
      case "director":
        return "Director"
      case "custom":
        return `Custom (${getUserNames(customApprovers)})`
      default:
        return hierarchy
    }
  }


export const projects = [
    { id: "1", name: "Bliss Homes Phase 1", city: "Mumbai", type: "Residential" },
    { id: "2", name: "Bliss Homes Phase 2", city: "Mumbai", type: "Residential" },
    { id: "3", name: "Satyaja Prelude Tower A", city: "Pune", type: "Residential" },
    { id: "4", name: "Satyaja Prelude Tower B", city: "Pune", type: "Residential" },
    { id: "5", name: "Bliss Commercial Plaza", city: "Mumbai", type: "Commercial" },
    { id: "6", name: "Satyaja Retail Spaces", city: "Pune", type: "Commercial" },
  ]