Skip to content

Latest commit

 

History

History
136 lines (91 loc) · 4.31 KB

README.rdoc

File metadata and controls

136 lines (91 loc) · 4.31 KB

Court Booking

A System which will allow Squash clubs to manage their bookings.

Versions

Ruby - see .ruby-version Rails - see .ruby-gemset

Dependencies

  • SQLite

  • Postgres (unless removed from the gemfile and database.yml)

  • Redis

Authentication

Uses Devise with some additional configuration:

  • username is the primary login.

  • emails are not unique - some users including families may use the same email address.

Setup

Example configuration files are as follows:

  • config/database.yml.example

  • config/mailer.yml.example

When the application is first started all initial settings will be loaded. The initializer files will detect whether any settings exist.

user management

A single user will be created:

  • username: adminuser

  • password: password

Admin users can only be added via the rails console using Admin.create(…). This should be limited to one user.

On initial start go to admin/users. Select adminuser. Change the username, full name and email.

Mail

The system will need a working mail server.

In developmentI have used my own providers SMTP server and staging and production I have used Exim4. The following options are a minimum requirement for SMTP to work:

  • address

  • username

  • password

  • from email address

  • SMTP domain

The SMTP domain is required for the default url options and the asset host in any emails that are sent out. See mailer for more details.

Settings

The following system wide settings are available (with default values):

*Number of days that courts can be booked in advance - 21 *Number of courts that can be booked during peak hours in a week - 3 *Number of courts that can be booked during peak hours in a day - 1 *Courts opening time - 06:20 *Courts closing time - 22:20 *Slot time - 40 minutes

When the application is first loaded in any environment the default settings will be loaded into the settings table. If you want to change these settings before first load use the settings.rb file in config. If you want to change these settings after first load use admin/settings. When the system is restarted the settings are loaded from the database table. When the settings are changed from the admin system a restart is required. This is fired automatically in the controller.

Permitted attributes

These are the whitelisted attributes for the application. The full list is contained in config/permitted_attributes.yml Loaded into a constant on every app start. See lib/setup/permitted_attributes.rb for usage.

Functionality

Sign in

Bookings

Admin

Allowed Actions

Thes are the actions that are allowed for different types of users for the application. Not available via user interface. Only accessible via admin/allowed_actions. Only an admin user can modify these settings. Each allowed action requires:

  • a useful name

  • a controller

  • at least one action. This can be a comma delimited set of actions e.g. new,create

  • if the action is user specific then the user id of any object will be checked to ensure the current user has permissions. Again admin users can override this.

  • if the action is admin then it is related to an admin function and will not be checked for user specificity.

Settings

This allows authorised users to change system wide settings as specified by Settings. caution: changing the start time, finish time and slot time will render all current bookings useless as they will no longer show in the courts page. These should only be changed at either system setup or major system change. It will be possible in the future to set these to come on at a future period in time and synchronise bookings. Changing any of these settings will force a system restart as an asynchronous process. Any system wide constants will be rebuilt.

Members

Authorised users can add, edit or delete members. This includes adding permissions. Each user must have a unique username. The email address does not need to be unique. Password does not need to be entered every time only an entry in the password or password confirmation will trigger validation.

Courts

The number is added sequentially based on the number of the highest court number. Authorised users can add, edit or delete courts. This includes adding opening times and peak hours. Updating any aspect of the courts

Events

Reports

Not yet enabled.

Emails

Not yet enabled.

Next Steps