package com.flightticket.service;

import com.flightticket.model.entity.PricingConfig;
import com.flightticket.model.enums.RequestType;

import java.math.BigDecimal;
import java.util.List;
import java.util.UUID;

/**
 * Service for managing API pricing configuration.
 * Handles both global default pricing and client-specific pricing overrides.
 * 
 * Requirements: 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 7.4
 */
public interface PricingConfigService {
    
    /**
     * Get the applicable price for a client and request type.
     * Returns client-specific price if it exists, otherwise returns global default.
     * If no pricing is configured, returns 0.00 and logs a warning.
     * 
     * @param clientId The client UUID
     * @param requestType The type of API request
     * @param currency The currency code (e.g., USD, EUR, GBP)
     * @return The applicable unit price
     * 
     * Requirements: 2.3, 2.4, 2.6, 7.4
     */
    BigDecimal getPrice(UUID clientId, RequestType requestType, String currency);
    
    /**
     * Set or update global default pricing for a request type.
     * Validates that the price is positive.
     * 
     * @param requestType The type of API request
     * @param price The unit price (must be positive)
     * @param currency The currency code (e.g., USD, EUR, GBP)
     * @return The created or updated pricing configuration
     * @throws IllegalArgumentException if price is not positive
     * 
     * Requirements: 2.1, 2.2, 2.7
     */
    PricingConfig setGlobalPrice(RequestType requestType, BigDecimal price, String currency);
    
    /**
     * Set or update client-specific pricing override for a request type.
     * Validates that the price is positive.
     * 
     * @param clientId The client UUID
     * @param requestType The type of API request
     * @param price The unit price (must be positive)
     * @param currency The currency code (e.g., USD, EUR, GBP)
     * @return The created or updated pricing configuration
     * @throws IllegalArgumentException if price is not positive
     * 
     * Requirements: 2.2, 2.5, 2.7
     */
    PricingConfig setClientPrice(UUID clientId, RequestType requestType, BigDecimal price, String currency);
    
    /**
     * Get all global default pricing configurations.
     * 
     * @return List of all global pricing configurations
     * 
     * Requirements: 2.8
     */
    List<PricingConfig> getAllGlobalPrices();
    
    /**
     * Get all client-specific pricing configurations for a client.
     * 
     * @param clientId The client UUID
     * @return List of all pricing configurations for the client
     * 
     * Requirements: 2.8
     */
    List<PricingConfig> getClientPrices(UUID clientId);
}
