// Pricing configuration for different submission types
// All prices in USD

export const PRICING = {
  websiteSubmission: {
    price: 12.99,
    currency: 'USD',
    description: 'Website submission fee'
  },
  directory: {
    price: 6.99,
    currency: 'USD',
    description: 'Directory listing fee'
  },
  jobPost: {
    price: 15.99,
    currency: 'USD',
    description: 'Job posting fee'
  },
  aiWebsite: {
    price: 4.99,
    currency: 'USD',
    description: 'AI-powered website submission fee'
  }
};

// Helper function to get price for a service type
export const getPrice = (serviceType) => {
  const pricing = PRICING[serviceType];
  if (!pricing) {
    throw new Error(`Invalid service type: ${serviceType}`);
  }
  return pricing.price;
};

// Helper function to calculate discounted price
export const calculateDiscountedPrice = (serviceType, discountType, discountAmount) => {
  const originalPrice = getPrice(serviceType);
  
  if (discountType === 'free' || discountAmount === 100) {
    return 0;
  }
  
  if (discountType === 'percentage') {
    const discountedPrice = originalPrice * (1 - discountAmount / 100);
    return Math.round(discountedPrice * 100) / 100; // Round to 2 decimal places
  }
  
  return originalPrice;
};

export default PRICING;
