prettier !
This commit is contained in:
76
src/types.ts
76
src/types.ts
@@ -52,7 +52,10 @@ export type FlyerDbInsert = Omit<FlyerInsert, 'store_name'> & { store_id: number
|
||||
* Represents the data required to insert a new flyer item into the database.
|
||||
* It's a subset of the full FlyerItem type.
|
||||
*/
|
||||
export type FlyerItemInsert = Omit<FlyerItem, 'flyer_item_id' | 'flyer_id' | 'created_at' | 'updated_at'>;
|
||||
export type FlyerItemInsert = Omit<
|
||||
FlyerItem,
|
||||
'flyer_item_id' | 'flyer_id' | 'created_at' | 'updated_at'
|
||||
>;
|
||||
|
||||
export interface UnitPrice {
|
||||
value: number;
|
||||
@@ -163,13 +166,12 @@ export interface Profile {
|
||||
updated_by?: string | null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Represents the combined user and profile data object returned by the backend's /users/profile endpoint.
|
||||
* It embeds the User object within the Profile object.
|
||||
* It also includes the full Address object if one is associated with the profile.
|
||||
*/
|
||||
export type UserProfile = Profile & {
|
||||
export type UserProfile = Profile & {
|
||||
user: User;
|
||||
address?: Address | null;
|
||||
};
|
||||
@@ -325,7 +327,6 @@ export interface RecipeIngredientSubstitution {
|
||||
notes?: string | null;
|
||||
}
|
||||
|
||||
|
||||
export interface Tag {
|
||||
tag_id: number;
|
||||
name: string;
|
||||
@@ -718,7 +719,10 @@ export type AiAnalysisAction =
|
||||
// Dispatched when an analysis that returns a simple string succeeds.
|
||||
| { type: 'FETCH_SUCCESS_TEXT'; payload: { analysisType: AnalysisType; data: string } }
|
||||
// Dispatched when an analysis that returns text and sources succeeds.
|
||||
| { type: 'FETCH_SUCCESS_GROUNDED'; payload: { analysisType: AnalysisType; data: GroundedResponse } }
|
||||
| {
|
||||
type: 'FETCH_SUCCESS_GROUNDED';
|
||||
payload: { analysisType: AnalysisType; data: GroundedResponse };
|
||||
}
|
||||
// Dispatched when the image generation succeeds.
|
||||
| { type: 'FETCH_SUCCESS_IMAGE'; payload: { data: string } }
|
||||
// Dispatched when any analysis fails.
|
||||
@@ -738,11 +742,25 @@ export interface ProcessingStage {
|
||||
}
|
||||
|
||||
export const CATEGORIES = [
|
||||
'Fruits & Vegetables', 'Meat & Seafood', 'Dairy & Eggs', 'Bakery & Bread',
|
||||
'Pantry & Dry Goods', 'Beverages', 'Frozen Foods', 'Snacks', 'Household & Cleaning',
|
||||
'Personal Care & Health', 'Baby & Child', 'Pet Supplies', 'Deli & Prepared Foods',
|
||||
'Canned Goods', 'Condiments & Spices', 'Breakfast & Cereal', 'Organic',
|
||||
'International Foods', 'Other/Miscellaneous'
|
||||
'Fruits & Vegetables',
|
||||
'Meat & Seafood',
|
||||
'Dairy & Eggs',
|
||||
'Bakery & Bread',
|
||||
'Pantry & Dry Goods',
|
||||
'Beverages',
|
||||
'Frozen Foods',
|
||||
'Snacks',
|
||||
'Household & Cleaning',
|
||||
'Personal Care & Health',
|
||||
'Baby & Child',
|
||||
'Pet Supplies',
|
||||
'Deli & Prepared Foods',
|
||||
'Canned Goods',
|
||||
'Condiments & Spices',
|
||||
'Breakfast & Cereal',
|
||||
'Organic',
|
||||
'International Foods',
|
||||
'Other/Miscellaneous',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -750,11 +768,11 @@ export const CATEGORIES = [
|
||||
* This is the structure returned from the backend to the frontend.
|
||||
*/
|
||||
export interface ExtractedCoreData {
|
||||
store_name: string;
|
||||
valid_from: string | null;
|
||||
valid_to: string | null;
|
||||
store_address: string | null;
|
||||
items: ExtractedFlyerItem[];
|
||||
store_name: string;
|
||||
valid_from: string | null;
|
||||
valid_to: string | null;
|
||||
store_address: string | null;
|
||||
items: ExtractedFlyerItem[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -776,19 +794,19 @@ export interface ExtractedFlyerItem {
|
||||
* Represents the logo data extracted from a flyer by the AI service.
|
||||
*/
|
||||
export interface ExtractedLogoData {
|
||||
store_logo_base_64: string | null;
|
||||
store_logo_base_64: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the data extracted from a receipt image by the AI service.
|
||||
*/
|
||||
export interface ExtractedReceiptData {
|
||||
raw_text: string;
|
||||
items: {
|
||||
raw_item_description: string;
|
||||
quantity: number;
|
||||
price_paid_cents: number;
|
||||
}[];
|
||||
raw_text: string;
|
||||
items: {
|
||||
raw_item_description: string;
|
||||
quantity: number;
|
||||
price_paid_cents: number;
|
||||
}[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -930,10 +948,10 @@ export interface LeaderboardUser {
|
||||
* This is a public-facing type and does not include sensitive fields.
|
||||
*/
|
||||
export interface AdminUserView {
|
||||
user_id: string;
|
||||
email: string;
|
||||
created_at: string;
|
||||
role: 'admin' | 'user';
|
||||
full_name: string | null;
|
||||
avatar_url: string | null;
|
||||
}
|
||||
user_id: string;
|
||||
email: string;
|
||||
created_at: string;
|
||||
role: 'admin' | 'user';
|
||||
full_name: string | null;
|
||||
avatar_url: string | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user