-
Notifications
You must be signed in to change notification settings - Fork 0
Creating Competition
this is a checklist of the steps that need to be performed when creating a new competition.
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.
The command line tool should have inserted the following elements in the database:
- 1 row in
Provider - 1 row in
Competition+ 1 corresponding row inLeaderboardDeffor each week - for each weekly
Competitioncreated above, 1Prizerow for each prize given in the--weekly-prizelist. - 1 row in
Competition+ 1 corresponding row inLeaderboardDeffor each month - for each monthly
Competitioncreated above, 1Prizerow for each prize given in the--monthly-prizelist. - 1
ProviderCountryrow for each country code given. - 5
ProviderPagerows with the following name: landing, enrollment, terms, rules, outbound. They are used for analytics purpose. - 1
Advertisementrow for theProvidercreated 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.
You will need to edit manually the raw of the newly created Provider to enter the marketing messages.
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
brokerCoimage 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.
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.
You first need to find out what is the id of the Provider row that was created for the competition in the first step.
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
outboundNamecolumn on theAdvertisemententity 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
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.