Coder Social home page Coder Social logo

heyitsmass / bayview Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 2.0 50.13 MB

The next generation reservation tracking and notification system

Home Page: https://bayview.dev

License: MIT License

JavaScript 0.14% TypeScript 94.01% CSS 5.48% Dockerfile 0.15% Shell 0.22%
nextjs reservation-management

bayview's Introduction

Getting Started

Prerequisites:

Docker

Usage:

Step 1:

Included is an automation script ./start that composes the website's development environment using Docker

Once Docker has been installed, From the root directory:

git clone https://github.com/heyitsmass/BayView && cd BayView && touch.env

If you EVER need to access environment variables while programming, only use the environment variables process.env.DISCORD_API_TOKEN and process.env.DISCORD_CLIENT_ID. DO NOT copy and paste them outside of the .env file.

Step 2:

chmod +x start && ./start

📍 This will create a .built file with the build date/time stamped into it, Subsequent calls to ./start will only initialize a new container from the previous image. To update dependencies, pass the -b|--build option to rebuild the image or -h|--help to display the help menu

Your output should be similar to:

[+] Building 1.8s (18/18) FINISHED														
...
[+] Running 1/1
✔ Container bayview-development  Created                                                      		
Attaching to bayview-development
bayview-development  |
bayview-development  | > [email protected] dev
bayview-development  | > next dev
bayview-development  |
bayview-development  | ✓ Compiled /instrumentation in 177ms (48 modules)
bayview-development  | ▲ Next.js 13.X.X
bayview-development  | - Local:        http://localhost:3000
bayview-development  | - Environments: .env
bayview-development  | - Experiments (use at your own risk):
bayview-development  |    · esmExternals
bayview-development  |    · serverActions
bayview-development  |    · instrumentationHook
bayview-development  | 
bayview-development  | ✓ Ready in 2.2s

Step 4:

Open http://localhost:3000 with your browser to see the result, you should be redirected to the /home page indicating proper initialization.

⚠️For best results use FireFox Developer Edition with the React DevTools addon.

Additional Notes:

FastRefresh is enabled for the development environment, As long as the server is running then any changes made to files within the original source directory will force the server to recompile. This allows you to quickly and seamlessly update the website during development and see those updates in real-time without have to rebuild the entire Docker container. Check the docker-compose.yml file for more information.

The only changes that will require a restart are made to or 'package.json' while updating dependencies or to the instrumentation.ts file which runs when a new server instance is bootstrapped.

  • This initializes database connections and performs any work that's necessary throughout the lifetime of the website but only needs to occur once.

Design Expectations

It is expected these design patterns will be followed upon contributing to the repo, These patterns are intended to make portability, extension and expansion of BayView simple and legible.

⚠️ Context is essential! If you have to pass data or functions deeply within multiple components or across routes then wrap your component in a Context, create a reducer, develop it's actions, assign the state values and export the context for use across multiple modules.

⚠️Avoid excessively using useEffect. You might not need it

Issues:

📍If the server hangs during shutdown attempting to close it with ctrl+c then you can either stop it directly from Docker Desktop or open a secondary console window and type docker kill bayview-development

📍While potentially unrelated, if you get a dial unix /var/run/docker.sock: connect: permission denied error then type chmod 666 /var/run/docker.sock and retry

Disclaimers:

Non-Affiliation

This web site and internet bot is not endorsed by, directly affiliated with, maintained, authorized, or sponsored by Disney or its subsidaries. All product and company names are the registered trademarks of their original owners. The use of any trade name or trademark is for identification and reference purposes only and does not imply any association with the trademark holder of their product brand.

Fair Use

This website utilizes product images from other websites including but not limited to logos, images, or other content publicly provided by manufacturers, advertises and businesses. In doing so, no copyright is claimed for this kind of content on the website. To the extent that such material may appear to be infringed, we assert that such alleged infringement is permissible under the fair use principles of U.S. copyright laws. If you believe any material has been used in an unauthorized manner, please contact us at: [email protected] for immediate removal of any copyrighted material.

