beyondhb1079 / s4us

S4US (Scholarships For Undocumented Students) aims to provide scholarships information for undocumented students
https://www.dreamscholars.org
2 stars 1 forks source link

Schema design: Scholarship model #56

Closed josueetcom closed 3 years ago

josueetcom commented 4 years ago

We need to establish what a Scholarship object consists of and how it will be stored in Firestore.

Some prior related work.

Things to consider:

The expectation here is to come up with the Scholarship model in some form.

edwingl10 commented 4 years ago

This is what I was thinking for the scholarships:

And for the eligibility map (some scholarships may not have any or all of these keys/values):

josueetcom commented 4 years ago
  • id: int

Hmm, the ID could also be the string generated when you add a document

  • deadline: string

What about using a Date and time data type? I imagine a scholarship that doesn't expire could not set that field. Are there other cases we're missing if we use the date/time type?

  • amount: integer or array

What's the idea behind the arrays? And what about full-ride scholarships?

  • type(academic or sports e.g.): string

I imagine this is the right type for Firestore but I'm guessing this should be one of a fixed set of values like an enum?

  • eligibility: Map

I imagine we'd want a class type here in JavaScript/TypeScript

  • GPA: float/integer

Float is probably better

  • major: string

Should this maybe be an array of strings in case multiple majors are eligible?

  • grade level: integer

Should this maybe be an array of integers in case multiple majors are eligible? Also perhaps this would be better served by an enum since "grade" is a very loose term after high school.

  • school: string

Maybe an array of strings?

  • location: string

What is meant by location? State?

  • gender: string

Probably also best served by an enum

edwingl10 commented 4 years ago

Hmm, the ID could also be the string generated when you add a document

Oh yeah that would be best

What about using a Date and time data type? I imagine a scholarship that doesn't expire could not set that field. Are there other cases we're missing if we use the date/time type?

I think date/time type covers all cases

What's the idea behind the arrays? And what about full-ride scholarships?

The arrays would be for a range (e.g. 500-1000). We could also use a single integer with the max/min amount. For full ride scholarships we could use a string? Unless we want to keep the types the same?

I imagine this is the right type for Firestore but I'm guessing this should be one of a fixed set of values like an enum?

Yes that would be good.

What is meant by location? State?

I was thinking of state. But it might not even be needed since we have the schools eligible

josueetcom commented 4 years ago

What about using a Date and time data type? I imagine a scholarship that doesn't expire could not set that field. Are there other cases we're missing if we use the date/time type?

I think date/time type covers all cases

Sweet let's do that

What's the idea behind the arrays? And what about full-ride scholarships?

The arrays would be for a range (e.g. 500-1000). We could also use a single integer with the max/min amount. For full ride scholarships we could use a string? Unless we want to keep the types the same?

Ahh I think something that explicitly says the min/max might be better. Here are some other ways to consider:

{
  "min_amount": 500,
  "max_amount": 1000, // this can match max_amount
  "full_ride": false, // for full ride scholarships the other values would not be set or be 0
}
{
  "amount": {
    "type": "RANGE", // An enum. Could be FIXED (with an "amount" field) or FULL_TUITION (with no other fields)
    "min": 500,
    "max": 100,
  }
}

One thing to consider is how queries might need to be structured based on different models. E.g. users may want to look at full ride scholarships only or they may want to look at a range

What is meant by location? State?

I was thinking of state. But it might not even be needed since we have the schools eligible

I'd still keep it in some shape. Scholarships may have certain residential or academic state requirements and that's either impossible or hard to express with schools alone. We might want clarification on which of the two this means (maybe some research into which one is more likely a factor is needed)

josueetcom commented 4 years ago

One more field: DACA required

edwingl10 commented 4 years ago

This is how the updated scholarship model looks so far:

id: string name: string deadline: date and time amount: { type: enum (unknown, fixed, range, full ride) min: number max: number } description: string website: string type: enum (unknown, academic, sports, community, organization) date added: date and time last modified: date and time active: boolean

eligibility: { GPA: float majors: string[] grade level: enum[] schools: string[] state: string[] first gen: boolean gender: enum (unknown, male, female, other) DACA required: enum (unknown, required, not required) }

josueetcom commented 4 years ago

state: string

might also need to be a list

DACA required: enum (unknown, required, not required)

I would put this in the eligibility dictionary

Everything else looks good to me though!

edwingl10 commented 4 years ago

Everything else looks good to me though!

sweet, I edited the model above with the suggested changes.

josueetcom commented 3 years ago

Re: scholarship model. We've made some changes here: https://github.com/beyondhb1079/s4us/blob/064762bf11aadc26b0c40caece465c7597ac0d64/src/models/Scholarships.ts#L7-L23

But I'm not entirely convinced that all of those are the right changes. E.g.