Refactoring for Gin, NoSurf and SCS continues.

This commit is contained in:
2025-10-24 13:08:53 +01:00
parent 7276903733
commit fb07c4a5eb
61 changed files with 546 additions and 524 deletions

View File

@@ -8,11 +8,13 @@ import (
lotteryTicketHandlers "synlotto-website/internal/handlers/lottery/tickets"
thunderballrules "synlotto-website/internal/rules/thunderball"
services "synlotto-website/internal/services/draws"
lotteryTicketService "synlotto-website/internal/services/tickets"
"synlotto-website/internal/helpers"
"synlotto-website/internal/models"
)
// ToDo: SQL in here needs to me moved out the handler!
func RunTicketMatching(db *sql.DB, triggeredBy string) (models.MatchRunStats, error) {
stats := models.MatchRunStats{}
@@ -212,7 +214,8 @@ func RefreshTicketPrizes(db *sql.DB) error {
mainMatches := helpers.CountMatches(matchTicket.Balls, draw.Balls)
bonusMatches := helpers.CountMatches(matchTicket.BonusBalls, draw.BonusBalls)
prizeTier := matcher.GetPrizeTier(row.GameType, mainMatches, bonusMatches, thunderballrules.ThunderballPrizeRules)
// ToDo: this isn't a lottery ticket service really its a draw one
prizeTier := lotteryTicketService.GetPrizeTier(row.GameType, mainMatches, bonusMatches, thunderballrules.ThunderballPrizeRules)
isWinner := prizeTier != ""
var label string