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

Remove Table: day_of_week from ERD & sheet #60

Closed
5 of 16 tasks
ericvennemeyer opened this issue Sep 9, 2022 · 10 comments
Closed
5 of 16 tasks

Remove Table: day_of_week from ERD & sheet #60

ericvennemeyer opened this issue Sep 9, 2022 · 10 comments
Assignees
Labels
complexity: missing feature: ERD/SS adjustment Requires adjustments to be made to the ERD & Spreadsheet feature: table creation good first issue Good for newcomers p-feature: events role: db architect s: CTJ stakeholder: Civic Tech Jobs s: hackforla.org stakeholder: hackforla.org website s: VRMS stakeholder: VRMS size: 2pt Can be done in 7-12 hours

Comments

@ericvennemeyer
Copy link
Member

ericvennemeyer commented Sep 9, 2022

Overview

We need to create the day_of_week table so that we can update a shared data store across hackforla.org, vrms, civictechjobs, and tables (onboarding) project.

Details

A table and a model are the same thing

Action Items

  • identify and document table description (see spreadsheet under Resources)
    • if not, reach out to PD leads
  • compare and check off the data fields (below) against the ERD. Note any fields in the ERD that's missing from the list. (see Resources)
  • compare the check off associated tables (below) against the ERD. Note any associated tables in the ERD that's missing from the list (see Resources)
  • create a single model in Django (defining schema)
  • write a test for the relationships this model will have with other models (e.g., creating a user and assigning them a set of permissions on a project).
  • write an API end point
  • write API unit tests
  • document the endpoint

Remove table actions

Resources/Instructions

Description

N/A

Data Fields

  1. Copied from spreadsheet and checked off according to ERD. (unchecked items indicate a mismatch between ERD and spreadsheet, which requires a review)

    No data fields found in spreadsheet!

  2. In ERD only (having items here indicates a mismatch, which requires a review)

    • (PK) id - int
    • name - varchar
    • abbreviation - char(3)

Associated Tables

  1. Copied from spreadsheet and checked off according to ERD. (unchecked items indicate a mismatch between ERD and spreadsheet, which requires a review)
  • user_availability (one-to-many)
  1. In ERD only (having items here indicates a mismatch, which requires a review)
    • None
@Neecolaa
Copy link
Member

In the past we've discussed having day_of_week being an enum rather than its own table. Both PostgreSQL and django allow for enums. The one use of day_of_week in the spreadsheet (from recurring_event) has the description "enumerated field".

@fyliu fyliu added good first issue Good for newcomers and removed role: back end labels Sep 20, 2022
@fyliu fyliu added this to the All tables added milestone Sep 25, 2022
@joshuayhwu
Copy link

class Day_Of_Week(AbstractBaseModel):
	"""
	Day of Week
	"""
	id = models.IntegerField(primary_key=True)
	name = models.CharField(max_length=255)
	abbreviation = models.CharField(max_length=3)


	def __str__(self): 
		return f"{self.name}" 

@ExperimentsInHonesty
Copy link
Member

ExperimentsInHonesty commented Mar 31, 2023

Task

@ExperimentsInHonesty ExperimentsInHonesty changed the title Create Table: day_of_week Remove Table: day_of_week from ERD & sheet Mar 31, 2023
@Neecolaa Neecolaa added the feature: ERD/SS adjustment Requires adjustments to be made to the ERD & Spreadsheet label May 5, 2023
@Neecolaa Neecolaa self-assigned this May 5, 2023
@Neecolaa
Copy link
Member

Neecolaa commented May 5, 2023

day_of_week is also used for user_availability, not just events
We may still want to remove this and replace it with an enumerated value (since days of the week are static)

Additional info:
Django enumeration types

Do we want to remove this table and replace it with an enum?

@Neecolaa Neecolaa added the question Further information is requested label May 5, 2023
@fyliu
Copy link
Member

fyliu commented May 22, 2023

Just a quick comment. There's also this package that's basically a toggle selection of 0 or more weekdays. I assume the goal of the user_availability is to select a number of weekdays.

Here's where it gets long:

But, on the other hand, this might not even be enough since it should probably be a weekdays+times-of-day selection. I'm not sure if there's an existing solution for this.

A lot of meeting coordinating services like lettucemeet have a "drag to select time range" UI. I think we want to have a backend that can store that data in a weekly sense. Or should it be something where the user selects times for each week separately, using actual dates rather than weekdays? This is actually the way it's done in apps I've seen. I think we should ask the stakeholders what they're planning to do and what they need.

@Neecolaa
Copy link
Member

Neecolaa commented May 23, 2023

About the user_availability table #79 :
Currently, it's designed to hold a date and a time range (start and duration. I assume in hours, but we could do minutes), with the ability to store multiple time ranges for the same day of the week. We were thinking it'd be a more general "I'm free on Fridays from 5-10PM" vs a more specific date, but it would be a good idea to ask the stakeholders what they're going to actually use it for. Not sure if there's a current UI idea for how people would select their availability.

@fyliu
Copy link
Member

fyliu commented May 23, 2023

You're right. I think a general same time each week is good too since it's how we do meeting schedule here. The only thing is there might be timezone complications that's taken care of in the other case. Maybe a little research will turn up a good solution, maybe as simple as converting all this into GMT and apply the timezones at display time only.

After your clarification. I see that the enumeration type like you say would be more fitting.

@ExperimentsInHonesty
Copy link
Member

ExperimentsInHonesty commented Jul 14, 2023

  • A decision was made in this issue to use an enumerated value instead of day of week table. Action will need to be specified in issue Create Table: user_availability #79. Once that is done this issue can be closed. We will do this at the next team meeting (breakout: fang, Nicole).

@PlantGirlCodes
Copy link
Member

adding this item to next meeting agenda 9/21/23 breakout with fang & Nicole.

@Neecolaa Neecolaa removed the question Further information is requested label Sep 22, 2023
@Neecolaa
Copy link
Member

We removed day_of_week table from the ERD and spreadsheet. We've given #79 a dependency on the event table so that we'll have a better idea of how we're dealing with the days of the week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: missing feature: ERD/SS adjustment Requires adjustments to be made to the ERD & Spreadsheet feature: table creation good first issue Good for newcomers p-feature: events role: db architect s: CTJ stakeholder: Civic Tech Jobs s: hackforla.org stakeholder: hackforla.org website s: VRMS stakeholder: VRMS size: 2pt Can be done in 7-12 hours
Projects
Status: ✅Done
Development

No branches or pull requests

6 participants