refactor prices schema, add missing shared files

This commit is contained in:
Jurgis Sakalauskas
2025-10-14 13:30:44 +03:00
parent b20ab30ece
commit 1039c90918
13 changed files with 161 additions and 401 deletions
+14
View File
@@ -0,0 +1,14 @@
export type PriceCondition = 'new' | 'used';
export interface ItemPrice {
id: string;
itemId: string;
condition: PriceCondition;
amount: number;
currency: string;
sourceUrlId: string | null;
sourceUrl: string | null;
note: string | null;
createdAt: string;
updatedAt: string;
}
+32
View File
@@ -0,0 +1,32 @@
export type ItemStatus = 'active' | 'rejected';
export interface ItemPriceSummary {
minAmount: number;
maxAmount: number;
currency: string | null;
priceCount: number;
hasMixedCurrency: boolean;
newMinAmount: number | null;
newCount: number;
newCurrency: string | null;
newHasMixedCurrency: boolean;
usedMinAmount: number | null;
usedCount: number;
usedCurrency: string | null;
usedHasMixedCurrency: boolean;
}
export interface Item {
id: string;
projectId: string;
manufacturer: string | null;
model: string;
sourceUrlId: string | null;
sourceUrl: string | null;
status: ItemStatus;
note: string | null;
attributes: Record<string, unknown>;
createdAt: string;
updatedAt: string;
priceSummary: ItemPriceSummary | null;
}
+10
View File
@@ -0,0 +1,10 @@
export interface PaginationMeta {
limit: number;
offset: number;
count: number;
}
export interface PaginatedResponse<T> {
data: T[];
meta: PaginationMeta;
}
+12
View File
@@ -0,0 +1,12 @@
export type ProjectStatus = 'active' | 'archived';
export interface Project {
id: string;
name: string;
description: string | null;
status: ProjectStatus;
attributes: string[];
priorityRules: unknown;
createdAt: string;
updatedAt: string;
}