Skip to content

espedzhev/xmas-films-test

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tesco Xmas Films coding challenge

This project is a recent Xmas campaign consisting of a small Django backend plus React frontend.

To open the project, in VS Code select File -> Open Workspace from File -> xmas-films.code-workspace

You can then follow the readme.md files in the FE and BE folders in order to setup each component.

The tasks we'd like you to perform are as follows:

  1. Add a ReservationManager with a custom create method.
  • This should use the provided screening and quantity kwargs to sense-check the values are acceptable, given the current state of the data in the Reservation table.
  • If there is an issue, a ValidationError should be rasied.
  • The method should make use of transaction.atomic and select_for_update to guard against race conditions
  • Tests should be added to cover this new functionality
  1. Add a custom ScreeningQuerySet with a with_sold_out query
  • This should return a boolean annotation indicating whether each Screening in the query is sold out or not
  • This status should be added to the ScreeningSerializer so it can be used on the FE
  • Tests should be added to cover this new functionality
  1. Chunk-based AccessCode creation
  • Create a management command to generate random access codes (should be passed in via a CLI arg)
  • The codes should be in the format XXXX-XXXX-XXXX-XXXX where x is an uppercase letter or number, vowels should be excluded to avoid innappropriate words from being formed
  • The command should gracefully handle the fact that two codes might be generated with the same value (this wouldn't be allowed at the DB level as the field is unique)
  • The command should be capable of creating a million codes in a reasonable time, ie. the codes should be written to the DB in bulk (batch size should be around 10k)
  • The chunks should also be written out to a CSV file

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 50.4%
  • Python 38.5%
  • CSS 8.9%
  • HTML 1.3%
  • Just 0.9%