Changelog

MonteCinema v0.0.1.4.3

MonteCinema v0.0.1.3.5

MonteCinema v0.0.1

Website Functionalities

What user can do during using the site?

Each user can
  -Log in
  -Log out
  -Create account
  -Get list of ticket desks
  -Get list of Cinema Halls.
  -Get list of movies that are playing
  -Get list of empty seats for the movie
  -Get list of tickets that is linked to their email
  -Buy a ticket
    -You get confirmation on email.
  -Make Reservation
    -Your ticket is gonna be deleted if you dont pay 30 minutes before movies start.


Know How


Wrap your mind around the API, How It all works.

The project has multiple components. Lets start the reading.

Relationship between models. Database schema.

# There is Ticket that belongs to:
  -user, based on email. User email is unique!
  -movie

Each movie is as well seance. It has its starts’ date and ends’ date. It has referece to cinema hall, where ticket gets number of total tickets for choosen movie.

How ticket recognization works?

- You can take only take ticket thats' seat is declared in empty seats list.
- Each cinema hall has its volume.
- the API creates empty seats list accordingly to volume of cinema hall, each row has max. 10 seats


How the Authentication works?

# What does happpen in controller once You create an account?

## Creation of account
-User_controller checks 
  -if your params[:email] is email,
  -if params[:password] has desired length.
-It searches if params[:client_id] is equal any of Doorkeeper::Application.uid, either 
  -It returns error message.
# Creation of Token
-It creates Doorkeeper::AccessToken using your client_id,Doorkeeper::Application.uid and reftoken
-Two the same refresh tokens cannot exist
  -it checks in database and returns the one that not exist". 
    -Each token has some expiration date.
-After creation, it renders the nessesary information for user to log in:
  -auth token type, expiration date, access_token
## Log in
-Every time we want to log in to authorized page,
-It checks if our token exists in Doorkeeeper::AccessToken and is assigned to our account.
-If we want to refresh our access_token expired.
-We log in, we use client_id, client_secret, email and password, new token is assigned.