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

[refactor] update schema types (again) #29

Merged
merged 18 commits into from
Nov 11, 2023

Conversation

jinkang-0
Copy link
Contributor

@jinkang-0 jinkang-0 commented Oct 30, 2023

🎋 Description

🌴 What's new in this PR

Modified src/types/schema.ts:

  • Updated existing types to reflect schema changes on drawSQL
  • Added miscellaneous types for table fields for specific enums and join tables

Updated the following pages to handle new type changes:

  • src/app/cases/page.tsx
  • src/app/create-profile/page.tsx
  • src/app/interest/page.tsx
  • src/app/profile/page.tsx

Updated the following components to handle new type changes:

  • src/components/ListingCard.tsx

Unplanned:

  • Modified queries in src/api/supabase/queries/ to have consistent error messages.
  • Updated comments in src/utils/helpers.ts

🌲 Screenshots

🌳 How to review

First review changes in types/schema.ts, then review in any order.

🌱 Next steps

🔗 Relevant Links

ℹ️ Online sources

🪴 Related PRs

CC: @pragyakallanagoudar

@linear
Copy link

linear bot commented Oct 30, 2023

IJP-59 update schema types (again)

Add new types corresponding to each table. Update existing type dependencies.

@jinkang-0 jinkang-0 marked this pull request as ready for review October 30, 2023 05:19
@jinkang-0 jinkang-0 marked this pull request as draft October 30, 2023 05:50
@jinkang-0 jinkang-0 marked this pull request as ready for review October 31, 2023 20:11
@jinkang-0 jinkang-0 force-pushed the jinkang/ijp-59-update-schema-types-again branch from cd04975 to 2d9e762 Compare November 3, 2023 07:37
@jinkang-0 jinkang-0 requested a review from varortz November 3, 2023 07:40
@jinkang-0 jinkang-0 changed the title [refactor] update schema types [refactor] update schema types (again) Nov 3, 2023
@jinkang-0 jinkang-0 force-pushed the jinkang/ijp-59-update-schema-types-again branch from 2d9e762 to c6e95b4 Compare November 8, 2023 03:38
country?: string;
client_location?: string;
legal_server_id: number;
hours_per_month?: number;
Copy link
Collaborator

@varortz varortz Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want hours_per_month to be optional? I think David added a tag on the case listing card component that corresponds to a case's anticipated hrs/month. Are we ok with not displaying that tag for all cards if some cases don't have that info, or should we make it required to show the hrs/month data for all case listing cards?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great point!! the hours per month is an additional field that is going to be added to LegalServer, and so there is the possibility of it being null if someone forgets to input it on LegalServer. generally we're making all LegalServer fields nullable because there's always the possibility of someone forgetting to fill them out on there.

@davidqing6432 wondering if you have ideas for modifications to the case listing card in the case that some of these fields are null?

// table field types
export type ImmigrationLawExperienceEnum = 'LOW' | 'MEDIUM' | 'HIGH';

export type AdjudicatingAgencyEnum =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to your message on Slack, what are your thoughts on making adjudicating agency a string instead of an enum? I think that might allow for more flexibility, in case they add another potential agency afterward

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think that makes sense given legal server data may not be standardized to fit into the enum

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also note that we will be pulling experience_needed from legal server as well, and we may want to ask them about the format it'll be in

Copy link
Collaborator

@pragyakallanagoudar pragyakallanagoudar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fantastic, Jinkang! I have a couple of clarifying questions and comments on here, but largely this looks good to merge. THANK YOU SO MUCH FOR WORKING ON THIS

@jinkang-0 jinkang-0 force-pushed the jinkang/ijp-59-update-schema-types-again branch from 96d3073 to 43ddb27 Compare November 11, 2023 09:38
@jinkang-0 jinkang-0 force-pushed the jinkang/ijp-59-update-schema-types-again branch from 43ddb27 to 755b51d Compare November 11, 2023 09:39
@pragyakallanagoudar pragyakallanagoudar merged commit 6924f40 into main Nov 11, 2023
2 checks passed
@pragyakallanagoudar pragyakallanagoudar deleted the jinkang/ijp-59-update-schema-types-again branch November 29, 2023 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants