sporedimk/price-compare-api/dist/price/price.controller.d.ts
2025-05-06 10:01:03 +02:00

76 lines
2.1 KiB
TypeScript

import { PriceService } from './price.service';
export declare class PriceController {
private readonly priceService;
constructor(priceService: PriceService);
getPricesForProduct(id: string): Promise<({
source: {
id: number;
name: string;
url: string;
logo: string | null;
lastScraped: Date | null;
createdAt: Date;
updatedAt: Date;
};
} & {
id: number;
createdAt: Date;
sourceId: number;
regularPrice: number;
discountedPrice: number | null;
discountPercentage: number | null;
unitPrice: string | null;
promotionType: string | null;
promotionStart: Date | null;
promotionEnd: Date | null;
vatIncluded: boolean;
lastUpdated: Date;
productId: number;
})[]>;
comparePrices(ids: string): Promise<{
id: number;
name: string;
description: string | null;
category: string;
availability: boolean;
latestPrice: {
source: {
id: number;
name: string;
url: string;
logo: string | null;
lastScraped: Date | null;
createdAt: Date;
updatedAt: Date;
};
} & {
id: number;
createdAt: Date;
sourceId: number;
regularPrice: number;
discountedPrice: number | null;
discountPercentage: number | null;
unitPrice: string | null;
promotionType: string | null;
promotionStart: Date | null;
promotionEnd: Date | null;
vatIncluded: boolean;
lastUpdated: Date;
productId: number;
};
}[]>;
getPriceHistory(id: string, days?: string): Promise<{
productId: number;
history: unknown[];
priceRange: {
min: number;
max: number;
};
averagePrice: number;
discountStats: {
maxDiscount: number;
averageDiscount: number;
};
}>;
}