Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redefine models #12

Open
kungpaogao opened this issue Nov 7, 2019 · 8 comments
Open

Redefine models #12

kungpaogao opened this issue Nov 7, 2019 · 8 comments
Labels
BIG Big boi/gorl task code Code fixes and improvements discussion Discussion or request for comments
Milestone

Comments

@kungpaogao
Copy link
Member

kungpaogao commented Nov 7, 2019

We need to redefine our models

General

  • need to update/add more fields to enable quicker identification of furniture
  • need to update how we type check in TypeScript (interface vs. type vs. classes)
  • we don't want our app to crash b/c we stored something bad to the database
  • add tag attribute for type checking
  • use schema attribute so we can query on specific versions of interfaces/classes

Furniture

  • add name/desc field (quick reference) - there was some discussion on re-purposing the comments section
  • separate bed components (frame, mattress, ends) under FClass

Donor

  • split up address: street address, city, state, zip code - this is mainly to make edit UI more intuitive and can be used for filtering
  • remove zone

Timing

@kungpaogao kungpaogao added code Code fixes and improvements BIG Big boi/gorl task labels Nov 7, 2019
@kira-segenchuk
Copy link
Contributor

update everyone if you make changes here

@kungpaogao
Copy link
Member Author

if we have optional fields, we need to decide how to handle

@kungpaogao
Copy link
Member Author

kungpaogao commented Feb 22, 2020

Updated original comment with more changes

@kungpaogao kungpaogao added the discussion Discussion or request for comments label Apr 6, 2020
@kungpaogao
Copy link
Member Author

kungpaogao commented Apr 6, 2020

Update original comment for changes regarding Timing and a link to this nice post:
https://stackoverflow.com/questions/40973074/difference-between-interfaces-and-classes-in-typescript

Here's another related post: https://stackoverflow.com/questions/51716808/when-use-a-interface-or-class-in-typescript

@kungpaogao
Copy link
Member Author

We should also consider moving data (the folder that contains all the types) to the root of our project so that it's clear that our Firebase Functions should be able to access them.

@kungpaogao
Copy link
Member Author

In terms of migrating our models, I think a good way of doing it is by adding a version (or schema_version) to our model. This way we can just query based on the schema version to prevent our frontend from breaking / having inconsistent models.

image

@kungpaogao
Copy link
Member Author

After some discussion and consideration, I think the move might be to go with TypeScript interfaces over classes.

@kungpaogao
Copy link
Member Author

A good(?) idea by @kira-segenchuk could be having a global tag property that we can use for "type-checking"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BIG Big boi/gorl task code Code fixes and improvements discussion Discussion or request for comments
Projects
None yet
Development

No branches or pull requests

2 participants