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

chore: updating schema #2

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 92 additions & 2 deletions types/schema.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// add schemas here!

import type { UUID } from 'crypto';

// used for events and volunteer_preference tables
Expand All @@ -15,6 +14,29 @@ export type TypeOfAct =
| 'Bubbles'
| 'Puppetry';

// used for volunteers_preference and facilities table
export type TypeOfFacility =
| 'Assisted Living'
| "Children's Day Care"
| 'Detention Center'
| 'Developmentally Disabled'
| 'Food Bank'
| 'Homeless Services'
| 'Hospital'
| 'Mental Health Services'
| 'Recovery Center'
| 'Senior Day Program'
| 'Skilled Nursing Care'
| 'Special Needs School'
| 'Visually Impaired';

// used for volunteers_preferences table
// NEEDS TO BE UPDATED
export type Instruments = 'Guitar' | 'Violin' | 'Flute' | 'Trumpet' | 'Bass';

// used for volunteers_preferences table
export type Audience = 'Youth' | 'Adults' | 'Senior ';

// used for events and volunteer_preference tables
export type Genre =
| 'A Cappella'
Expand All @@ -30,8 +52,32 @@ export type Genre =
| 'Rock'
| 'Standards';

// used for events table
export type EventStatus = 'ACTIVE' | 'INACTIVE';

// used for event_signups table
export type Role = 'Host' | 'Performer';

// used for availabilities table
export type Day =
| 'Monday'
| 'Tuesday'
| 'Wednesday'
| 'Thursday'
| 'Friday'
| 'Saturday'
| 'Sunday';

export interface Availabilities {
availability_id: UUID;
facility_id: UUID;
date: Date; // date
day_of_week: Day;
start_time: string; // timestamptz
end_time: string; // timestamptz
is_recurring: boolean;
}

export interface Event {
event_id: UUID;
facility_id: UUID;
Expand All @@ -40,6 +86,50 @@ export interface Event {
type_of_act: TypeOfAct;
genre: Genre;
needs_host: boolean;
performer_type: string;
event_status: EventStatus;
}

export interface EventSignups {
event_id: UUID;
volunteer_id: UUID;
role: Role;
is_accepted: boolean;
}

export interface Facilities {
facility_id: UUID;
name: string;
email: string;
phone_number: string;
state: string;
city: string;
street_address_1: string;
street_address_2?: string;
postal_code: string;
audience: Audience;
type: TypeOfFacility;
host_name?: string;
host_contact?: string;
poc_name: string;
poc_contact: string;
notifications_opt_in: boolean;
}

export interface Volunteers {
volunteer_id: UUID;
first_name: string;
last_name: string;
email: string;
phone_number: string;
notifications_opt_in: boolean;
}

export interface VolunteersPreferences {
volunteer_id: UUID;
city?: string;
genre?: Genre;
instruments?: Instruments;
type_of_act?: TypeOfAct;
audience?: Audience;
facility_type?: TypeOfFacility;
}