Disney

A request has been made to acquire licensing permission for intellectual property of Baymax. Please have a representative of Disney Enterprises or their Legal Team respond to the inquiry for immediate removal of the imagery, any notice for DMCA should be sent to [email protected] if any intellectual property rights have been violated before a response has been generated. 

For any additional inquiries please reach out at [email protected]

bayview's People

Contributors

heyitsmass avatar rdoinhs avatar cpilande avatar chappy122 avatar sonicspeed123 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

bayview's Issues

User Model

It is necessary to create a mongoose schema that defines how our users are going to be stored in the database, including what data we want stored with them. In some cases this should include the current JWT token, hashed password or other information.

ItineraryManager create method

This method should create an itinerary, Using the model created it should initialize a new document and upon the users login flow state should push the document to either the database or cache. The state will then be transitioned to this itinerary so we can continue modifying it and the context data is returned to the flow to provide to the user.

public createItinerary() {
}

ItineraryFlow storage methods

These are the methods the flow should use to determine which storage method to use. If the user is in a logged in state or their identity has been authenticated, then we can use the database (the use has permitted this). Otherwise if the user is in a guest state then we should opt to use their localStorage.

private get_storage() {
/** Gets the current storage method */
}
private set_storage(storage: StorageMethod) {
/** Sets the current storage method */
}

Itinerary Model

It is necessary to create a schema that defines what and how we want itinerary data stored in Mongo. Information such as events attached to the itinerary, groups, coordinators, etc... should be stored in here.

User Model Implementation

Design and implement a mongoose schema / model that encompasses the expected user model we'll store in the database. This information will be retrieved from the server to validate the state of a users auth token, scopes, and used to feed information to store state information such as desired theme or intineraryManager locale information.

interface Person {
/** Generic person representation. */
name: {
first: string;
last: string;
middle?: string;
username?: string;
}
email: string;
phone: string;
discord: {
username: string;
id: number | string;
}
/** Gets the name as a string */
get_name: () => string;
add_notifier: (notifier: Notifier) => void;
}

ItineraryFlow implementation

A simple flow manager that tracks what state the user is currently in and communicates that with the ItineraryManager to detail the users current login state, scopes of permissions, etc.. This is also a context manager but does not overload the EventManager

