Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • rj2-ingham/uwe-flix-combined
1 result
Show changes
Commits on Source (3)
Showing
with 268 additions and 86 deletions
UWEFlix Cinema Booking System Technical Documentation
Overview
The UWEFlix Cinema Booking System is a web-based application that enables students to purchase cinema tickets in advance of the showing via the internet. The system also allows university clubs to purchase blocks of tickets at discounted prices, make payments on account, and settle accounts monthly. The system must use the existing Payment Transaction System, and the privacy of all student and customer data must be assured. Additionally, the system must promote a sustainable, carbon-neutral approach to system performance in line with the UWE sustainability strategy.
Goals and Requirements
The following are the goals and requirements of the UWEFlix Cinema Booking System:
Goals
Enable students to purchase cinema tickets in advance of the showing via the internet
Enable university clubs to purchase blocks of tickets at discounted prices and make payments on account
Requirements
The system must use the existing Payment Transaction System.
The user interface must be of high quality and accessible to UK and international students and those with mild visual impairments such as color blindness.
The system must allow the Cinema Manager to register details of student clubs and their representatives, including club name, address details, and contact details.
The system must allow the Cinema Manager to add film details, including title, age rating, duration, and short trailer description.
The system must allow the Cinema Manager to delete details of an obsolete film if there are no showings allocated to it.
The system must allow the Cinema Manager to add details of a new screen in the cinema, including the capacity of the screen in terms of the numbers of seats.
The system must allow the Cinema Manager to add details of a new showing of a film, including the date and time of the showing.
The system must allow the Account Manager to add a new account for a previously registered Club, including account details such as the account title, payment card details, and discount rate.
The system must generate a unique account number for each account.
The system must allow the Account Manager to amend an account and display a list of all accounts.
The system must display account statements at the end of every calendar month.
The system must allow customers to select a date and view a list of available showings for that date, including the time of the showings.
The system must allow customers to view details of the showing, including film title, age rating, duration, and short trailer description.
The system must allow customers to select the quantity of tickets required and the ticket type.
The system must display the total cost of the booking.
The system must allow customers to confirm their booking request.
The system must allow customers to enter their payment card details and transact the payment via the existing Payment Transaction System.
The system must allow Club Representatives to provide their club rep number and password for validation.
The system must allow Club Representatives to nominate a date and view a list of available showings for that date, including the time of the showings.
The system must allow Club Representatives to view details of the showing, including film title, age rating, duration, and short trailer description.
The system must allow Club Representatives to select the quantity of tickets required, which must be no less than ten.
The system must apply a student ticket type and club discount to the total cost of the block booking.
The system must debit the total cost of the block booking from the club's account if there are sufficient seats available for the block booking.
The system must allow Club Representatives to settle their accounts monthly by providing their unique club account number, displaying all transactions for the current month
The system MUST provide appropriate data encryption and security measures to protect all customer and student data in compliance with GDPR and other legal requirements.
The system MUST provide error handling and logging capabilities to help identify and resolve issues quickly and efficiently.
The system MUST allow for easy and seamless integration with the existing Payment Transaction System to enable secure and reliable payment processing.
The system MUST provide detailed reports on sales, revenue, and occupancy rates to enable UWEFlix to make informed business decisions and improve its operations.
The system MUST be designed with scalability and modularity in mind to enable future enhancements and updates as needed.
The system MUST provide adequate documentation and training resources to ensure that all users can effectively and efficiently use the system.
Goals:
- Enable students to purchase cinema tickets in advance of the showing via the internet
- Enable university clubs to purchase blocks of tickets at discounted prices and make payments on account
- Requirements
- The system must use the existing Payment Transaction System.
- The user interface must be of high quality and accessible to UK and international students and those with mild visual impairments such as color blindness.
- The system must allow the Cinema Manager to register details of student clubs and their representatives, including club name, address details, and contact details.
- The system must allow the Cinema Manager to add film details, including title, age rating, duration, and short trailer description.
- The system must allow the Cinema Manager to delete details of an obsolete film if there are no showings allocated to it.
- The system must allow the Cinema Manager to add details of a new screen in the cinema, including the capacity of the screen in terms of the numbers of seats.
- The system must allow the Cinema Manager to add details of a new showing of a film, including the date and time of the showing.
- The system must allow the Account Manager to add a new account for a previously registered Club, including account details such as the account title, payment card details, and discount rate.
- The system must generate a unique account number for each account.
- The system must allow the Account Manager to amend an account and display a list of all accounts.
- The system must display account statements at the end of every calendar month.
- The system must allow customers to select a date and view a list of available showings for that date, including the time of the showings.
- The system must allow customers to view details of the showing, including film title, age rating, duration, and short trailer description.
- The system must allow customers to select the quantity of tickets required and the ticket type.
- The system must display the total cost of the booking.
- The system must allow customers to confirm their booking request.
- The system must allow customers to enter their payment card details and transact the payment via the existing Payment Transaction System.
- The system must allow Club Representatives to provide their club rep number and password for validation.
- The system must allow Club Representatives to nominate a date and view a list of available showings for that date, including the time of the showings.
- The system must allow Club Representatives to view details of the showing, including film title, age rating, duration, and short trailer description.
- The system must allow Club Representatives to select the quantity of tickets required, which must be no less than ten.
- The system must apply a student ticket type and club discount to the total cost of the block booking.
- The system must debit the total cost of the block booking from the club's account if there are sufficient seats available for the block booking.
- The system must allow Club Representatives to settle their accounts monthly by providing their unique club account number, displaying all transactions for the current month
- The system MUST provide appropriate data encryption and security measures to protect all customer and student data in compliance with GDPR and other legal requirements.
- The system MUST provide error handling and logging capabilities to help identify and resolve issues quickly and efficiently.
- The system MUST allow for easy and seamless integration with the existing Payment Transaction System to enable secure and reliable payment processing.
- The system MUST provide detailed reports on sales, revenue, and occupancy rates to enable UWEFlix to make informed business decisions and improve its operations.
- The system MUST be designed with scalability and modularity in mind to enable future enhancements and updates as needed.
- The system MUST provide adequate documentation and training resources to ensure that all users can effectively and efficiently use
the system.
Overall, the UWEFlix Cinema Booking System must be designed and developed with the goal of providing a seamless and enjoyable experience for customers and club representatives while meeting the needs and requirements of all stakeholders, including the UWEFlix Management Team, student union stakeholders, the UWE student experience team, the UWEFlix Sales and Marketing team, and the UWEFlix Accounts Department. The system must be reliable, secure, scalable, and easy to use while also promoting sustainability and complying with all legal and regulatory requirements.
**Permission Levels**
The permission levels for the different roles (cinema manager and account manager) are defined in the 'auth_group' table of the database.
The Account manager role is assigned the group value of '1'.
The Cinema manager role is assigned the group value '2'.
These group values are assigned to users in the 'UWEFlix_user_groups' table.
A customer or club rep does not have a group value assigned in the 'UWEFlix_user_groups' table, resulting in a default of '0' in the views.py file, and no special permissions.
To mark club rep users as club reps, a marker is used in the 'UWEFlix_user' table under the field 'is_rep'. This field uses a value of '1' if the user is a club rep, and a value of '0' if the user is not a club rep.
No preview for this file type
File added
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
from django.contrib import admin
from .models import CinemaManager, User, AccountManager
from .models import User, ClubRepresentative
# Register your models here.
admin.site.register(User)
\ No newline at end of file
admin.site.register(User)
admin.site.register(ClubRepresentative)
\ No newline at end of file
from django.contrib.auth.backends import ModelBackend
from .models import ClubRepresentative
class ClubRepresentativeBackend(ModelBackend):
def authenticate(self, request, **kwargs):
username = kwargs.get('username')
password = kwargs.get('password')
if not username or not password:
return None
try:
club_rep = ClubRepresentative.objects.get(representative_id=username)
except ClubRepresentative.DoesNotExist:
return None
if club_rep.check_password(password):
return club_rep
return None
\ No newline at end of file
......@@ -26,7 +26,11 @@ class ClubForm(forms.ModelForm):
class ClubRepresentativeForm(forms.ModelForm):
class Meta:
model = ClubRepresentative
fields = ['email', 'first_name', 'last_name', 'representative_id']
fields = ['email', 'first_name', 'last_name', 'password']
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['password'].widget.attrs.update({'autocomplete': 'new-password'})
class ElevateUserForm(forms.ModelForm):
user = forms.ModelChoiceField(queryset=User.objects.all().filter(is_rep=False))
......
{% extends 'base.html' %} {% load static %} {% block content %}
<div class="container mt-5">
<div class="row">
<div class="col-md-6 offset-md-3">
<form
class="form-signin"
method="post"
action="{% url 'club_rep_login' %}"
>
{% csrf_token %}
<div class="form-group">
<label for="inputRepID">Representative ID</label>
<select class="form-control" id="inputRepID" name="inputRepID">
{% for club_rep in club_reps %}
<option value="{{ club_rep.representative_id }}">
{{ club_rep.representative_id }}
</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<label for="inputPassword">Password</label>
<input
type="password"
class="form-control"
id="inputPassword"
name="inputPassword"
required
/>
</div>
<button class="btn btn-lg btn-primary btn-block" type="submit">
Sign in
</button>
<a
href="{% url 'register' %}"
class="btn btn-lg btn-secondary btn-block mt-2"
>Sign up</a
>
</form>
</div>
</div>
</div>
{% endblock %}
{% extends 'base.html' %}
{% load static %}
{% block content %}
{% extends 'base.html' %} {% load static %} {% block content %}
<div class="container mt-5">
<div class="row">
<div class="col-md-6 offset-md-3">
<form class="form-signin" method="post" action="{% url 'login' %}">
{% csrf_token %}
<div class="form-group">
<label for="inputUsername">Username</label>
<input type="text" class="form-control" id="inputUsername" name="inputUsername" required>
</div>
<div class="form-group">
<label for="inputPassword">Password</label>
<input type="password" class="form-control" id="inputPassword" name="inputPassword" required>
<div class="form-group">
<label for="inputUsername">Username</label>
<input
type="text"
class="form-control"
id="inputUsername"
name="inputUsername"
required
/>
</div>
<div class="form-group">
<label for="inputPassword">Password</label>
<input
type="password"
class="form-control"
id="inputPassword"
name="inputPassword"
required
/>
</div>
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" id="rememberMe" value="remember-me">
<input
type="checkbox"
class="form-check-input"
id="rememberMe"
value="remember-me"
/>
<label class="form-check-label" for="rememberMe">Remember me</label>
</div>
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
<a href="{% url 'register' %}" class="btn btn-lg btn-secondary btn-block mt-2">Sign up</a>
<button class="btn btn-lg btn-primary btn-block" type="submit">
Sign in
</button>
<a
href="{% url 'register' %}"
class="btn btn-lg btn-secondary btn-block mt-2"
>Sign up</a
>
<a
href="{% url 'club_rep_login' %}"
class="btn btn-lg btn-info btn-block mt-2"
>Club Representative Login</a
>
</form>
</div>
</div>
</div>
{% endblock %}
\ No newline at end of file
{% endblock %}
{% extends "base.html" %}
{% load static %}
{% extends "base.html" %} {% load static %} {% block content %}
{% block content %}
<!-- Use Bootstrap's grid system to structure the layout -->
<div class="container mt-5">
<div class="row justify-content-center">
<div class="col-md-6">
<!-- Add the update form -->
<form method="post" class="form-signup">
{% csrf_token %}
<h1 class="h3 mb-3 font-weight-normal text-center">Update Representative for {{ club.name }}</h1>
<div class="form-group">
<label for="email">Email</label>
<input type="email" name="email" class="form-control" required>
</div>
<div class="form-group">
<label for="first_name">First Name</label>
<input type="text" name="first_name" class="form-control" required>
</div>
<div class="form-group">
<label for="last_name">Last Name</label>
<input type="text" name="last_name" class="form-control" required>
</div>
<div class="form-group">
<label for="representative_id">Representative ID (cannot be edited)</label>
<input type="text" name="representative_id" class="form-control" required disabled value="{{ representative.representative_id }}">
</div>
<button class="btn btn-lg btn-primary btn-block" type="submit">Update</button>
</form>
</div>
<!-- Use Bootstrap's grid system to structure the layout -->
<div class="container mt-5">
<div class="row justify-content-center">
<div class="col-md-6">
<!-- Add the update form -->
<form method="post" class="form-signup">
{% csrf_token %}
<h1 class="h3 mb-3 font-weight-normal text-center">
Update Representative for {{ club.name }}
</h1>
<div class="form-group">
<label for="email">Email</label>
<input
type="email"
name="email"
class="form-control"
value="{{ representative.email }}"
required
/>
</div>
<div class="form-group">
<label for="first_name">First Name</label>
<input
type="text"
name="first_name"
class="form-control"
value="{{ representative.first_name }}"
required
/>
</div>
<div class="form-group">
<label for="last_name">Last Name</label>
<input
type="text"
name="last_name"
class="form-control"
value="{{ representative.last_name }}"
required
/>
</div>
<div class="form-group">
<label for="representative_id"
>Representative ID (cannot be edited)</label
>
<input
type="text"
name="representative_id"
class="form-control"
required
disabled
value="{{ representative.representative_id }}"
/>
</div>
<div class="form-group">
<label for="password">Password</label>
<input
type="password"
name="password"
class="form-control"
required
/>
</div>
<button class="btn btn-lg btn-primary btn-block" type="submit">
Update
</button>
</form>
</div>
</div>
{% endblock %}
\ No newline at end of file
</div>
{% endblock %}
......@@ -33,5 +33,6 @@ urlpatterns = [
path('manage_clubs/<int:pk>/generate_statement/', views.statement_generate, name='generate_statement'),
path('manage_clubs/<int:pk>/manage_statements/<int:st_pk>/update/', views.statement_update, name='update_statement'),
path('manage_clubs/<int:pk>/manage_statements/<int:st_pk>/delete/', views.statement_delete, name='delete_statement'),
path('create_film/', views.film_create, name='create_film')
path('create_film/', views.film_create, name='create_film'),
path('club_rep_login/', views.club_rep_login, name='club_rep_login'),
]
......@@ -85,6 +85,28 @@ def login_view(request):
# Display the login form
return render(request, 'login.html')
def club_rep_login(request):
if request.method == 'POST':
rep_id = request.POST.get('inputRepID')
print(rep_id)
password = request.POST.get('inputPassword')
club_rep = authenticate(request, username=rep_id, password=password)
print(club_rep)
if club_rep is not None:
login(request, club_rep)
return redirect('index')
else:
error_message="Invalid representative ID or password"
print(error_message)
context = {'error_message': error_message}
return render(request, 'club_rep_login.html', context)
else:
club_reps = ClubRepresentative.objects.all()
print(club_reps)
context = {'club_reps': club_reps}
return render(request, 'club_rep_login.html', context)
def logout_view(request):
logout(request)
......@@ -122,6 +144,7 @@ def register_view(request):
print(form.errors)
form = UserRegistrationForm()
return render(request, 'register.html', {'form': form, 'perms': perms})
def create_cinema(request):
......@@ -513,15 +536,21 @@ def representative_update(request, pk):
club = get_object_or_404(Club, pk=pk)
representative = club.representative.clubrepresentative
if request.method == 'POST':
print('request post')
form = ClubRepresentativeForm(request.POST, instance=representative)
if form.is_valid():
print('club rep form valid')
form.save()
return redirect('manage_clubs')
form = ClubRepresentativeForm(instance=representative, initial={'representative_id': representative.representative_id})
else:
print(form.errors)
else:
form = ClubRepresentativeForm(instance=representative, initial={'representative_id': representative.representative_id})
context = {'form': form, 'user': request.user, 'club': club, 'representative': representative, 'perms': perms}
return render(request, 'update_representative.html', context)
def statements_list(request, pk):
perms = get_user_permissions(request)
if perms == '0' or perms == '1':
......
No preview for this file type
No preview for this file type
......@@ -126,6 +126,9 @@ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
AUTH_USER_MODEL = 'UWEFlix.User'
AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend', 'UWEFlix.backends.ClubRepresentativeBackend',]
GRAPH_MODELS = {
"all_applications": True,
"group_models": True,
......