Account Management¶
New Client/User¶
To give access to the portal to an external organisation or individual, you must first create a Client organisation via the backend admin site https://api.dectechsports.com. Even single users must have a client associated with them. The next step is to set up a contract, detailing what leagues they have access to, how many credits they have, cost, billing date, payment status and when the contract will expire.

Once the contract model save event is triggered for the first time, this will kickoff the a task that will create the first payment. A snap shot of the contract details and which leagues they have access to is stored and associated with the payment. If the payment has credits associated with it, a further task is then kicked off to create the credits.
Top Up / Contract Modification¶
If a client run outs of credits before the next billing cycle, a top payment can be created of the admin site. It is perfectly acceptable for a top up payment to have different access levels to the original contract as the credits permissions are associated at the payment level rather than the contract level.
If a client wishes to change their contract mid billing cycle, you will have to update both the contract and the most up to date contract.
Contract Types¶
Unlimited Credits and Unrestricted Access: A client can access any domestic league and create an unlimited number of player reports. Therefore, no credits get generated with the payment is created.
Unlimited Credits and Restricted Access: A client can create an unlimited number of reports made up from players from a set of specified leagues. No credits get generated with this type as well. payment is created.
Finite Credits and Restricted Access: A client has a set number of credits that get replenished each month and will have restricted access to players from set of specified leagues.
Finite Credits and Unrestricted Access: A client has a set number of credits that get replenished each month and can access players from any domestic league.
How Credits Work¶
Credits are allocated for each player specified in a new player report. Credits have three states, UNALLOCATED, ALLOCATED and EXPIRED. For each player in the report, 1 credit is used and associated with the playerID. The credit state then changes from UNALLOCATED to ALLOCATED. If the user then creates a further a report with a player that has already got a credit associated, no additional credit will be used for that player, as long as the credit has not expired. Credits expire after 30 days.
There is a daily script that checks all the credits and then changes any credits from the UNALLOCATED/ALLOCATED to EXPIRED based on the credit expiry date. Another script is run daily to replenish any credits for any contract that has come to the start of the next billing cycle.