Files
places/src/lib/types.ts
2026-05-20 14:00:51 +07:00

54 lines
1.0 KiB
TypeScript

export type CategoryId = "food" | "cafe" | "shopping" | "entertainment" | "other";
export type CollectionType = "folder" | "trip";
export type Role = "owner" | "editor" | "viewer";
export type User = {
id: string;
name: string;
email?: string;
avatar_url?: string | null;
initials: string;
color?: string;
};
export type Place = {
id: string;
name: string;
address: string;
short_address: string;
category: CategoryId;
tags: string[];
cover_url?: string | null;
created_by: string;
created_at: string;
my_rating?: number;
my_notes?: string;
visited: boolean;
visited_at?: string;
avg_rating?: number;
city: string;
};
export type Collection = {
id: string;
name: string;
type: CollectionType;
owner_id: string;
trip_start?: string;
trip_end?: string;
member_count: number;
place_count: number;
my_role: Role;
cover_place_ids: string[];
place_ids: string[];
members: string[];
};
export type CategoryMeta = {
label: string;
icon: string;
color: string;
};