Skip to content

Instantly share code, notes, and snippets.

@bmitchinson
Created April 28, 2020 03:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmitchinson/f06fdef124996a8f58a94faef925c92f to your computer and use it in GitHub Desktop.
Save bmitchinson/f06fdef124996a8f58a94faef925c92f to your computer and use it in GitHub Desktop.
// Where should we store these / put a types folder full of definitions?
// 1.) Frontend:
// If we put them in Apricot, when we deploy the backend,
// we'd have to zip up the frontend to include with it, so that the backend
// could import types when it's ran in the EC2. This seems like overhead imo.
// 2.) Backend:
// If we store the types in Blueberry, the frontend will
// reference them during build time only, which is okay in my mind,
// because we never build the frontend in an enviornment where
// Blueberry isn't present for the frontend build step.
// Types aren't a thing once it's in the S3 bucket. It's all JS there
// 3.) TopLevel (Types folder next to Blueberry / Apricot)
// This would be a central location, trade offs are very similar to option 1 imo.
// Backend would need to include this in it's deployment zip.
// Order of preference for me is 2 3 1
export interface Server {
firstName: string;
lastName: string;
}
export interface ServiceReview extends Review {
server?: Server;
}
export interface FoodReview extends Review {
menuItem?: string;
}
export interface AtmosphereReview extends Review {
table?: string;
}
// TODO: Remove optionals from these interface params
export interface Review {
id?: number;
comment?: string;
rating?: number;
createdAt?: Date;
reviewType?: 'atmosphere' | 'service' | 'food';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment