Skip to content

Creating Competition

Julien Grimault edited this page Jan 24, 2014 · 41 revisions

this is a checklist of the steps that need to be performed when creating a new competition.

Create Model in DB

Generate rows in the database

Invoke the command line tool TH_UTIL.exe build-competition with the options that you need. A typical invocation is shown below:

TH_UTIL.exe build-competition --db DEV --provider-name Dummy --start-date  01-23-2014 --number-of-weeks 4
                              --number-of-months 1 --prize-currency S$ --weekly-prizes 500 300 300 100 100
                              --monthly-prizes 2500 1500 1000 --country-codes SG TH

Note that the date must be entered in the format mm/dd/yyyy.

This will create the elements needed to run the competition in the database. Use TH_UTIL.exe build-competition to see the help menu and find more details about the various options.

Verify Entities creation

The command line tool should have inserted the following elements in the database:

  • 1 row in Provider
  • 1 row in Competition + 1 corresponding row in LeaderboardDef for each week
  • for each weekly Competition created above, 1 Prize row for each prize given in the --weekly-prize list.
  • 1 row in Competition + 1 corresponding row in LeaderboardDef for each month
  • for each monthly Competition created above, 1 Prize row for each prize given in the --monthly-prize list.
  • 1 ProviderCountry row for each country code given.
  • 5 ProviderPage rows with the following name: landing, enrollment, terms, rules, outbound. They are used for analytics purpose.
  • 1 Advertisement row for the Provider created above, the outbound name default to the Provider name.

The prize currency option is used to format the message in the Prize and Competition row.

Tweak marketing message

You will need to edit manually the raw of the newly created Provider to enter the marketing messages.

Assets

Copy Assets

There is a set of generic assets located at TH_API/WebClient/competitionPages/img/brokerCo

There is a script that copy the list of assets under brokerCo and rename them so that any brokerco occurrence in the file names is replaced with MyCompetition. The script takes 2 input parameters

  • the name of the new competition MyCompetition
  • the path to the directory containing the brokerCo image directory.
./competition-copy-assets.sh MyCompetition ~/code/TH_SVR/TH_API/WebClient/competitionPages/img

You now should have a new directory MyCompetition containing the assets from the brokerCo folder but with any reference to brokerCo in the file name replaced with MyCompetition.

Add Assets to VS Solution

The new assets are now on disk at the right location, we need to add them to the visual studio solution. In the solution explorer, right click on the folder TH_API/WebClient/competitionPages/img/ and choose Add > Existing Item and select the newly created folder myCompetition.

HTML pages

You first need to find out what is the id of the Provider row that was created for the competition in the first step.

Copy Pages

All the html pages specific to competitions are located at TH_API/Views/CompetitionPages. For each type of page, there is a container page which renders a specific template based on the provider. For instance, for the BrokerCo provider (id=17), the Rules.cshtml page will render the template Rules/_RulesProvider17.cshtml.

There is a script that copy the brokerCo pages and rename them for the new provider we are creating. The script takes several input parameters in the following order:

  • the id of the new provider we created in the earlier step id
  • the name of the new provider we created in the earlier step name
  • the path to the directory containing the competition html pages.
  • a list of the outbound screen to create - there should be 1 outbound name per advertisement created in the first step. the name of the outbound page to create should match the outboundName column on the Advertisement entity created in the first step.
./competition-copy-html.sh ID NAME PATH OUTBOUND_NAME
./competition-copy-html.sh 123 MyCompetition ~/code/TH_SVR/TH_API/Views/CompetitionPages MyCompetition

Add Pages to VS solution

The new assets are now on disk at the right location, we need to add them to the visual studio solution. In the solution explorer right click on the folders where the new files where created and add them using Add > Existing Item.

Creating missing classes in VS

Clone this wiki locally