feat(assistant): collection list and saved place cards

This commit is contained in:
Maurice
2026-10-22 15:50:52 +02:00
parent 6e92c2777c
commit a440aefd43
68 changed files with 6052 additions and 92 deletions
@@ -378,14 +378,14 @@ export class CollectionPlacesRepository extends TrekRepository<CollectionPlaces>
collectionIds: number[],
query: { google_place_id?: string; google_ftid?: string; lat?: number; lng?: number },
tolerance: number,
): Promise<{ place_id: number; collection_id: number; name: string; status: string }[]> {
): Promise<{ place_id: number; collection_id: number; name: string; color: string | null; status: string }[]> {
if (collectionIds.length === 0) return [];
const hasCoords = query.lat != null && query.lng != null;
if (!query.google_place_id && !query.google_ftid && !hasCoords) return [];
return await this.kysely<CollectionPlacesMembershipKyselyDB>()
.selectFrom('collection_places as cp')
.innerJoin('collections as c', 'c.id', 'cp.collection_id')
.select(['cp.id as place_id', 'cp.collection_id', 'c.name', 'cp.status'])
.select(['cp.id as place_id', 'cp.collection_id', 'c.name', 'c.color', 'cp.status'])
.where('cp.collection_id', 'in', collectionIds)
.where((eb) => {
const clauses = [];