Update: more work on beer styles, add erd to readme

This commit is contained in:
Aaron William Po
2023-09-22 22:52:51 -04:00
parent 43220fe0e6
commit a604a24fd1
7 changed files with 2152 additions and 26 deletions

View File

@@ -17,6 +17,8 @@ const getAllBeerStyles = async (
updatedAt: true,
abvRange: true,
ibuRange: true,
description: true,
glassware: { select: { id: true, name: true } },
},
})) as z.infer<typeof BeerStyleQueryResult>[];

View File

@@ -1,16 +1,15 @@
import { z } from 'zod';
const BeerStyleQueryResult = z.object({
abvRange: z.tuple([z.number(), z.number()]),
createdAt: z.coerce.date(),
description: z.string(),
glassware: z.object({ id: z.string().cuid(), name: z.string() }),
ibuRange: z.tuple([z.number(), z.number()]),
id: z.string().cuid(),
name: z.string(),
postedBy: z.object({
id: z.string().cuid(),
username: z.string(),
}),
createdAt: z.coerce.date(),
postedBy: z.object({ id: z.string().cuid(), username: z.string() }),
updatedAt: z.coerce.date().nullable(),
abvRange: z.tuple([z.number(), z.number()]),
ibuRange: z.tuple([z.number(), z.number()]),
});
export default BeerStyleQueryResult;