A simple diagram of how this might work

  1. A user loads the page
  2. The itineraryFlow is initialized and the user is provided the login state
  3. If the user wants to register, they click the button and the flow transitions to the registration state
  4. The user creates an account and the Flow notifies the ItineraryManager
  5. The itineraryManager attempts to locate the user in the database (they've made an account) but one is not found
    • A new document is created in the database and it returned to the user
  6. The itineraryFlow is transitioned in the "itinerary" state and the context information is provided to the user such as options on reservations for hotels, dining, activities, etc..
  7. User makes a choice to make a dining reservation
  8. Flow is transitioned into a 'reservation' state and context information is provided to the user such as calender availability, etc..
  9. The user makes the reservation and the itinerary flow notifies the manager
  10. The manager observes this change and updates the itinerary in the database
  11. The flow transitions back into the 'reservation' state and the user is prompted to make other dining reservations
  12. They choose not to so the state is transitioned back into 'itinerary' and the user can choose other options again.

class ItineraryFlow {
private identity: IdentityState = 'anonymous';
private stage: FlowState = 'uninitialized';
private storage: StorageMethod = 'local';
private state: State = new LoginFlow();
private user: {
authorization: string;
username: string;
} | null = null;
private get_next_state() {
/** Gets the next flow state */
}
private get_previous_state() {
/** Gets the previous flow state */
}
private visit_state(state: State) {
/** Visits the state */
}
public get_state() {
/** Gets the current state */
}
public set_state(state: State) {
/** Sets the current state */
return this.visit_state(state);
}
private get_identity() {
/** Gets the current identity */
}
private set_identity(identity: IdentityState, user?: { authorization: string; username: string; }) {
/** Sets the current identity */
}
private get_storage() {
/** Gets the current storage method */
}
private set_storage(storage: StorageMethod) {
/** Sets the current storage method */
}
}

Activity Implementation

Parks provide relevant activities that can be done depending on various options such as thrill rides, parades, firework shows, and support filters like height, age, time, and other requirements.

Functions within here should include things like get_thrill_rides or get_fireworks_shows and return the various activities available during that time, each of these could have a filter depending on location where get_thrill_rides(location?:string) allows for specific ranges or all of the above.

export class Activity extends Event implements IEvent {
/** Activity class for the Events */
public get_url() {
/** Returns the reservation link for the activity */
return '';
}
}

Facebook Notifier Implementation

The facebook notifier is an optional addition to the notifier class; It should be able to send messages to facebook users through messenger and keep track of their replies such as "Okay" or "Remind me later" and repeat the action at a different time.

class FacebookNotifier implements Notifier {
/** Facebook Notifier implementation */
public send_notification() {
/** Sends a notification to the users facebook account */
}
}

Group event getters

These methods should get the varies events stored in the itinerary (group), They should get the events in the itinerary, get the currently active event, next event, previous event for history recollection, etc...

public get_current_event() {
/** Returns the currently active event */
}
public get_next_event() {
/** Returns the next event */
}
public get_previous_event() {
/** Returns the previous event */
}
public get_events() {
/** Returns the events in the group */
}

Ticket implementation

Ticket class should represent the ticket types returned from either park type and contain methods associated with them; for example

interface StartingPrice:
    subtotal: string
    currency: string
    tax: string
    total: string
    pricePerDay: string


interface Ticket{
    name: string
    numDays: number
    startingFromPrice: StartingPrice
    priceDates: string[]
}

is returned from the API when gathering available parks and could contain methods such as get_url(priceDate) to get the price for that specific date.

export class Ticket extends Event implements IEvent {
/** Ticket class for the Events */
public get_url() {
/** Returns the purchase link for the ticket */
return '';
}
}

Lyft Transportation methods

Lyft reservation methods for customer searching; Should be able to search for lyft rides either during a specific date or on the day being requested and return ride-share options available at that time

methods should be made to find bookings, store them, refresh them to update the cost, etc...

export class Lyft implements Transportation {
/** Lyft class for the Events */
public get_url() {
/** Returns the reservation link for the lyft */
return '';
}
}

Restaurant Implementation

Each park provides restaurant options and have various availability allotments depending on party size, day's attending, location in the park, etc...

Functions within this class should be able to do things such as get_reservations which provides a list of all available reservations during the users booking ranges where maybe get_reservations(time?:string) could be optionally provided to get the reservations within a certain time period

export class Restaurant extends Event implements IEvent {
/** Restaurant class for the Events */
public get_url() {
/** Returns the reservation link for the restaurant */
return '';
}
}

API Interface (bAyPI)

An excessive amount of data is provided from disney API routes. An interface API that simplifies the endpoints down to just the items we need and provides us alternative query methods for accessing necessary data. Including an interface API also allows server side data caching of non essential data for faster query times.

For example:

https://endpoint.com/passes/blockout-dates/api/get-availability/?product-types={productTypes}&destinationId=WDW&numMonths={numMonths}

can be broken down into simply /blackout-dates/<facility>?passes=<passId>

Our route now provides a facility discriminator and can filter passes by facility and return only that information.

Email Notifier Implementation

The email notifier is an addition to the notifier class. Itself can extend to multiple other definitions such as HotmailNotifieror GmailNotifieror YahooNotifierand be able to send emails through each service.

class EmailNotifier implements Notifier {
/** Email Notifier implementation */
public send_notification() {
/** Sends a notification to the users email */
}
}

Group Location method

This should be an internalized method that gets the location of the current event (state), can be used for internal computation such as distances to parks and relevant surrounding information.

public get_location() {
/** Retusn the location of the current event */
}

Twitter Notifier Implementation

The twitter notifier is an optional addition to the notifier class. It should be able to send a DM to a user on twitter and react to replies such as 'Okay' or "Remind me later" and act accordingly.

class TwitterNotifier implements Notifier {
/** Twitter Notifier implementation */
public send_notification() {
/** Sends a notification to the users twitter account */
}
}

SMS Notifier Implementation

The SMS notified (Data rates may apply) is apart of the notifier class. Methods in here should be able to send text messages to the user, receive replies and accommodate accordingly.

class SMSNotifier implements Notifier {
/** SMS Notifier implementation */
public send_notification() {
/** Sends a notification to the users phone */
}
}

Dashboard login page (/admin/login)

The dashboard login page should be separated from the user login page to create a separation between the users and the admins

The page should have some kind of form that takes in a username / password and submits it to the server like so

//handlers.ts
'use server'
export function handleLogin(form:react.FormData){
   const username = form.get('username')?.value; 
   const password = form.get('password')?.value; 
   /** perform work */ 
   return { ok: true} 
}
//page.tsx
'use client'
export default function Page(){ 

return <form action={handleLogin}>
    <input name="username" placeholder="Username..."/>
    <input name="password" placeholder="Password..."/>
    <button type="submit">Login</button>
 </form>
} 

Group CRUD methods

These methods should manage the current events in the itinerary and mostly used for internal computation. They should be simple and able to add events, remove events, or update events based on different filter criteria. A simple payload should also be provided that provides the data for the method to either update, add, or query for removal.

public add_event(event: Event) {
/** Adds an event to the group */
}
public remove_event(event: Event) {
/** Removes an event from the group */
}
public modify_event(event: Event) {
/** Modifies an event in the group */
}

User home page (/home/user/{id})

Should be a dynamic route with the users associated id attached to their document in the database that holds their itinerary information

Dynamic routes should be created by adding a new folder to the home page named user, add a layout.tsx file:

export default async function Layout({children}:{children:react.ReactNode){

    return <div>{children}</div>

}

Then create a subfolder named [_id], add a page.tx file:

export default async function Page({params}:{params:{_id:string}}){

    const {_id} = params
    
    return <>{_id}</>
    
 }

Guest homepage (/home/guest)

The homepage for the guests if different then the main home page

Should be started with a new folder in the home directory named 'guest' with a page.tsx file and follow the figma wireframe design.

export default async function Page({children}:{children:react.ReactNode}){

    return <div>Guest Page</div>
}

Group Transportation methods

These functions should get the current transportation urls for the current or next event for example;

If a user has a pass reservation as their next event, and they haven't taken a flight yet; Then get transportation urls for the flights. If the user has taken a flight already then get transportation for Uber bookings to their next destination from the current location; This would work best on mobile devices but could also provide an option for pickup and drop off locations for user specification.

public get_transportation() {
/**Returns the transportation attatched to the event */
}
public get_transportation_url() {
/**Returns the current transportation urls attached to the evet */
}

Flight class implementation

Should represent a flight class and provide relevant information on requesting flight reservations.

Could contain functions such as get_flights_by_date(startDate:Date, endDate:Date) to find flight opens within certain days or additional options could be provided for flight class flights, standard, etc... it could also have methods such as get_return_flight or get_outgoing_flight to get return or outgoing flights for specific dates.

export class Flight extends Event implements IEvent {
/** Flight class for the Events */
public get_url() {
/** Returns the reservation link for the flight */
return '';
}
}

Flight Search Component

Flight Search Component Implementation

Description

This issue tracks the implementation of the initial version of the Flight Search Component based on the Figma Mockup. The current implementation allows for searching with the following parameters, with options to extend as the api requires in #8 :

  • Origin: string
  • Destination: string
  • Departure Date: string
  • Return Date: string | null
  • Number of Passengers: number

This is a base implementation that will serve as a foundation for extended website flow, particularly focusing on the initial card component with modified inputs.

Open Questions

  • How should the date inputs be formatted and entered by the user?
  • Given the target destinations of Disney parks, how should location information be entered and handled?
  • What is the most user-friendly and efficient modality for inputting the required information?

Tasks

  • Implement the basic structure of the Flight Class Component based on the Figma mockup #69 .
  • Ensure the component accepts and handles the mentioned parameters correctly.
  • Explore and decide on the best input method modality for date and location information.
  • Set up state and props to manage the data effectively within the component.
  • Write tests to verify the component's functionality.
  • Document the component flow with updated UML and use case, explaining the props it accepts, the state it manages, and any important methods or hooks it uses.

ItineraryFlow Identity methods

These methods should get and set the identity of the current user. The set method should be initiated from another internal function after authenticating the users' current identity. This can be something such as validating the JWT stored on the users' end with the one stored in the database and invalidating their identity if it's invalid.

private get_identity() {
/** Gets the current identity */
}
private set_identity(identity: IdentityState, user?: { authorization: string; username: string; }) {
/** Sets the current identity */
}

Group (Itinerary) Implementation

The itinerary class is one of the primary components, it houses all of the necessary implementation in order to create, modify, delete or get information about the itinerary.

This is the base implementation for the itinerary, functions not specific to an itinerary but specific to a group event are housed within here, specific separations may include transportation details where for a group may involve the parent where the itinerary is the 'root' and has collections of groups or sub-itineraries.

This should be a context manager where the current state is the currently active event (such as an activity or a hotel flight) and the functions within the context act on the current state where get_transportation_urls would get flights if the next event is a park ticket reservation and the user hasn't gotten on a flight and get_transportation_urls would get Uber booking rates if the user has taken a flight and the next event is a park ticket reservation.

Each of the subclasses will have an individual issue detailed with specifics about it's implementation.

export class Group extends EventManager {
public get_current_event() {
/** Returns the currently active event */
}
public get_next_event() {
/** Returns the next event */
}
public get_previous_event() {
/** Returns the previous event */
}
public get_events() {
/** Returns the events in the group */
}
public add_event(event: Event) {
/** Adds an event to the group */
}
public remove_event(event: Event) {
/** Removes an event from the group */
}
public modify_event(event: Event) {
/** Modifies an event in the group */
}
public get_start_time() {
/** Returns the start time of the current event */
}
public get_end_time() {
/** Returns the end time of the current event */
}
public get_location() {
/** Retusn the location of the current event */
}
public get_transportation() {
/**Returns the transportation attatched to the event */
}
public get_transportation_url() {
/**Returns the current transportation urls attached to the evet */
}
}

EventManager Implementation

The event manager is the core to the itinerary manager and functions as a unique context manager an Itinerary/Group.

This can be converted to an abstract class and it's methods can be utilized in other classes that need a context manager

state is the current event
states is the list of events (in order) in the itinerary
$history is the history of the state, each time a transition happens the previous state is pushed into the history
transition_to_next_event() pops the next event off the stack and transitions the internal state to it
switch_to_event(state:Event) transitions the internal state to a specific event -> the event must be in the users current list of events
transition_to_previous_event()pops the last event off of the history and transitions to it

A simple diagram of how this could work:

User has an itinerary -> attaches a notifier -> notifier notifies the user -> The itinerary observers this notification -> The itinerary transitions to the next event observed by the notifier

export class EventManager {
/** Context manager functions */
private event!: Event; //state
private events!: Event[]; //current events in the manager
private $history!: Event[]; //history of events in the manager
private transition_to_next_event() {
/** Transitions current state to the next event */
const state = this.events.pop();
if (!state)
return;
this.$history.push(this.event);
return this.event = state;
}
private switch_to_event(event: Event) {
/** Switches the current event to the specified event */
this.$history.push(this.event);
return this.event = event;
}
private transition_to_previous_event() {
/** Transitions current state to the previous event */
const state = this.$history.pop();
if (!state)
return;
return this.event = state;
}
}

Admin Dashboard (/admin/dashboard)

The admin dashboard will be a large production piece apart of the itinerary manager. Admins should be able to modify or update various parts of the itineraryManager from the website such as data endpoints used for mongoose.

Depending on the notifier, some such as Discord and Slack apps support embed systems for content visibility. The dashboard should include tools like these to rebuild how the embed looks 'on-the-fly' as opposed to reworking the entire codebase.

Ideally this is entirely managed by a sidebar the directs the user through sub-routes

For example: If the user starts at /admin/dashboard and wants to modify the discord bot embed, Then they should click the "discord" icon under the "bots" section in the sidebar which redirects them to /admin/dashboard/bots/discord from which they can select the embed builder and be taken to /admin/dashboard/bots/discord/embeds

The number of routes in the dashboard is not static and may change depending on which direction the project goes

In general a skeleton should be designed with base implementation:

  • Header

    • static to the root-most layout and span across all subpages; should only be imported once and can be used across every child route. Can include the navigation information for the page or sub-routes that can be access within the page.
  • Sidebar

    • static to the root-most layout and spans across all subpages; should be used primarily for navigation across other routes
  • Content display

    • The primary area on the page where content will be displayed.

Uber transportation methods

Uber reservation methods for customer searching; Should be able to search for uber rides either during a specific date or on the day being requested and return ride-share options available at that time

methods should be made to find bookings, store them, refresh them to update the cost, etc...

export class Uber implements Transportation {

ItineraryManager get methods

These methods should provide the itineraryManager the ability to locate an Itinerary by Id or other similar methods from itineraries previously loaded into the manager. If a request is being made to an itinerary outside of the users managed scope then they shouldn't be allowed access to it. If the document isn't loaded in the internal manager already, try to locate it in the database and verify it's attached to the user requesting it. If located then store it into the manager in the correct location.

public getItineraries() {
/** Returns the current list of itineraries */
}
public getItinerary(itinerary: Itinerary) {
/** Locates the itinerary in the cache*/
}

ItineraryManager implementation

The itinerary manager handles all of the backend work that none of the other classes can handle. Each user gets a manager (ManagedItinerary) that initializes in the login flow. Once the user has been authenticated and an identity has been assigned through the ItineraryFlow, then the Manager loads any information necessary from the database (or a users local cache if the data was provided from the flow). The Manager reloads the current flow state and assigns the data necessary to achieve that state, then provides it to the ItineraryFlow which then provides it to the user.

The ItineraryFlow provides an abstraction layer for the ItineraryManager as a forced authentication barrier which prevents a user from accessing any itinerary information without having valid authorization, authentication, or identity.

Methods should be provided in here to observer other layers as-well as update any itineraries associated with the user.

A user can be associated with multiple groups or be an event coordinator, therefore they can have multiple itineraries. A user can be in multiple groups for a single coordinated itinerary or similar depending on how the event has been planned.

Thus we add methods for creating, updating, and removing itineraries from the users manager. We can similarly get any itineraries associated with the user and internally modify flow state by transitioning the internal flow.

abstract class ItineraryManager {
public static itineraries: Itinerary[];
public flow = new ItineraryFlow();
public loadItineraries() {
/** Fetches the itineraries from the database. */
};
public saveItineraries() {
/** Flushes the database with the current list of itineraries */
};
public addItinerary(itinerary: Itinerary) {
/** Adds an itinerary to the database */
}
public removeItinerary(itinerary: Itinerary) {
/** Removes an itinerary from the current storage method */
}
public modifyItinerary(itinerary: Itinerary) {
}
public getItineraries() {
/** Returns the current list of itineraries */
}
public getItinerary(itinerary: Itinerary) {
/** Locates the itinerary in the cache*/
}
public createItinerary() {
}
public initializeFlow() {
this.flow.set_state({ type: 'login' });
return this.flow.get_state(); //login
}
}

ItineraryManager CRUD methods

These are various methods that provide the manager the ability to add, update, remove to the current itinerary, manage the users coordinated itineraries, etc...

public loadItineraries() {
/** Fetches the itineraries from the database. */
};
public saveItineraries() {
/** Flushes the database with the current list of itineraries */
};
public addItinerary(itinerary: Itinerary) {
/** Adds an itinerary to the database */
}
public removeItinerary(itinerary: Itinerary) {
/** Removes an itinerary from the current storage method */
}
public modifyItinerary(itinerary: Itinerary) {
}

Group time methods

These methods should get the time information of the current event (state), should also provide options for string formatting for graphical representation to the user or type returns for internal computation such as time to next event.

public get_start_time() {
/** Returns the start time of the current event */
}
public get_end_time() {
/** Returns the end time of the current event */
}

Event Model

It is necessary to create an event schema to define what and how we want data stored in mongoose. Various information about the event such as start time, end time, transportation information, etc.. should attached to the event for each recollection.

ItineraryFlow state methods

These are the internal state methods that manage the current state of the flow. Methods should be created to allow for transitioning to some state the next state or the previous state.

private get_next_state() {
/** Gets the next flow state */
}
private get_previous_state() {
/** Gets the previous flow state */
}
private visit_state(state: State) {
/** Visits the state */
}
public get_state() {
/** Gets the current state */
}
public set_state(state: State) {
/** Sets the current state */
return this.visit_state(state);
}

Itinerary Components Implementation

Description
This issue tracks the implementation of the initial version of the Itinerary Components based on the Figma Mockup. These consist of any components that are related to the creation of the itinerary that will be viewed by the user.

Open Questions

Tasks

  • - Implement the Title Card component.
  • - Implement the Event component.
  • - Implement the Full Itinerary component.
  • - Create a sample itinerary to receive feedback on changes to the visual design.
  • - Write tests to verify the components' functionality.

Related Issues and PRs

Pass class implementation

Pass class should represent the ticket types returned from either park type and contain methods associated with them; for example

interface SupportedPass{
    availNumMonths?:number
    displayName: string
    displayOrder: number
    icon: string
    iconEndColor: string
    iconStartColor: string
    isSupported: boolean
    passId: string
    configInstanceId: string
}

is returned from the API when gathering available passes and could contain methods such as get_pass_availability(facility:string, numMonths:number) to get the pass availability by month for that

export class Pass extends Event implements IEvent {
/** Pass class for the Events */
public get_url() {
/** Returns the purchase link for the park pass */
return '';
}
}

CoordinatedItinerary Implementation

The coordinated itinerary is an overloaded itinerary with the added ability of supporting multiple or recursive itineraries.

A user can create a coordinated itinerary where they can add people into the event, group them by event in the itinerary, attach specific notifiers to specific users or events that notify users in the group based on available notification methods, etc..

Users can assign other coordinators who can manage the itinerary as-well, each of these persons is provided a scope of id's that they're allowed to access which correlate with the itinerary they're accessing.

Users should be able to invite people into events and users within that managed itinerary should be able to manage their own sub-itinerary such as personal flight information if a group coordinated flight hasn't been assigned or they have specific preferences.

They should have elevated security measures to ensure non-coordinators cannot view information not associated with them. The flow state can return something such as "coordinator" to signify the context they're within is viewable to them where "coordinated" is a person only allowed to view their specific information or collective information about the event.

export class CoordinatedItinerary extends Itinerary {
public get_coordinators() {
/** Returns the coordinators in the itinerary */
}
public add_coordinator() {
/** Adds a coordinator to the itinerary */
}
public get_groups() {
/** Returns the groups in the itinerary */
}
public add_group(group: Group) {
/** Adds a group to the itinerary */
}
public remove_group(group: Group) {
/** Removes a group from the itinerary */
}
public modify_group(group: Group) {
/** Modifies a group in the itinerary */
}
}

Hotel implementation

Each park has different on-site resorts and places to stay during the vacation. Functions in this class should be able to get_resorts where it gathers all available resort reservations within a users booking ranges. Similarly something such as get_resorts_by_price(price:string) could be created where resorts can be queried by expected price.

export class Hotel extends Event implements IEvent {
/** Hotel class for the Events */
public get_url() {
/** Returns the reservation link for the hotel */
return '';
}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.