import { PolicyVertical } from '@support-policy/index';

export function generateFlightPolicyData(
  policyVertical: PolicyVertical,
  policyIds: string[],
  maxPrice = 40
) {
  return {
    rules: [
      {
        uuid: policyIds[0],
        name: 'costs',
        type: policyVertical,
        defaultRule: true,
        conditionAttributes: [],
        targetAttributes: [
          {
            attributeName: 'flightDomestic.costs',
            attributeValue: {
              maxPercentile: 25,
              policyMaximumPriceList: [
                {
                  maxPrice: maxPrice,
                  currencyCode: 'USD'
                }
              ]
            }
          },
          {
            attributeName: 'flightMedium.costs',
            attributeValue: {
              maxPercentile: 25,
              policyMaximumPriceList: [
                {
                  maxPrice: maxPrice,
                  currencyCode: 'USD'
                }
              ]
            }
          },
          {
            attributeName: 'flightInternational.costs',
            attributeValue: {
              maxPercentile: 25,
              policyMaximumPriceList: [
                {
                  maxPrice: maxPrice,
                  currencyCode: 'USD'
                }
              ]
            }
          }
        ]
      }
    ]
  };
}
