// Abstract base class export abstract class PriceSourceBase { protected sourceName: string; // The name of the price source. protected apiUrl?: string; // Optional URL for the API from which prices can be fetched. protected productCategory: TProductCategory; // The category of the product associated with this price source. constructor( sourceName: string, productCategory: TProductCategory, apiUrl?: string, ) { this.sourceName = sourceName; // Initialize source name. this.productCategory = productCategory; // Initialize product category. this.apiUrl = apiUrl; // Initialize optional API URL. } /** * Fetches the price for a specified product category. * @param productCategory - The category of the product for which the price is to be fetched. * @returns The price as a Promise. */ abstract fetchPrice(productCategory: TProductCategory): Promise; /** * Checks if the price source is active. * @returns A boolean indicating the active status of the price source. */ abstract isActive(): Promise; }