140 lines
4.2 KiB
TypeScript
140 lines
4.2 KiB
TypeScript
import { UserService } from './user.service';
|
|
export declare class UserController {
|
|
private readonly userService;
|
|
constructor(userService: UserService);
|
|
getWatchlist(userId: string): Promise<({
|
|
product: {
|
|
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;
|
|
};
|
|
} & {
|
|
id: number;
|
|
createdAt: Date;
|
|
productId: number;
|
|
userId: number;
|
|
})[]>;
|
|
addToWatchlist(userId: string, data: {
|
|
productId: number;
|
|
}): Promise<{
|
|
id: number;
|
|
createdAt: Date;
|
|
productId: number;
|
|
userId: number;
|
|
}>;
|
|
removeFromWatchlist(userId: string, productId: string): Promise<{
|
|
id: number;
|
|
createdAt: Date;
|
|
productId: number;
|
|
userId: number;
|
|
}>;
|
|
getNotifications(userId: string): Promise<({
|
|
product: {
|
|
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;
|
|
};
|
|
} & {
|
|
id: number;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
productId: number;
|
|
userId: number;
|
|
priceThreshold: number | null;
|
|
percentThreshold: number | null;
|
|
notifyOnAnyChange: boolean;
|
|
isActive: boolean;
|
|
})[]>;
|
|
configureNotification(userId: string, data: {
|
|
productId: number;
|
|
priceThreshold?: number;
|
|
percentThreshold?: number;
|
|
notifyOnAnyChange?: boolean;
|
|
}): Promise<{
|
|
id: number;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
productId: number;
|
|
userId: number;
|
|
priceThreshold: number | null;
|
|
percentThreshold: number | null;
|
|
notifyOnAnyChange: boolean;
|
|
isActive: boolean;
|
|
}>;
|
|
removeNotification(userId: string, productId: string): Promise<{
|
|
id: number;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
productId: number;
|
|
userId: number;
|
|
priceThreshold: number | null;
|
|
percentThreshold: number | null;
|
|
notifyOnAnyChange: boolean;
|
|
isActive: boolean;
|
|
}>;
|
|
}
|