69 lines
2.0 KiB
TypeScript
69 lines
2.0 KiB
TypeScript
import { SourceService } from './source.service';
|
|
export declare class SourceController {
|
|
private readonly sourceService;
|
|
constructor(sourceService: SourceService);
|
|
getSources(): Promise<{
|
|
id: number;
|
|
name: string;
|
|
url: string;
|
|
logo: string | null;
|
|
lastScraped: Date | null;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
}[]>;
|
|
getSource(id: string): Promise<{
|
|
id: number;
|
|
name: string;
|
|
url: string;
|
|
logo: string | null;
|
|
lastScraped: Date | null;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
} | null>;
|
|
getProductsFromSource(id: string, skip?: string, take?: string): Promise<{
|
|
products: ({
|
|
prices: ({
|
|
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;
|
|
})[];
|
|
} & {
|
|
id: number;
|
|
name: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
description: string | null;
|
|
category: string;
|
|
availability: boolean;
|
|
sourceProductId: string | null;
|
|
sourceId: number;
|
|
})[];
|
|
pagination: {
|
|
total: number;
|
|
skip: number;
|
|
take: number;
|
|
hasMore: boolean;
|
|
};
|
|
}>;
|
|
}
|