Skip to content

Samuel Ma Code Review Notes #79

@FegelSamuel

Description

@FegelSamuel

Description:
Here are some notes for "things that need to be done for Legacy QC." For context, my next.js and my React is very sloppy compared to my nuxt.js. I likely missed stuff

TODO:

  • Prisma
    • Pascal case for non-scalars. For example,
model Person {
  // Indexes
  id           String      @id @default(uuid())
  // Fields
  first_name   String
  last_name    String
  country_code String?
  state_code   String?
  phone_number String?
  type         PersonType
  // Relations
  user         User?       // capitalize User
  teamMember   TeamMember? // capitalize TeamMember
}
  • Collapse User and Team Member tables into User table (move all fields from those tables into User table)
  • Rename PersonType to role
  • HOLLISTIC enum needs to be changed to HOLISTIC
  • Look into maybe doing explicit m-n relationships instead of implicit, but idk if this is required or not
  • delete PrintButton.tsx
  • API Section
    • Collapse multiple routes into strictly just [id].ts and index.ts. The two files should handle the basic CRUD functionality and their exact functions can be specified with HTTP methods.
    • API routes should not have any verbs in them, as long as it's not complicated logic. Imagine instead of member/getScore.ts, it's member/score.ts. So on and so forth. Stick to nouns and the verb can be specified with the HTTP method
    • There should be ZERO use case for let in your typescript. Review all instances of let and change them to const if possible!
    • The room directory is bloated. You should probably modularize it into a directory-per-table basis.
    • Some of the req.method checks don't make sense. There are a lot of POST requirements even though POST-ing is not what you're trying to do (unless you're trying to do something weird with non-idempotency)
    • scheduling has a lot of logic that maybe doesn't need to be done on serverside. Check it out
  • Check the README.md and Legacy-Housekeeping-QC.md. They seem to have the same function.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions