import PropTypes from 'prop-types';

export const editionPropTypes = {
    name: PropTypes.string,
    id: PropTypes.number,
    primary: PropTypes.bool,
    plans: PropTypes.arrayOf(PropTypes.shape({
        costs: PropTypes.shape({
            unitPrice: PropTypes.array,
            flatPrice: PropTypes.shape({
                formattedPrice: PropTypes.string,
                formattedFullPrice: PropTypes.string,
                formattedFullPriceElements: PropTypes.array,
                unit: PropTypes.shape({
                    min: PropTypes.number,
                    max: PropTypes.number,
                    dependency: PropTypes.string,
                    id: PropTypes.string
                }),
                frequency: PropTypes.shape({
                    shortLabel: PropTypes.string,
                    label: PropTypes.string,
                    id: PropTypes.string
                }),
                price: PropTypes.shape({
                    symbol: PropTypes.string,
                    currency: PropTypes.string,
                    amount: PropTypes.number,
                    value: PropTypes.number,
                    originalValue: PropTypes.number,
                    discountValue: PropTypes.number,
                    editionStartingPrice: PropTypes.number,
                    formatted: PropTypes.shape({
                        originalPrice: PropTypes.string,
                        originalFullPrice: PropTypes.string,
                        originalFullPriceElements: PropTypes.array
                    })
                })
            })
        }),
        setupFees: PropTypes.array,
        contractFees: PropTypes.array,
        contractLength: PropTypes.string,
        formattedContract: PropTypes.bool,
        discount: PropTypes.bool,
        uuid: PropTypes.string
    })),
    bullets: PropTypes.array,
    callToAction: PropTypes.shape({
        label: PropTypes.string,
        tooltip: PropTypes.string,
        isPrimary: PropTypes.bool,
        eppid: PropTypes.string,
        enabled: PropTypes.bool,
        url: PropTypes.string,
        actionType: PropTypes.string,
        popup: PropTypes.object,
        isSecondary: PropTypes.bool
    }),
    audience: PropTypes.arrayOf(PropTypes.shape({
        content: PropTypes.string
    })),
    items: PropTypes.arrayOf(PropTypes.shape({
        content: PropTypes.string
    })),
    invisible: PropTypes.bool,
    leadGen: PropTypes.bool,
    revenueType: PropTypes.string
};

export const editionsPropTypes = {
    bullets: PropTypes.arrayOf(PropTypes.shape({
        content: PropTypes.string,
        tooltip: PropTypes.string
    })),
    items: PropTypes.arrayOf(PropTypes.shape(editionPropTypes)),
    footnotes: PropTypes.arrayOf(PropTypes.string),
    i18n: PropTypes.shape({
        bulletsHeader: PropTypes.string,
        bulletsLabel: PropTypes.string,
        optionalAddOns: PropTypes.string,
        inclusions: PropTypes.string,
        audience: PropTypes.string,
        footnotes: PropTypes.string,
        invisible: PropTypes.string,
        tierSeparator: PropTypes.string,
        setupFee: PropTypes.string,
        showMoreDetails: PropTypes.string,
        hideMoreDetails: PropTypes.string,
        mostPopular: PropTypes.string,
        availablePricing: PropTypes.string,
        select: PropTypes.string,
        selected: PropTypes.string,
        hideDetails: PropTypes.string,
        viewDetails: PropTypes.string
    })
};
