diff --git a/apps/backend/src/schema/schema.ts b/apps/backend/src/schema/schema.ts index b3deae6..a74ce23 100644 --- a/apps/backend/src/schema/schema.ts +++ b/apps/backend/src/schema/schema.ts @@ -1,4 +1,9 @@ import { GlassSize, Prisma, prisma } from '@t09-project-2/db' +import type { + OpeningHours, + OpeningHoursNote, + PriceSighting, +} from '@t09-project-2/db' import type { OpeningHours, PriceSighting } from '@t09-project-2/db' import { GraphQLError } from 'graphql' @@ -14,6 +19,7 @@ builder.prismaObject('Venue', { lat: t.exposeFloat('lat'), lon: t.exposeFloat('lon'), openingHours: t.relation('openingHours'), + openingHoursNotes: t.relation('openingHoursNotes'), city: t.relation('city'), pricesSighted: t.relation('pricesSighted'), reviews: t.relation('reviews'), @@ -28,6 +34,13 @@ const openingHoursRef = builder.prismaObject('OpeningHours', { }), }) +const openingHoursNoteRef = builder.prismaObject('OpeningHoursNote', { + fields: (t) => ({ + days: t.exposeStringList('days'), + note: t.exposeString('note'), + }), +}) + builder.prismaObject('City', { fields: (t) => ({ id: t.exposeString('id'), @@ -89,6 +102,7 @@ type SearchResultItem = { distanceKm: number | null address: string | null openingHours: OpeningHours[] | null + openingHoursNotes: OpeningHoursNote[] | null latestPriceSighting: PriceSighting | null averageRating: number | null reviewCount: number @@ -110,6 +124,10 @@ const searchResultRef = builder type: [openingHoursRef], nullable: { list: true, items: false }, }), + openingHoursNotes: t.expose('openingHoursNotes', { + type: [openingHoursNoteRef], + nullable: { list: true, items: false }, + }), latestPriceSighting: t.expose('latestPriceSighting', { type: priceSightingRef, nullable: true, @@ -555,6 +573,7 @@ builder.queryType({ where: { id: { in: rows.map((row) => row.id) } }, include: { openingHours: true, + openingHoursNotes: true, pricesSighted: true, }, }) @@ -585,6 +604,7 @@ builder.queryType({ distanceKm: row.distance_km, address: venue.address, openingHours: venue.openingHours, + openingHoursNotes: venue.openingHoursNotes, latestPriceSighting, averageRating: row.average_rating, reviewCount: row.review_count, @@ -604,6 +624,7 @@ builder.queryType({ distanceKm: null, address: null, openingHours: null, + openingHoursNotes: null, latestPriceSighting: null, averageRating: null, reviewCount: 0, diff --git a/apps/frontend/src/components/ClientVenueMap.tsx b/apps/frontend/src/components/ClientVenueMap.tsx index 9c3ba4f..46fea47 100644 --- a/apps/frontend/src/components/ClientVenueMap.tsx +++ b/apps/frontend/src/components/ClientVenueMap.tsx @@ -28,7 +28,7 @@ export default function ClientVenueMap(props: VenueMapProps) { const ready = mounted && LazyVenueMap != null return ( -
+