{"openapi":"3.0.0","paths":{"/api/v1/results":{"get":{"description":"Get all lottery results with optional filters and pagination","operationId":"ResultsController_findAll","parameters":[{"name":"X-API-Key","in":"header","description":"API Key for authentication. Get one from /users/me/api-tokens","required":true,"schema":{"type":"string","example":"lat_a1b2c3d4_e5f6g7h8i9j0..."}},{"name":"page","required":false,"in":"query","description":"Page number (1-based)","schema":{"minimum":1,"default":1,"example":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of items per page. Maximum depends on your plan: FREE=5, BASIC=10, PRO=50, BUSINESS=75, HISTORIAN=100, ENTERPRISE=200 (larger values are capped to your plan limit)","schema":{"minimum":1,"maximum":200,"default":10,"example":10,"type":"number"}},{"name":"sort","required":false,"in":"query","description":"Field to sort by","schema":{"example":"drawDate","type":"string","enum":["drawDate","createdAt","updatedAt","jackpot"]}},{"name":"order","required":false,"in":"query","description":"Sort order","schema":{"default":"desc","example":"desc","type":"string","enum":["asc","desc"]}},{"name":"gameType","required":false,"in":"query","description":"Filter by game type","schema":{"example":"euromillones","type":"string","enum":["bonoloto","euromillones","lototurf","primitiva","gordo","quiniela","quinigol","quintuple","nacional","eurodreams"]}},{"name":"status","required":false,"in":"query","description":"Filter by status","schema":{"example":"COMPLETED","type":"string","enum":["SCHEDULED","OPEN","CLOSED","COMPLETED","CANCELLED"]}},{"name":"from","required":false,"in":"query","description":"Filter from date (ISO format)","schema":{"example":"2024-01-01","type":"string"}},{"name":"to","required":false,"in":"query","description":"Filter to date (ISO format)","schema":{"example":"2024-12-31","type":"string"}},{"name":"year","required":false,"in":"query","description":"Filter by year","schema":{"example":2024,"type":"number"}},{"name":"minJackpot","required":false,"in":"query","description":"Filter by minimum jackpot (in euros)","schema":{"example":1000000,"type":"number"}}],"responses":{"200":{"description":"Paginated list of results"},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"UNAUTHORIZED","message":"Invalid or missing API key","statusCode":401},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"402":{"description":"Plan request quota exhausted (INSUFFICIENT_TOKENS)","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"INSUFFICIENT_TOKENS","message":"Request quota exhausted for your plan. Please upgrade your plan.","statusCode":402,"details":{"tokensUsed":5000,"tokensRemaining":0,"resetDate":"2024-02-01T00:00:00.000Z"}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"RATE_LIMIT_EXCEEDED","message":"Rate limit exceeded. Limit: 60 requests per minute","statusCode":429,"details":{"limit":60,"remaining":0,"resetIn":45}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}}},"security":[{"api-key":[]}],"summary":"Get all results","tags":["Results"]}},"/api/v1/results/latest":{"get":{"description":"Returns the most recent result for each lottery game type","operationId":"ResultsController_findLatest","parameters":[{"name":"X-API-Key","in":"header","description":"API Key for authentication. Get one from /users/me/api-tokens","required":true,"schema":{"type":"string","example":"lat_a1b2c3d4_e5f6g7h8i9j0..."}}],"responses":{"200":{"description":"Latest results by game type"},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"UNAUTHORIZED","message":"Invalid or missing API key","statusCode":401},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"402":{"description":"Plan request quota exhausted (INSUFFICIENT_TOKENS)","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"INSUFFICIENT_TOKENS","message":"Request quota exhausted for your plan. Please upgrade your plan.","statusCode":402,"details":{"tokensUsed":5000,"tokensRemaining":0,"resetDate":"2024-02-01T00:00:00.000Z"}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"RATE_LIMIT_EXCEEDED","message":"Rate limit exceeded. Limit: 60 requests per minute","statusCode":429,"details":{"limit":60,"remaining":0,"resetIn":45}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}}},"security":[{"api-key":[]}],"summary":"Get latest results for all games","tags":["Results"]}},"/api/v1/results/{gameType}":{"get":{"description":"Get all results for a specific lottery game","operationId":"ResultsController_findByGameType","parameters":[{"name":"X-API-Key","in":"header","description":"API Key for authentication. Get one from /users/me/api-tokens","required":true,"schema":{"type":"string","example":"lat_a1b2c3d4_e5f6g7h8i9j0..."}},{"name":"gameType","required":true,"in":"path","description":"Game type slug","schema":{"enum":["bonoloto","euromillones","lototurf","primitiva","gordo","quiniela","quinigol","quintuple","nacional","eurodreams"],"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (1-based)","schema":{"minimum":1,"default":1,"example":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of items per page. Maximum depends on your plan: FREE=5, BASIC=10, PRO=50, BUSINESS=75, HISTORIAN=100, ENTERPRISE=200 (larger values are capped to your plan limit)","schema":{"minimum":1,"maximum":200,"default":10,"example":10,"type":"number"}},{"name":"sort","required":false,"in":"query","description":"Field to sort by","schema":{"example":"drawDate","type":"string","enum":["drawDate","createdAt","updatedAt","jackpot"]}},{"name":"order","required":false,"in":"query","description":"Sort order","schema":{"default":"desc","example":"desc","type":"string","enum":["asc","desc"]}},{"name":"status","required":false,"in":"query","description":"Filter by status","schema":{"example":"COMPLETED","type":"string","enum":["SCHEDULED","OPEN","CLOSED","COMPLETED","CANCELLED"]}},{"name":"from","required":false,"in":"query","description":"Filter from date (ISO format)","schema":{"example":"2024-01-01","type":"string"}},{"name":"to","required":false,"in":"query","description":"Filter to date (ISO format)","schema":{"example":"2024-12-31","type":"string"}},{"name":"year","required":false,"in":"query","description":"Filter by year","schema":{"example":2024,"type":"number"}},{"name":"minJackpot","required":false,"in":"query","description":"Filter by minimum jackpot (in euros)","schema":{"example":1000000,"type":"number"}}],"responses":{"200":{"description":"Paginated list of results for the game"},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"UNAUTHORIZED","message":"Invalid or missing API key","statusCode":401},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"402":{"description":"Plan request quota exhausted (INSUFFICIENT_TOKENS)","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"INSUFFICIENT_TOKENS","message":"Request quota exhausted for your plan. Please upgrade your plan.","statusCode":402,"details":{"tokensUsed":5000,"tokensRemaining":0,"resetDate":"2024-02-01T00:00:00.000Z"}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"404":{"description":"Invalid game type"},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"RATE_LIMIT_EXCEEDED","message":"Rate limit exceeded. Limit: 60 requests per minute","statusCode":429,"details":{"limit":60,"remaining":0,"resetIn":45}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}}},"security":[{"api-key":[]}],"summary":"Get results by game type","tags":["Results"]}},"/api/v1/results/{gameType}/latest":{"get":{"description":"Returns the most recent result for a specific lottery game, or null if no results found","operationId":"ResultsController_findLatestByGameType","parameters":[{"name":"X-API-Key","in":"header","description":"API Key for authentication. Get one from /users/me/api-tokens","required":true,"schema":{"type":"string","example":"lat_a1b2c3d4_e5f6g7h8i9j0..."}},{"name":"gameType","required":true,"in":"path","description":"Game type slug","schema":{"enum":["bonoloto","euromillones","lototurf","primitiva","gordo","quiniela","quinigol","quintuple","nacional","eurodreams"],"type":"string"}}],"responses":{"200":{"description":"Latest result for the game, or null if no results found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResultResponseDto"}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"UNAUTHORIZED","message":"Invalid or missing API key","statusCode":401},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"402":{"description":"Plan request quota exhausted (INSUFFICIENT_TOKENS)","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"INSUFFICIENT_TOKENS","message":"Request quota exhausted for your plan. Please upgrade your plan.","statusCode":402,"details":{"tokensUsed":5000,"tokensRemaining":0,"resetDate":"2024-02-01T00:00:00.000Z"}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"RATE_LIMIT_EXCEEDED","message":"Rate limit exceeded. Limit: 60 requests per minute","statusCode":429,"details":{"limit":60,"remaining":0,"resetIn":45}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}}},"security":[{"api-key":[]}],"summary":"Get latest result for a game","tags":["Results"]}},"/api/v1/results/{gameType}/date/{date}":{"get":{"description":"Get results for a specific date. Returns empty array if no results found.","operationId":"ResultsController_findByDate","parameters":[{"name":"X-API-Key","in":"header","description":"API Key for authentication. Get one from /users/me/api-tokens","required":true,"schema":{"type":"string","example":"lat_a1b2c3d4_e5f6g7h8i9j0..."}},{"name":"gameType","required":true,"in":"path","description":"Game type slug","schema":{"enum":["bonoloto","euromillones","lototurf","primitiva","gordo","quiniela","quinigol","quintuple","nacional","eurodreams"],"type":"string"}},{"name":"date","required":true,"in":"path","description":"Date in ISO format (YYYY-MM-DD)","schema":{"example":"2024-01-12","type":"string"}}],"responses":{"200":{"description":"Results for the date (empty array if none found)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ResultResponseDto"}}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"UNAUTHORIZED","message":"Invalid or missing API key","statusCode":401},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"402":{"description":"Plan request quota exhausted (INSUFFICIENT_TOKENS)","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"INSUFFICIENT_TOKENS","message":"Request quota exhausted for your plan. Please upgrade your plan.","statusCode":402,"details":{"tokensUsed":5000,"tokensRemaining":0,"resetDate":"2024-02-01T00:00:00.000Z"}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"RATE_LIMIT_EXCEEDED","message":"Rate limit exceeded. Limit: 60 requests per minute","statusCode":429,"details":{"limit":60,"remaining":0,"resetIn":45}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}}},"security":[{"api-key":[]}],"summary":"Get result by date","tags":["Results"]}},"/api/v1/results/{gameType}/range":{"get":{"description":"Get all results within a date range","operationId":"ResultsController_findByDateRange","parameters":[{"name":"X-API-Key","in":"header","description":"API Key for authentication. Get one from /users/me/api-tokens","required":true,"schema":{"type":"string","example":"lat_a1b2c3d4_e5f6g7h8i9j0..."}},{"name":"gameType","required":true,"in":"path","description":"Game type slug","schema":{"enum":["bonoloto","euromillones","lototurf","primitiva","gordo","quiniela","quinigol","quintuple","nacional","eurodreams"],"type":"string"}},{"name":"from","required":true,"in":"query","description":"Start date (ISO format)","schema":{"example":"2024-01-01","type":"string"}},{"name":"to","required":true,"in":"query","description":"End date (ISO format)","schema":{"example":"2024-12-31","type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (1-based)","schema":{"minimum":1,"default":1,"example":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of items per page. Maximum depends on your plan: FREE=5, BASIC=10, PRO=50, BUSINESS=75, HISTORIAN=100, ENTERPRISE=200 (larger values are capped to your plan limit)","schema":{"minimum":1,"maximum":200,"default":10,"example":10,"type":"number"}},{"name":"sort","required":false,"in":"query","description":"Field to sort by","schema":{"example":"drawDate","type":"string","enum":["drawDate","createdAt","updatedAt","jackpot"]}},{"name":"order","required":false,"in":"query","description":"Sort order","schema":{"default":"desc","example":"desc","type":"string","enum":["asc","desc"]}},{"name":"status","required":false,"in":"query","description":"Filter by status","schema":{"example":"COMPLETED","type":"string","enum":["SCHEDULED","OPEN","CLOSED","COMPLETED","CANCELLED"]}},{"name":"year","required":false,"in":"query","description":"Filter by year","schema":{"example":2024,"type":"number"}},{"name":"minJackpot","required":false,"in":"query","description":"Filter by minimum jackpot (in euros)","schema":{"example":1000000,"type":"number"}}],"responses":{"200":{"description":"Paginated results in date range"},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"UNAUTHORIZED","message":"Invalid or missing API key","statusCode":401},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"402":{"description":"Plan request quota exhausted (INSUFFICIENT_TOKENS)","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"INSUFFICIENT_TOKENS","message":"Request quota exhausted for your plan. Please upgrade your plan.","statusCode":402,"details":{"tokensUsed":5000,"tokensRemaining":0,"resetDate":"2024-02-01T00:00:00.000Z"}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"RATE_LIMIT_EXCEEDED","message":"Rate limit exceeded. Limit: 60 requests per minute","statusCode":429,"details":{"limit":60,"remaining":0,"resetIn":45}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}}},"security":[{"api-key":[]}],"summary":"Get results in date range","tags":["Results"]}},"/api/v1/results/{gameType}/check":{"get":{"description":"Check if your numbers match the winning combination. By default checks against the latest draw. For nacional, numbers are décimo numbers (up to 5 digits, max 50) and the response gives the prize of each one from the official list of prized numbers (pedrea, aproximaciones, terminaciones, reintegros...), in cents per décimo, in additionalData.decimos. Lists are kept from July 2026 on; listStatus is provisional while a long draw such as Navidad is still being held, if the source publishes a provisional list.","operationId":"ResultsController_checkNumbers","parameters":[{"name":"X-API-Key","in":"header","description":"API Key for authentication. Get one from /users/me/api-tokens","required":true,"schema":{"type":"string","example":"lat_a1b2c3d4_e5f6g7h8i9j0..."}},{"name":"gameType","required":true,"in":"path","description":"Game type slug","schema":{"enum":["bonoloto","euromillones","lototurf","primitiva","gordo","quiniela","quinigol","quintuple","nacional","eurodreams"],"type":"string"}},{"name":"numbers","required":true,"in":"query","description":"Numbers to check (comma-separated)","schema":{"example":"4,15,23,38,42","type":"string"}},{"name":"extraNumbers","required":false,"in":"query","description":"Extra numbers to check (stars for Euromillones, etc.)","schema":{"example":"3,11","type":"string"}},{"name":"drawId","required":false,"in":"query","description":"Specific draw ID to check against (optional, defaults to latest)","schema":{"example":"2024001","type":"string"}}],"responses":{"200":{"description":"Check result with matches and prize information","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckNumbersResponseDto"}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"UNAUTHORIZED","message":"Invalid or missing API key","statusCode":401},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"402":{"description":"Plan request quota exhausted (INSUFFICIENT_TOKENS)","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"INSUFFICIENT_TOKENS","message":"Request quota exhausted for your plan. Please upgrade your plan.","statusCode":402,"details":{"tokensUsed":5000,"tokensRemaining":0,"resetDate":"2024-02-01T00:00:00.000Z"}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"404":{"description":"No results found"},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"RATE_LIMIT_EXCEEDED","message":"Rate limit exceeded. Limit: 60 requests per minute","statusCode":429,"details":{"limit":60,"remaining":0,"resetIn":45}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}}},"security":[{"api-key":[]}],"summary":"Check numbers against a draw","tags":["Results"]}},"/api/v1/results/{gameType}/{drawId}":{"get":{"description":"Get the result for a specific draw ID. Returns null if not found.","operationId":"ResultsController_findByDrawId","parameters":[{"name":"X-API-Key","in":"header","description":"API Key for authentication. Get one from /users/me/api-tokens","required":true,"schema":{"type":"string","example":"lat_a1b2c3d4_e5f6g7h8i9j0..."}},{"name":"gameType","required":true,"in":"path","description":"Game type slug","schema":{"enum":["bonoloto","euromillones","lototurf","primitiva","gordo","quiniela","quinigol","quintuple","nacional","eurodreams"],"type":"string"}},{"name":"drawId","required":true,"in":"path","description":"Draw ID","schema":{"example":"2024001","type":"string"}}],"responses":{"200":{"description":"Draw result, or null if not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResultResponseDto"}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"UNAUTHORIZED","message":"Invalid or missing API key","statusCode":401},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"402":{"description":"Plan request quota exhausted (INSUFFICIENT_TOKENS)","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"INSUFFICIENT_TOKENS","message":"Request quota exhausted for your plan. Please upgrade your plan.","statusCode":402,"details":{"tokensUsed":5000,"tokensRemaining":0,"resetDate":"2024-02-01T00:00:00.000Z"}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"RATE_LIMIT_EXCEEDED","message":"Rate limit exceeded. Limit: 60 requests per minute","statusCode":429,"details":{"limit":60,"remaining":0,"resetIn":45}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}}},"security":[{"api-key":[]}],"summary":"Get specific draw result","tags":["Results"]}},"/api/v1/draws/upcoming":{"get":{"description":"Returns upcoming draws for all lottery games","operationId":"DrawsController_findUpcoming","parameters":[{"name":"X-API-Key","in":"header","description":"API Key for authentication. Get one from /users/me/api-tokens","required":true,"schema":{"type":"string","example":"lat_a1b2c3d4_e5f6g7h8i9j0..."}},{"name":"page","required":false,"in":"query","description":"Page number (1-based)","schema":{"minimum":1,"default":1,"example":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of items per page. Maximum depends on your plan: FREE=5, BASIC=10, PRO=50, BUSINESS=75, HISTORIAN=100, ENTERPRISE=200 (larger values are capped to your plan limit)","schema":{"minimum":1,"maximum":200,"default":10,"example":10,"type":"number"}},{"name":"sort","required":false,"in":"query","description":"Field to sort by","schema":{"example":"drawDate","type":"string","enum":["drawDate","closingDate","openingDate","jackpot","createdAt"]}},{"name":"order","required":false,"in":"query","description":"Sort order","schema":{"default":"desc","example":"desc","type":"string","enum":["asc","desc"]}},{"name":"status","required":false,"in":"query","description":"Filter by status","schema":{"example":"OPEN","type":"string","enum":["SCHEDULED","OPEN","CLOSED"]}}],"responses":{"200":{"description":"List of upcoming draws","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DrawResponseDto"}}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"UNAUTHORIZED","message":"Invalid or missing API key","statusCode":401},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"RATE_LIMIT_EXCEEDED","message":"Rate limit exceeded. Limit: 60 requests per minute","statusCode":429,"details":{"limit":60,"remaining":0,"resetIn":45}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}}},"security":[{"api-key":[]}],"summary":"Get all upcoming draws","tags":["Draws"]}},"/api/v1/draws/upcoming/next":{"get":{"description":"Returns the next scheduled draw for each lottery game type","operationId":"DrawsController_findNextForAllGames","parameters":[{"name":"X-API-Key","in":"header","description":"API Key for authentication. Get one from /users/me/api-tokens","required":true,"schema":{"type":"string","example":"lat_a1b2c3d4_e5f6g7h8i9j0..."}}],"responses":{"200":{"description":"Next draw for each game type"},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"UNAUTHORIZED","message":"Invalid or missing API key","statusCode":401},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"RATE_LIMIT_EXCEEDED","message":"Rate limit exceeded. Limit: 60 requests per minute","statusCode":429,"details":{"limit":60,"remaining":0,"resetIn":45}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}}},"security":[{"api-key":[]}],"summary":"Get next draw for each game","tags":["Draws"]}},"/api/v1/draws/upcoming/{gameType}":{"get":{"description":"Returns upcoming draws for a specific lottery game","operationId":"DrawsController_findUpcomingByGameType","parameters":[{"name":"X-API-Key","in":"header","description":"API Key for authentication. Get one from /users/me/api-tokens","required":true,"schema":{"type":"string","example":"lat_a1b2c3d4_e5f6g7h8i9j0..."}},{"name":"gameType","required":true,"in":"path","description":"Game type slug","schema":{"enum":["bonoloto","euromillones","lototurf","primitiva","gordo","quiniela","quinigol","quintuple","nacional","eurodreams"],"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (1-based)","schema":{"minimum":1,"default":1,"example":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of items per page. Maximum depends on your plan: FREE=5, BASIC=10, PRO=50, BUSINESS=75, HISTORIAN=100, ENTERPRISE=200 (larger values are capped to your plan limit)","schema":{"minimum":1,"maximum":200,"default":10,"example":10,"type":"number"}},{"name":"sort","required":false,"in":"query","description":"Field to sort by","schema":{"example":"drawDate","type":"string","enum":["drawDate","closingDate","openingDate","jackpot","createdAt"]}},{"name":"order","required":false,"in":"query","description":"Sort order","schema":{"default":"desc","example":"desc","type":"string","enum":["asc","desc"]}},{"name":"status","required":false,"in":"query","description":"Filter by status","schema":{"example":"OPEN","type":"string","enum":["SCHEDULED","OPEN","CLOSED"]}}],"responses":{"200":{"description":"List of upcoming draws for the game","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DrawResponseDto"}}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"UNAUTHORIZED","message":"Invalid or missing API key","statusCode":401},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"RATE_LIMIT_EXCEEDED","message":"Rate limit exceeded. Limit: 60 requests per minute","statusCode":429,"details":{"limit":60,"remaining":0,"resetIn":45}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}}},"security":[{"api-key":[]}],"summary":"Get upcoming draws by game type","tags":["Draws"]}},"/api/v1/draws/{drawId}":{"get":{"description":"Returns details for a specific draw","operationId":"DrawsController_findById","parameters":[{"name":"X-API-Key","in":"header","description":"API Key for authentication. Get one from /users/me/api-tokens","required":true,"schema":{"type":"string","example":"lat_a1b2c3d4_e5f6g7h8i9j0..."}},{"name":"drawId","required":true,"in":"path","description":"Draw ID","schema":{"example":"2024002","type":"string"}}],"responses":{"200":{"description":"Draw details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DrawResponseDto"}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"UNAUTHORIZED","message":"Invalid or missing API key","statusCode":401},"timestamp":"2024-01-15T10:30:00.000Z"}}}}},"404":{"description":"Draw not found"},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"example":{"success":false,"error":{"code":"RATE_LIMIT_EXCEEDED","message":"Rate limit exceeded. Limit: 60 requests per minute","statusCode":429,"details":{"limit":60,"remaining":0,"resetIn":45}},"timestamp":"2024-01-15T10:30:00.000Z"}}}}}},"security":[{"api-key":[]}],"summary":"Get draw by ID","tags":["Draws"]}}},"info":{"title":"Loterias API","description":"API publica para consultar resultados de Loterias y Apuestas del Estado de Espana","version":"1.0","contact":{"name":"Loterias API Support","url":"https://loteriasapi.com","email":"soporte@loteriasapi.com"}},"tags":[{"name":"Results","description":"Lottery results and number checking"},{"name":"Draws","description":"Upcoming draws and schedules"}],"servers":[],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"Enter JWT token"},"api-key":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API Key for data endpoints"}},"schemas":{"RegisterDto":{"type":"object","properties":{"email":{"type":"string","description":"User email address","example":"usuario@ejemplo.com"},"password":{"type":"string","description":"Password (min 8 characters, must contain uppercase, lowercase, and number)","example":"MiPassword123","minLength":8,"maxLength":100},"firstName":{"type":"string","description":"First name","example":"Juan","maxLength":100},"lastName":{"type":"string","description":"Last name","example":"Garcia","maxLength":100},"company":{"type":"string","description":"Company name","example":"Mi Empresa S.L.","maxLength":200},"turnstileToken":{"type":"string","description":"Cloudflare Turnstile token for bot protection","example":"0.xxxxxxxxxxxxx"}},"required":["email","password"]},"LoginDto":{"type":"object","properties":{"tokenTransport":{"type":"string","description":"Transporte de los tokens: \"cookie\" = solo cookies httpOnly (no se devuelven en el cuerpo)","enum":["cookie","body"],"example":"cookie"},"email":{"type":"string","description":"User email address","example":"usuario@ejemplo.com"},"password":{"type":"string","description":"User password","example":"MiPassword123"},"deviceName":{"type":"string","description":"Device name for session identification","example":"Chrome on Windows","maxLength":200},"deviceType":{"type":"string","description":"Device type","example":"desktop","enum":["mobile","desktop","tablet","other"]},"turnstileToken":{"type":"string","description":"Cloudflare Turnstile token for bot protection","example":"0.xxxxxxxxxxxxx"}},"required":["email","password"]},"LoginResponseDto":{"type":"object","properties":{"accessToken":{"type":"string","description":"JWT access token (short-lived)","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."},"refreshToken":{"type":"string","description":"Refresh token (long-lived)","example":"a1b2c3d4e5f6..."},"expiresIn":{"type":"number","description":"Access token expiration time in seconds","example":900},"tokenType":{"type":"string","description":"Token type","example":"Bearer"}},"required":["accessToken","refreshToken","expiresIn","tokenType"]},"RefreshTokenDto":{"type":"object","properties":{"tokenTransport":{"type":"string","description":"Transporte de los tokens: \"cookie\" = solo cookies httpOnly (no se devuelven en el cuerpo)","enum":["cookie","body"],"example":"cookie"},"refreshToken":{"type":"string","description":"Refresh token obtained from login (optional if sent in the refresh_token cookie)","example":"a1b2c3d4e5f6g7h8i9j0..."}}},"RefreshTokenResponseDto":{"type":"object","properties":{"accessToken":{"type":"string","description":"New JWT access token","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."},"refreshToken":{"type":"string","description":"New refresh token (rotated)","example":"x1y2z3..."},"expiresIn":{"type":"number","description":"Access token expiration time in seconds","example":900},"tokenType":{"type":"string","description":"Token type","example":"Bearer"}},"required":["accessToken","refreshToken","expiresIn","tokenType"]},"SessionResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Session ID","example":"clx123abc456def"},"deviceName":{"type":"string","description":"Device name","example":"Chrome on Windows"},"deviceType":{"type":"string","description":"Device type","example":"desktop"},"ipAddress":{"type":"string","description":"IP address","example":"192.168.1.1"},"userAgent":{"type":"string","description":"User agent string","example":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36..."},"createdAt":{"format":"date-time","type":"string","description":"Session creation date","example":"2024-01-15T10:30:00.000Z"},"lastUsedAt":{"format":"date-time","type":"string","description":"Last activity date","example":"2024-01-15T12:00:00.000Z"},"expiresAt":{"format":"date-time","type":"string","description":"Session expiration date","example":"2024-02-14T10:30:00.000Z"},"isCurrent":{"type":"boolean","description":"Whether this is the current session","example":true}},"required":["id","createdAt","lastUsedAt","expiresAt","isCurrent"]},"SessionListResponseDto":{"type":"object","properties":{"sessions":{"description":"List of active sessions","type":"array","items":{"$ref":"#/components/schemas/SessionResponseDto"}},"total":{"type":"number","description":"Total number of active sessions","example":3}},"required":["sessions","total"]},"ForgotPasswordDto":{"type":"object","properties":{"email":{"type":"string","description":"Email address to send reset link","example":"usuario@ejemplo.com"},"turnstileToken":{"type":"string","description":"Cloudflare Turnstile token for bot protection","example":"0.xxxxxxxxxxxxx"}},"required":["email"]},"ResetPasswordDto":{"type":"object","properties":{"token":{"type":"string","description":"Password reset token received via email","example":"abc123def456..."},"newPassword":{"type":"string","description":"New password","example":"NuevoPassword123","minLength":8,"maxLength":100},"turnstileToken":{"type":"string","description":"Cloudflare Turnstile token for bot protection","example":"0.xxxxxxxxxxxxx"}},"required":["token","newPassword"]},"VerifyEmailDto":{"type":"object","properties":{"token":{"type":"string","description":"Email verification token received via email","example":"abc123def456..."}},"required":["token"]},"ResendVerificationDto":{"type":"object","properties":{"email":{"type":"string","description":"Email address to resend verification","example":"usuario@ejemplo.com"},"turnstileToken":{"type":"string","description":"Cloudflare Turnstile token for bot protection","example":"0.xxxxxxxxxxxxx"}},"required":["email"]},"GetCooldownDto":{"type":"object","properties":{"email":{"type":"string","description":"Email address to check cooldown","example":"usuario@ejemplo.com"},"type":{"type":"string","description":"Type of cooldown to check","example":"forgot-password","enum":["forgot-password","verify-email"]}},"required":["email","type"]},"CooldownResponseDto":{"type":"object","properties":{"remainingSeconds":{"type":"number","description":"Remaining seconds until cooldown expires","example":45},"isActive":{"type":"boolean","description":"Whether cooldown is active","example":true}},"required":["remainingSeconds","isActive"]},"CheckVerificationStatusDto":{"type":"object","properties":{"email":{"type":"string","description":"Email address to check","example":"usuario@ejemplo.com"}},"required":["email"]},"GoogleLoginDto":{"type":"object","properties":{"tokenTransport":{"type":"string","description":"Transporte de los tokens: \"cookie\" = solo cookies httpOnly (no se devuelven en el cuerpo)","enum":["cookie","body"],"example":"cookie"},"idToken":{"type":"string","description":"Google ID token (credential) from Google Sign-In","example":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...","maxLength":3000}},"required":["idToken"]},"ImpersonationExchangeDto":{"type":"object","properties":{"tokenTransport":{"type":"string","description":"Transporte de los tokens: \"cookie\" = solo cookies httpOnly (no se devuelven en el cuerpo)","enum":["cookie","body"],"example":"cookie"},"code":{"type":"string","description":"Codigo de un solo uso (60 s) generado por Atlas para \"entrar como usuario\"","example":"k3J9x0Qm2pZ7c1Vb8nR4tY6uW5sA0dEf"}},"required":["code"]},"SetPasswordDto":{"type":"object","properties":{"password":{"type":"string","description":"New password for Google-only user","example":"MySecurePass123","minLength":8,"maxLength":100}},"required":["password"]},"AuthMethodsResponseDto":{"type":"object","properties":{"hasPassword":{"type":"boolean","description":"Whether the user has configured a password for email/password login","example":true},"hasGoogle":{"type":"boolean","description":"Whether the user has linked their Google account","example":false}},"required":["hasPassword","hasGoogle"]},"UserResponseDto":{"type":"object","properties":{"id":{"type":"string","example":"clx123abc456def"},"impersonation":{"type":"boolean","example":false,"description":"Solo en GET /users/me: true si la sesion actual es de «Entrar como» (soporte)."},"email":{"type":"string","example":"usuario@ejemplo.com"},"role":{"type":"string","example":"USER","enum":["USER","ADMIN"]},"status":{"type":"string","example":"ACTIVE","enum":["ACTIVE","SUSPENDED","DELETED"]},"plan":{"type":"string","example":"FREE","enum":["FREE","BASIC","PRO","ENTERPRISE"]},"emailVerified":{"type":"boolean","example":true},"firstName":{"type":"string","example":"Juan"},"lastName":{"type":"string","example":"Garcia"},"company":{"type":"string","example":"Mi Empresa S.L."},"avatarUrl":{"type":"string","example":"https://r2.example.com/avatars/user123.svg"},"createdAt":{"format":"date-time","type":"string","example":"2024-01-15T10:30:00.000Z"},"lastLoginAt":{"format":"date-time","type":"string","example":"2024-01-15T12:00:00.000Z"}},"required":["id","email","role","status","plan","emailVerified","createdAt"]},"UpdateUserDto":{"type":"object","properties":{"firstName":{"type":"string","description":"First name","example":"Juan","maxLength":100},"lastName":{"type":"string","description":"Last name","example":"Garcia","maxLength":100},"company":{"type":"string","description":"Company name","example":"Mi Empresa S.L.","maxLength":200}}},"ChangePasswordDto":{"type":"object","properties":{"currentPassword":{"type":"string","description":"Current password","example":"ActualPassword123"},"newPassword":{"type":"string","description":"New password","example":"NuevoPassword123","minLength":8,"maxLength":100}},"required":["currentPassword","newPassword"]},"UpdateEmailSubscriptionDto":{"type":"object","properties":{"subscribed":{"type":"boolean","description":"true = recibir emails no esenciales; false = darse de baja de ellos","example":true}},"required":["subscribed"]},"UserUsageDto":{"type":"object","properties":{"tokensUsed":{"type":"number","description":"Tokens used in current period","example":1500},"tokensRemaining":{"type":"number","description":"Tokens remaining in current period","example":3500},"totalTokens":{"type":"number","description":"Total tokens for the period","example":5000},"usagePercentage":{"type":"number","description":"Usage percentage","example":30},"periodStart":{"format":"date-time","type":"string","description":"Current period start date","example":"2024-01-01T00:00:00.000Z"},"periodEnd":{"format":"date-time","type":"string","description":"Current period end date","example":"2024-01-31T23:59:59.999Z"},"planName":{"type":"string","description":"Plan name","example":"Pro"}},"required":["tokensUsed","tokensRemaining","totalTokens","usagePercentage","periodStart","periodEnd","planName"]},"ApiTokenResponseDto":{"type":"object","properties":{"id":{"type":"string","example":"clx123abc456def"},"name":{"type":"string","example":"Production Server"},"tokenPrefix":{"type":"string","description":"Token prefix (first characters)","example":"lat_a1b2c3d4"},"scopes":{"description":"Token scopes","example":["read:draws","read:results"],"type":"array","items":{"type":"string"}},"rateLimit":{"type":"number","description":"Custom rate limit (overrides plan)","example":60},"totalRequests":{"type":"string","description":"Total requests made with this token","example":15000},"createdAt":{"format":"date-time","type":"string","example":"2024-01-15T10:30:00.000Z"},"expiresAt":{"format":"date-time","type":"string","example":"2025-12-31T23:59:59.999Z"},"lastUsedAt":{"format":"date-time","type":"string","example":"2024-01-15T14:00:00.000Z"},"connector":{"type":"string","description":"Set when the key was created by connecting an MCP client with OAuth (e.g. \"claude\", \"chatgpt\"). Does not count toward the plan key limit; revoking it disconnects the client.","example":"claude"}},"required":["id","name","tokenPrefix","scopes","totalRequests","createdAt"]},"ApiTokenListResponseDto":{"type":"object","properties":{"tokens":{"description":"List of API tokens","type":"array","items":{"$ref":"#/components/schemas/ApiTokenResponseDto"}},"maxTokens":{"type":"number","description":"Maximum number of tokens allowed by plan","example":5},"activeCount":{"type":"number","description":"Number of tokens currently active","example":2}},"required":["tokens","maxTokens","activeCount"]},"CreateApiTokenDto":{"type":"object","properties":{"name":{"type":"string","description":"Descriptive name for the API token","example":"Production Server","maxLength":100},"scopes":{"description":"Scopes/permissions for the token","example":["read:draws","read:results"],"default":["read:draws","read:results"],"type":"array","items":{"type":"string"}},"expiresAt":{"type":"string","description":"Token expiration date (ISO format). If not set, token never expires.","example":"2025-12-31T23:59:59.999Z"}},"required":["name"]},"ApiTokenCreatedResponseDto":{"type":"object","properties":{"id":{"type":"string","example":"clx123abc456def"},"name":{"type":"string","example":"Production Server"},"tokenPrefix":{"type":"string","description":"Token prefix (first characters)","example":"lat_a1b2c3d4"},"scopes":{"description":"Token scopes","example":["read:draws","read:results"],"type":"array","items":{"type":"string"}},"rateLimit":{"type":"number","description":"Custom rate limit (overrides plan)","example":60},"totalRequests":{"type":"string","description":"Total requests made with this token","example":15000},"createdAt":{"format":"date-time","type":"string","example":"2024-01-15T10:30:00.000Z"},"expiresAt":{"format":"date-time","type":"string","example":"2025-12-31T23:59:59.999Z"},"lastUsedAt":{"format":"date-time","type":"string","example":"2024-01-15T14:00:00.000Z"},"connector":{"type":"string","description":"Set when the key was created by connecting an MCP client with OAuth (e.g. \"claude\", \"chatgpt\"). Does not count toward the plan key limit; revoking it disconnects the client.","example":"claude"},"token":{"type":"string","description":"Full API token (only shown once at creation). Store this securely!","example":"lat_a1b2c3d4_e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0"}},"required":["id","name","tokenPrefix","scopes","totalRequests","createdAt","token"]},"RequestLogItemDto":{"type":"object","properties":{"id":{"type":"string","example":"clx123abc456def"},"method":{"type":"string","example":"GET"},"path":{"type":"string","example":"/api/v1/results/euromillones/latest"},"queryParams":{"type":"object","description":"Query parameters if any"},"statusCode":{"type":"number","example":200},"responseTimeMs":{"type":"number","example":45},"ipAddress":{"type":"string","example":"192.168.1.1"},"userAgent":{"type":"string","example":"Mozilla/5.0..."},"createdAt":{"format":"date-time","type":"string","example":"2024-01-15T10:30:00.000Z"}},"required":["id","method","path","statusCode","responseTimeMs","ipAddress","createdAt"]},"RequestLogListResponseDto":{"type":"object","properties":{"requests":{"type":"array","items":{"$ref":"#/components/schemas/RequestLogItemDto"}},"total":{"type":"number","example":100},"page":{"type":"number","example":1},"limit":{"type":"number","example":20},"totalPages":{"type":"number","example":5}},"required":["requests","total","page","limit","totalPages"]},"DeleteAccountDto":{"type":"object","properties":{"password":{"type":"string","description":"Current password to confirm account deletion. Not required for accounts without a password (Google-only sign-in).","example":"MiPassword123"},"confirmation":{"type":"string","description":"Confirmation text - must be \"DELETE\"","example":"DELETE"}},"required":["confirmation"]},"SubscriptionResponseDto":{"type":"object","properties":{"id":{"type":"string","example":"clx123abc456def"},"status":{"type":"string","example":"ACTIVE","enum":["ACTIVE","CANCELLED","PAST_DUE","TRIALING","PAUSED"]},"plan":{"type":"object","description":"Current plan details"},"billingInterval":{"type":"string","description":"Billing interval of the paid subscription","enum":["monthly","yearly"],"example":"monthly"},"isPaid":{"type":"boolean","description":"Whether the subscription is billed through Stripe","example":true},"currentPeriodStart":{"format":"date-time","type":"string","example":"2024-01-01T00:00:00.000Z"},"currentPeriodEnd":{"format":"date-time","type":"string","example":"2024-01-31T23:59:59.999Z"},"cancelAtPeriodEnd":{"type":"boolean","description":"Whether subscription will cancel at period end","example":false},"tokensRemaining":{"type":"number","example":18500},"tokensUsed":{"type":"number","example":1500},"cancelledAt":{"format":"date-time","type":"string","example":"2024-01-15T10:30:00.000Z"},"giftedUntil":{"format":"date-time","type":"string","description":"Date until which the subscription is gifted (free). After this date, normal billing resumes.","example":"2024-04-01T00:00:00.000Z"}},"required":["id","status","plan","currentPeriodStart","currentPeriodEnd","cancelAtPeriodEnd","tokensRemaining","tokensUsed"]},"SubscribeDto":{"type":"object","properties":{"planSlug":{"type":"string","description":"Plan slug to subscribe to","example":"pro"},"interval":{"type":"string","description":"Billing interval","example":"monthly","enum":["monthly","yearly"]},"successUrl":{"type":"string","description":"Success URL after checkout","example":"https://example.com/success"},"cancelUrl":{"type":"string","description":"Cancel URL for checkout","example":"https://example.com/cancel"}},"required":["planSlug","interval"]},"CheckoutSessionResponseDto":{"type":"object","properties":{"url":{"type":"string","description":"Stripe Checkout Session URL","example":"https://checkout.stripe.com/pay/cs_xxx"},"sessionId":{"type":"string","description":"Session ID","example":"cs_xxx"}},"required":["url","sessionId"]},"PreviewPlanChangeDto":{"type":"object","properties":{"planSlug":{"type":"string","example":"pro"},"interval":{"type":"string","example":"monthly","enum":["monthly","yearly"]}},"required":["planSlug","interval"]},"PlanChangePreviewResponseDto":{"type":"object","properties":{"currentPlanSlug":{"type":"string","example":"basic"},"currentPlanName":{"type":"string","example":"Basic"},"newPlanSlug":{"type":"string","example":"pro"},"newPlanName":{"type":"string","example":"Pro"},"proratedAmount":{"type":"number","description":"Prorated amount in cents","example":-1550},"newAmount":{"type":"number","description":"New amount due in cents","example":2999},"currency":{"type":"string","example":"EUR"},"effectiveDate":{"format":"date-time","type":"string"},"immediateCharge":{"type":"boolean","example":true}},"required":["currentPlanSlug","currentPlanName","newPlanSlug","newPlanName","proratedAmount","newAmount","currency","effectiveDate","immediateCharge"]},"ChangePlanDto":{"type":"object","properties":{"planSlug":{"type":"string","description":"New plan slug","example":"enterprise"},"interval":{"type":"string","description":"New billing interval","example":"yearly","enum":["monthly","yearly"]},"successUrl":{"type":"string","description":"Success URL after checkout","example":"https://example.com/success"},"cancelUrl":{"type":"string","description":"Cancel URL for checkout","example":"https://example.com/cancel"}},"required":["planSlug","interval"]},"CustomerPortalResponseDto":{"type":"object","properties":{"url":{"type":"string","description":"Stripe Customer Portal URL","example":"https://billing.stripe.com/session/xxx"}},"required":["url"]},"InvoiceItemDto":{"type":"object","properties":{"id":{"type":"string","example":"in_1234567890"},"number":{"type":"string","example":"INV-0001"},"status":{"type":"string","description":"Invoice status","example":"paid","enum":["draft","open","paid","uncollectible","void"]},"amount":{"type":"number","description":"Amount in cents","example":2999},"currency":{"type":"string","description":"Currency","example":"EUR"},"amountFormatted":{"type":"string","description":"Formatted amount","example":"29,99 EUR"},"description":{"type":"string","description":"Invoice description/memo","example":"Pro Plan - Monthly Subscription"},"createdAt":{"format":"date-time","type":"string","description":"Invoice creation date","example":"2024-01-01T00:00:00.000Z"},"paidAt":{"format":"date-time","type":"string","description":"Invoice paid date","example":"2024-01-01T00:05:00.000Z"},"pdfUrl":{"type":"string","description":"Invoice PDF URL","example":"https://pay.stripe.com/invoice/xxx/pdf"},"hostedInvoiceUrl":{"type":"string","description":"Hosted invoice URL","example":"https://invoice.stripe.com/i/xxx"}},"required":["id","number","status","amount","currency","amountFormatted","createdAt"]},"InvoiceListResponseDto":{"type":"object","properties":{"invoices":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceItemDto"}},"hasMore":{"type":"boolean","description":"Whether there are more invoices","example":false}},"required":["invoices","hasMore"]},"PlanResponseDto":{"type":"object","properties":{"id":{"type":"string","example":"clx123abc456def"},"slug":{"type":"string","example":"pro"},"name":{"type":"string","example":"Pro"},"description":{"type":"string","example":"Para aplicaciones en produccion"},"priceMonthly":{"type":"number","description":"Monthly price in cents","example":2990},"priceYearly":{"type":"number","description":"Yearly price in cents","example":29900},"currency":{"type":"string","example":"EUR"},"monthlyTokens":{"type":"number","description":"Monthly API tokens included","example":20000},"rateLimit":{"type":"number","description":"Rate limit (requests per minute)","example":60},"maxApiKeys":{"type":"number","description":"Maximum number of API keys","example":5},"maxItemsPerRequest":{"type":"number","description":"Maximum items per request (pagination)","example":50},"historyDays":{"type":"number","description":"Number of days of history accessible (-1 for unlimited)","example":365},"maxWebhooks":{"type":"number","description":"Maximum number of webhooks","example":5},"emailSupport":{"type":"boolean","description":"Whether email support is included","example":true},"trialDays":{"type":"number","description":"Free trial days (0 = no trial)","example":30},"features":{"description":"List of features","example":["20.000 peticiones/mes","Datos en tiempo real","WebSockets"],"type":"array","items":{"type":"string"}},"formattedPriceMonthly":{"type":"string","description":"Formatted monthly price","example":"29,90 EUR"},"formattedPriceYearly":{"type":"string","description":"Formatted yearly price","example":"299,00 EUR"},"stripePriceIdMonthly":{"type":"string","description":"Stripe Price ID for monthly billing","example":"price_1234567890"},"stripePriceIdYearly":{"type":"string","description":"Stripe Price ID for yearly billing","example":"price_0987654321"},"sortOrder":{"type":"number","description":"Display order","example":2}},"required":["id","slug","name","priceMonthly","priceYearly","currency","monthlyTokens","rateLimit","maxApiKeys","maxItemsPerRequest","historyDays","maxWebhooks","emailSupport","trialDays","features","formattedPriceMonthly","formattedPriceYearly","sortOrder"]},"PlanListResponseDto":{"type":"object","properties":{"plans":{"description":"Available plans","type":"array","items":{"$ref":"#/components/schemas/PlanResponseDto"}}},"required":["plans"]},"GameInfoDto":{"type":"object","properties":{"slug":{"type":"string","example":"euromillones"},"name":{"type":"string","example":"Euromillones"}},"required":["slug","name"]},"PrizeDto":{"type":"object","properties":{"category":{"type":"number","example":1},"categoryName":{"type":"string","example":"5 + 2 estrellas"},"winners":{"type":"number","example":0},"prizeAmount":{"type":"string","description":"Prize amount in cents","example":13000000000},"formattedPrize":{"type":"string","description":"Formatted prize amount","example":"130.000.000,00 EUR"}},"required":["category","categoryName","winners","prizeAmount","formattedPrize"]},"DocumentDto":{"type":"object","properties":{"title":{"type":"string","description":"Document title","example":"Lista oficial de premios"},"originalUrl":{"type":"string","description":"Original URL from source","example":"https://www.loteriasyapuestas.es/..."},"r2Url":{"type":"string","description":"R2 CDN URL (null if not yet uploaded)","example":"https://cdn.loteriasapi.com/documents/2024/euromillones/result-2024001.pdf"},"type":{"type":"string","description":"Document type","enum":["pdf","other"],"example":"pdf"},"status":{"type":"string","description":"Upload status","enum":["uploaded","pending","failed"],"example":"uploaded"},"error":{"type":"string","description":"Error message if status is failed"}},"required":["title","originalUrl","type","status"]},"ResultResponseDto":{"type":"object","properties":{"id":{"type":"string","example":"clx123abc456def"},"game":{"$ref":"#/components/schemas/GameInfoDto"},"drawId":{"type":"string","description":"Source draw ID","example":"2024001"},"drawDate":{"type":"string","example":"2024-01-12"},"dayOfWeek":{"type":"string","example":"Viernes"},"year":{"type":"number","example":2024},"status":{"type":"string","example":"COMPLETED","enum":["SCHEDULED","OPEN","CLOSED","COMPLETED","CANCELLED"]},"jackpot":{"type":"string","description":"Jackpot amount in cents","example":"7700000000"},"jackpotFormatted":{"type":"string","description":"Formatted jackpot","example":"77.000.000,00 €"},"combination":{"description":"Main combination numbers","example":[4,15,23,38,42],"type":"array","items":{"type":"number"}},"resultData":{"type":"object","description":"Additional result data (stars, reintegro, joker, etc.) - Structure varies by game type","example":{"estrellas":[3,11],"millon":{"codigo":"ABC12345","ganador":true},"lluvia":{"codigo":"XYZ67890","ganador":false},"combinacionRaw":"04 - 15 - 23 - 38 - 42 - 03 - 11"}},"prizes":{"description":"Prize breakdown by category","example":[{"category":1,"categoryName":"5 + 2 estrellas","winners":0,"prizeAmount":"13000000000","formattedPrize":"130.000.000,00 €"},{"category":2,"categoryName":"5 + 1 estrella","winners":3,"prizeAmount":"25000000","formattedPrize":"250.000,00 €"},{"category":3,"categoryName":"5 aciertos","winners":12,"prizeAmount":"5000000","formattedPrize":"50.000,00 €"}],"type":"array","items":{"$ref":"#/components/schemas/PrizeDto"}},"statistics":{"type":"object","description":"Statistics about bets and revenue","example":{"totalBets":"45678901","totalRevenue":"9135780200","prizePool":"4567890100"}},"officialListUrl":{"type":"string","description":"Official list URL (for Loteria Nacional)","example":"https://www.loteriasyapuestas.es/es/loteria-nacional/resultados"},"documents":{"description":"Related documents (PDFs, official lists, etc.)","example":[{"title":"Lista oficial de premios","originalUrl":"https://www.loteriasyapuestas.es/docs/euromillones-2024001.pdf","r2Url":"https://cdn.loteriasapi.com/documents/2024/euromillones/result-2024001.pdf","type":"pdf","status":"uploaded"},{"title":"Acta del sorteo","originalUrl":"https://www.loteriasyapuestas.es/docs/acta-2024001.pdf","r2Url":null,"type":"pdf","status":"pending"}],"type":"array","items":{"$ref":"#/components/schemas/DocumentDto"}}},"required":["id","game","drawId","drawDate","dayOfWeek","year","status","combination","resultData","prizes"]},"MatchedPrizeDto":{"type":"object","properties":{"category":{"type":"number","example":3},"categoryName":{"type":"string","example":"5 aciertos"},"prizeAmount":{"type":"string","example":"50000"},"formattedPrize":{"type":"string","example":"500,00 EUR"}},"required":["category","categoryName","prizeAmount","formattedPrize"]},"CheckNumbersResponseDto":{"type":"object","properties":{"hasResults":{"type":"boolean","example":true},"checkedNumbers":{"description":"The numbers that were checked","example":[4,15,23,38,42],"type":"array","items":{"type":"string"}},"checkedExtraNumbers":{"description":"Extra numbers that were checked (stars, etc.)","example":[3,11],"type":"array","items":{"type":"string"}},"game":{"$ref":"#/components/schemas/GameInfoDto"},"drawDate":{"type":"string","example":"2024-01-12"},"drawId":{"type":"string","example":"2024001"},"winningCombination":{"description":"The winning combination","example":[4,15,23,38,42],"type":"array","items":{"type":"string"}},"winningExtraNumbers":{"description":"Extra winning numbers (stars for Euromillones, etc.)","type":"array","items":{"type":"string"}},"mainNumbersMatched":{"type":"number","description":"How many main numbers matched","example":3},"extraNumbersMatched":{"type":"number","description":"How many extra numbers matched","example":1},"matchedNumbers":{"description":"List of matched main numbers","example":[4,15,38],"type":"array","items":{"type":"string"}},"matchedExtraNumbers":{"description":"List of matched extra numbers","example":[3],"type":"array","items":{"type":"string"}},"isWinner":{"type":"boolean","description":"Whether the combination won any prize","example":true},"prize":{"description":"Prize won (if any)","allOf":[{"$ref":"#/components/schemas/MatchedPrizeDto"}]},"additionalData":{"type":"object","description":"Additional result data specific to the game type"}},"required":["hasResults","checkedNumbers","game","drawDate","drawId","winningCombination","mainNumbersMatched","matchedNumbers","isWinner"]},"PublicRecentDrawDto":{"type":"object","properties":{"drawDate":{"type":"string","example":"2026-10-22"},"dayOfWeek":{"type":"string","example":"Jueves"},"combination":{"example":[4,15,23,38,42],"description":"Numeros principales (vacio en Nacional, Quiniela y Quinigol)","type":"array","items":{"type":"number"}},"estrellas":{"example":[3,11],"type":"array","items":{"type":"number"}},"complementario":{"type":"number","example":44,"description":"Primitiva y Bonoloto"},"reintegro":{"type":"number","example":7,"description":"Primitiva, Bonoloto y Lototurf"},"caballo":{"type":"number","example":9,"description":"Lototurf: caballo ganador"},"numeroClave":{"type":"number","example":5,"description":"El Gordo: numero clave"},"sueno":{"type":"number","example":3,"description":"EuroDreams: numero sueno"},"primerPremio":{"type":"object","description":"Loteria Nacional: primer premio"},"segundoPremio":{"type":"object","description":"Loteria Nacional: segundo premio"},"partidos":{"type":"object","description":"Quiniela y Quinigol: partidos"},"pleno15":{"type":"object","description":"Quiniela: pleno al 15"},"jackpot":{"type":"string","example":"7700000000","description":"Bote en centimos"},"jackpotFormatted":{"type":"string","example":"77.000.000,00 €"}},"required":["drawDate","combination"]},"PublicRecentResultsDto":{"type":"object","properties":{"gameType":{"type":"string","example":"primitiva"},"gameName":{"type":"string","example":"La Primitiva"},"draws":{"description":"Del mas reciente al mas antiguo; como maximo 3","type":"array","items":{"$ref":"#/components/schemas/PublicRecentDrawDto"}}},"required":["gameType","gameName","draws"]},"PublicNumberCountDto":{"type":"object","properties":{"number":{"type":"number","example":23},"count":{"type":"number","example":281,"description":"Veces que ha salido"},"percentage":{"type":"number","example":14.05,"description":"% de sorteos analizados"}},"required":["number","count","percentage"]},"PublicNumberAbsenceDto":{"type":"object","properties":{"number":{"type":"number","example":17},"drawsSinceLast":{"type":"number","example":41,"description":"Sorteos transcurridos desde su ultima salida (0 = ultimo)"}},"required":["number","drawsSinceLast"]},"PublicEvenOddDto":{"type":"object","properties":{"even":{"type":"number","example":3,"description":"Numeros pares de la combinacion"},"odd":{"type":"number","example":3,"description":"Numeros impares de la combinacion"},"percentage":{"type":"number","example":31.2,"description":"% de sorteos con este reparto"}},"required":["even","odd","percentage"]},"PublicSumDto":{"type":"object","properties":{"average":{"type":"number","example":150.2},"commonMin":{"type":"number","example":118,"description":"Limite inferior del rango que contiene ~70% central"},"commonMax":{"type":"number","example":182,"description":"Limite superior del rango que contiene ~70% central"}},"required":["average","commonMin","commonMax"]},"PublicPairDto":{"type":"object","properties":{"a":{"type":"number","example":7},"b":{"type":"number","example":23},"count":{"type":"number","example":41,"description":"Sorteos en los que salieron juntos"}},"required":["a","b","count"]},"PublicStatisticsDto":{"type":"object","properties":{"gameType":{"type":"string","example":"primitiva"},"gameName":{"type":"string","example":"La Primitiva"},"drawsAnalyzed":{"type":"number","example":2000},"from":{"type":"string","example":"2017-03-02","description":"Sorteo mas antiguo"},"to":{"type":"string","example":"2026-10-22","description":"Sorteo mas reciente"},"updatedAt":{"type":"string","example":"2026-10-22T10:00:00.000Z"},"mostFrequent":{"description":"Numeros que mas han salido: 10 en bombos de 45 o mas numeros (primitiva, bonoloto, euromillones, gordo) y 5 en los menores (lototurf, eurodreams)","type":"array","items":{"$ref":"#/components/schemas/PublicNumberCountDto"}},"leastFrequent":{"description":"Numeros que menos han salido: 10 en bombos de 45 o mas numeros y 5 en los menores","type":"array","items":{"$ref":"#/components/schemas/PublicNumberCountDto"}},"longestAbsent":{"description":"Numeros con mas sorteos sin salir: 10 en bombos de 45 o mas numeros y 5 en los menores","type":"array","items":{"$ref":"#/components/schemas/PublicNumberAbsenceDto"}},"evenOddDistribution":{"description":"Reparto par/impar exacto, de mas pares a mas impares","type":"array","items":{"$ref":"#/components/schemas/PublicEvenOddDto"}},"sum":{"$ref":"#/components/schemas/PublicSumDto"},"topPairs":{"description":"Las 5 parejas que mas han salido juntas","type":"array","items":{"$ref":"#/components/schemas/PublicPairDto"}}},"required":["gameType","gameName","drawsAnalyzed","from","to","updatedAt","mostFrequent","leastFrequent","longestAbsent","evenOddDistribution","sum","topPairs"]},"NacionalDateRangeDto":{"type":"object","properties":{"from":{"type":"string","example":"2004-01-03"},"to":{"type":"string","example":"2026-11-14"}},"required":["from","to"]},"NacionalDigitCountDto":{"type":"object","properties":{"digit":{"type":"number","example":7,"description":"Digito 0-9"},"count":{"type":"number","example":212,"description":"Veces que ha salido"},"percentage":{"type":"number","example":10.4,"description":"% sobre el total de la serie"}},"required":["digit","count","percentage"]},"NacionalTwoDigitCountDto":{"type":"object","properties":{"digits":{"type":"string","example":"07","description":"Dos ultimas cifras (con cero)"},"count":{"type":"number","example":31},"percentage":{"type":"number","example":1.5}},"required":["digits","count","percentage"]},"NacionalKindStatsDto":{"type":"object","properties":{"kind":{"type":"string","enum":["ordinario_jueves","ordinario_sabado","ordinario_otro","extraordinario","navidad","nino"],"example":"ordinario_jueves"},"drawsConsidered":{"type":"number","example":800},"lastDigit":{"type":"array","items":{"$ref":"#/components/schemas/NacionalDigitCountDto"}},"reintegro":{"type":"array","items":{"$ref":"#/components/schemas/NacionalDigitCountDto"}}},"required":["kind","drawsConsidered","lastDigit","reintegro"]},"NacionalPublicStatsDto":{"type":"object","properties":{"gameType":{"type":"string","example":"nacional"},"gameName":{"type":"string","example":"Loteria Nacional"},"drawsConsidered":{"type":"number","example":2000,"description":"Sorteos con resultado analizados"},"drawsWithFirstPrize":{"type":"number","example":1990,"description":"Sorteos con primer premio valido (base de lastDigit)"},"dateRange":{"$ref":"#/components/schemas/NacionalDateRangeDto"},"lastDigit":{"description":"Frecuencia de la ultima cifra del primer premio (10 filas)","type":"array","items":{"$ref":"#/components/schemas/NacionalDigitCountDto"}},"lastTwoDigitsTop":{"description":"Top 10 de las dos ultimas cifras del primer premio","type":"array","items":{"$ref":"#/components/schemas/NacionalTwoDigitCountDto"}},"reintegro":{"description":"Frecuencia del reintegro 0-9 (10 filas)","type":"array","items":{"$ref":"#/components/schemas/NacionalDigitCountDto"}},"reintegroTotal":{"type":"number","example":5900,"description":"Reintegros contados"},"byKind":{"description":"Mismo calculo separado por tipo de sorteo","type":"array","items":{"$ref":"#/components/schemas/NacionalKindStatsDto"}}},"required":["gameType","gameName","drawsConsidered","drawsWithFirstPrize","dateRange","lastDigit","lastTwoDigitsTop","reintegro","reintegroTotal","byKind"]},"NumberFrequencyDto":{"type":"object","properties":{"number":{"type":"number","example":7},"frequency":{"type":"number","example":156},"percentage":{"type":"number","description":"Percentage of draws where this number appeared","example":12.5},"lastDrawn":{"type":"string","description":"Last drawn date","example":"2024-01-12"}},"required":["number","frequency","percentage","lastDrawn"]},"GameStatisticsDto":{"type":"object","properties":{"gameType":{"type":"string","example":"euromillones"},"gameName":{"type":"string","example":"Euromillones"},"totalDraws":{"type":"number","description":"Total number of draws analyzed","example":1250},"dateRange":{"type":"object","description":"Date range of analyzed draws"},"hotNumbers":{"description":"Most frequent main numbers","type":"array","items":{"$ref":"#/components/schemas/NumberFrequencyDto"}},"coldNumbers":{"description":"Least frequent main numbers","type":"array","items":{"$ref":"#/components/schemas/NumberFrequencyDto"}},"hotExtraNumbers":{"description":"Most frequent extra numbers (stars, etc.)","type":"array","items":{"$ref":"#/components/schemas/NumberFrequencyDto"}},"averageDaysBetweenJackpots":{"type":"number","description":"Average days between jackpot wins","example":45},"largestJackpot":{"type":"string","description":"Largest jackpot ever","example":"230.000.000 EUR"},"averageJackpot":{"type":"string","description":"Average jackpot","example":"45.000.000 EUR"}},"required":["gameType","gameName","totalDraws"]},"JackpotHistoryItemDto":{"type":"object","properties":{"date":{"type":"string","example":"2024-01-12"},"jackpot":{"type":"string","description":"Jackpot amount in cents","example":"14500000000"},"jackpotFormatted":{"type":"string","description":"Formatted jackpot","example":"145.000.000 EUR"},"hasWinner":{"type":"boolean","description":"Whether there was a winner","example":false},"winners":{"type":"number","description":"Number of winners (if any)","example":1}},"required":["date","jackpot","jackpotFormatted","hasWinner"]},"JackpotHistoryDto":{"type":"object","properties":{"gameType":{"type":"string","example":"euromillones"},"history":{"description":"Jackpot history","type":"array","items":{"$ref":"#/components/schemas/JackpotHistoryItemDto"}},"total":{"type":"number","description":"Total records","example":52}},"required":["gameType","history","total"]},"PatternDto":{"type":"object","properties":{"type":{"type":"string","description":"Pattern type","example":"consecutive_numbers"},"description":{"type":"string","description":"Pattern description","example":"Draws with consecutive numbers"},"occurrences":{"type":"number","description":"Number of occurrences","example":45},"percentage":{"type":"number","description":"Percentage of all draws","example":3.6},"examples":{"description":"Example combinations","example":[[5,6,7,22,33],[12,13,14,36,42]],"type":"array","items":{"type":"string"}}},"required":["type","description","occurrences","percentage"]},"SumDistributionDto":{"type":"object","properties":{"range":{"type":"string","description":"Sum range","example":"100-120"},"count":{"type":"number","description":"Number of draws in this range","example":150},"percentage":{"type":"number","description":"Percentage","example":12}},"required":["range","count","percentage"]},"PatternsResponseDto":{"type":"object","properties":{"gameType":{"type":"string","example":"euromillones"},"totalDrawsAnalyzed":{"type":"number","description":"Total draws analyzed","example":1250},"patterns":{"description":"Common patterns found","type":"array","items":{"$ref":"#/components/schemas/PatternDto"}},"sumDistribution":{"description":"Sum distribution (sum of all numbers in combination)","type":"array","items":{"$ref":"#/components/schemas/SumDistributionDto"}},"commonPairs":{"description":"Most common pairs of numbers","type":"array","items":{"type":"string"}},"commonTriplets":{"description":"Most common triplets of numbers","type":"array","items":{"type":"string"}}},"required":["gameType","totalDrawsAnalyzed","patterns"]},"DrawResponseDto":{"type":"object","properties":{"id":{"type":"string","example":"clx123abc456def"},"game":{"type":"object","description":"Game information"},"drawId":{"type":"string","description":"Source draw ID","example":"2024002"},"drawDate":{"type":"string","example":"2024-01-19"},"dayOfWeek":{"type":"string","example":"Viernes"},"year":{"type":"number","example":2024},"status":{"type":"string","example":"OPEN","enum":["SCHEDULED","OPEN","CLOSED","COMPLETED","CANCELLED"]},"openingDate":{"type":"string","description":"Opening date for bets","example":"2024-01-15T00:00:00.000Z"},"closingDate":{"type":"string","description":"Closing date for bets","example":"2024-01-19T19:00:00.000Z"},"jackpot":{"type":"string","description":"Jackpot in cents","example":"14500000000"},"jackpotFormatted":{"type":"string","description":"Formatted jackpot","example":"145.000.000 EUR"},"metadata":{"type":"object","description":"Additional metadata (jornada, lugar, etc.)"}},"required":["id","game","drawId","drawDate","dayOfWeek","year","status"]},"CreateIpBanDto":{"type":"object","properties":{"ipAddress":{"type":"string"},"reason":{"type":"string"},"permanent":{"type":"boolean"},"expiresAt":{"type":"string"},"createdBy":{"type":"string"}},"required":["ipAddress","reason"]},"CreatePlanDto":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string"},"priceMonthly":{"type":"number","description":"Monthly price in cents"},"priceYearly":{"type":"number","description":"Yearly price in cents"},"currency":{"type":"string","default":"EUR"},"monthlyTokens":{"type":"number","description":"Monthly tokens limit"},"rateLimit":{"type":"number","description":"Requests per minute"},"maxApiKeys":{"type":"number","description":"Max API keys allowed","default":1},"features":{"type":"array","items":{"type":"string"}},"stripePriceIdMonthly":{"type":"string"},"stripePriceIdYearly":{"type":"string"},"isActive":{"type":"boolean"},"isPublic":{"type":"boolean"}},"required":["name","slug","priceMonthly","monthlyTokens","rateLimit"]},"UpdatePlanDto":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"priceMonthly":{"type":"number"},"priceYearly":{"type":"number"},"currency":{"type":"string"},"monthlyTokens":{"type":"number"},"rateLimit":{"type":"number"},"maxApiKeys":{"type":"number"},"features":{"type":"array","items":{"type":"string"}},"stripePriceIdMonthly":{"type":"string"},"stripePriceIdYearly":{"type":"string"},"isActive":{"type":"boolean"},"isPublic":{"type":"boolean"}}},"AdjustTokensDto":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"]},"GiftMonthsDto":{"type":"object","properties":{"months":{"type":"number","description":"Number of months to gift","minimum":1,"maximum":36},"reason":{"type":"string","description":"Reason for gifting months"}},"required":["months"]},"TriggerSyncDto":{"type":"object","properties":{"gameId":{"type":"string","description":"Specific game ID to sync"},"forceFullSync":{"type":"boolean"}}},"InitializeDefaultPlansDto":{"type":"object","properties":{"force":{"type":"boolean","default":false,"description":"Force recreation of existing plans"}}},"ImportStatsDto":{"type":"object","properties":{"totalDraws":{"type":"number"},"totalResults":{"type":"number"},"byGame":{"type":"array","items":{"type":"object","properties":{"gameId":{"type":"string"},"gameName":{"type":"string"},"draws":{"type":"number"},"results":{"type":"number"},"oldestDate":{"type":"string","nullable":true},"newestDate":{"type":"string","nullable":true}}}}},"required":["totalDraws","totalResults","byGame"]},"CompletedPeriodsGameDto":{"type":"object","properties":{"gameId":{"type":"string","description":"Game ID (BONO, EMIL, etc.)"},"gameName":{"type":"string","description":"Game display name"},"completedMonths":{"description":"Completed months (1-12)","example":[1,2,3,4,5,6,7,8,9,10,11,12],"type":"array","items":{"type":"number"}},"totalResults":{"type":"number","description":"Total results found"},"importedResults":{"type":"number","description":"Results successfully imported"}},"required":["gameId","gameName","completedMonths","totalResults","importedResults"]},"CompletedPeriodsYearDto":{"type":"object","properties":{"year":{"type":"number","description":"Year","example":2024},"completedMonths":{"type":"number","description":"Number of completed months in this year"},"totalCheckpoints":{"type":"number","description":"Total checkpoints for this year"},"games":{"description":"Games with completed periods in this year","type":"array","items":{"$ref":"#/components/schemas/CompletedPeriodsGameDto"}}},"required":["year","completedMonths","totalCheckpoints","games"]},"CompletedPeriodsGameYearDto":{"type":"object","properties":{"year":{"type":"number","description":"Year","example":2024},"completedMonths":{"description":"Completed months (1-12)","example":[1,2,3,4,5,6,7,8,9,10,11,12],"type":"array","items":{"type":"number"}},"totalResults":{"type":"number","description":"Total results found in this year"},"importedResults":{"type":"number","description":"Results successfully imported in this year"}},"required":["year","completedMonths","totalResults","importedResults"]},"CompletedPeriodsGameInfoDto":{"type":"object","properties":{"gameId":{"type":"string","description":"Game ID (BONO, EMIL, etc.)"},"gameName":{"type":"string","description":"Game display name"},"years":{"description":"Years with completed periods","type":"array","items":{"$ref":"#/components/schemas/CompletedPeriodsGameYearDto"}}},"required":["gameId","gameName","years"]},"CompletedPeriodsDto":{"type":"object","properties":{"byYear":{"description":"Completed periods grouped by year","type":"array","items":{"$ref":"#/components/schemas/CompletedPeriodsYearDto"}},"byGame":{"description":"Completed periods grouped by game","type":"array","items":{"$ref":"#/components/schemas/CompletedPeriodsGameInfoDto"}}},"required":["byYear","byGame"]},"ImportYearDto":{"type":"object","properties":{"year":{"type":"number","description":"Year to import (e.g., 2023)","example":2023,"minimum":2000,"maximum":2030}},"required":["year"]},"ImportProgressDto":{"type":"object","properties":{"gameId":{"type":"string"},"gameName":{"type":"string"},"year":{"type":"number"},"totalResults":{"type":"number"},"imported":{"type":"number"},"skipped":{"type":"number"},"errors":{"type":"number"},"status":{"type":"string"},"errorMessages":{"type":"array","items":{"type":"string"}}},"required":["gameId","gameName","year","totalResults","imported","skipped","errors","status","errorMessages"]},"ImportResultDto":{"type":"object","properties":{"totalGames":{"type":"number"},"totalResultsImported":{"type":"number"},"totalSkipped":{"type":"number"},"totalErrors":{"type":"number"},"details":{"type":"array","items":{"$ref":"#/components/schemas/ImportProgressDto"}},"duration":{"type":"number","description":"Duration in milliseconds"}},"required":["totalGames","totalResultsImported","totalSkipped","totalErrors","details","duration"]},"ImportGameYearDto":{"type":"object","properties":{"gameId":{"type":"string","description":"Game ID (e.g., BONO, EMIL, LAPR)","example":"BONO"},"year":{"type":"number","description":"Year to import","example":2023,"minimum":2000,"maximum":2030}},"required":["gameId","year"]},"ImportYearRangeDto":{"type":"object","properties":{"fromYear":{"type":"number","description":"Start year","example":2020,"minimum":2000,"maximum":2030},"toYear":{"type":"number","description":"End year","example":2024,"minimum":2000,"maximum":2030}},"required":["fromYear","toYear"]},"BackfillGapsBodyDto":{"type":"object","properties":{"reimportYears":{"description":"Years to fully re-import (max 30 entries)","example":[2008,2009],"type":"array","items":{"type":"number"}}}},"AdminEmailResponseDto":{"type":"object","properties":{"id":{"type":"string"},"recipientEmail":{"type":"string"},"userId":{"type":"string"},"type":{"type":"string","enum":["EMAIL_VERIFICATION","PASSWORD_RESET","ADMIN_PASSWORD_RESET","WELCOME","SUBSCRIPTION_CONFIRMED","SUBSCRIPTION_CANCELLED","TOKEN_USAGE_ALERT","ADMIN_TEST","ADMIN_NOTIFICATION"]},"subject":{"type":"string"},"status":{"type":"string","enum":["SENT","FAILED"]},"errorMessage":{"type":"string"},"sesMessageId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","recipientEmail","type","subject","status","createdAt"]},"AdminEmailListResponseDto":{"type":"object","properties":{"emails":{"type":"array","items":{"$ref":"#/components/schemas/AdminEmailResponseDto"}},"total":{"type":"number"}},"required":["emails","total"]},"AdminEmailDetailDto":{"type":"object","properties":{"id":{"type":"string"},"recipientEmail":{"type":"string"},"userId":{"type":"string"},"type":{"type":"string","enum":["EMAIL_VERIFICATION","PASSWORD_RESET","ADMIN_PASSWORD_RESET","WELCOME","SUBSCRIPTION_CONFIRMED","SUBSCRIPTION_CANCELLED","TOKEN_USAGE_ALERT","ADMIN_TEST","ADMIN_NOTIFICATION"]},"subject":{"type":"string"},"status":{"type":"string","enum":["SENT","FAILED"]},"errorMessage":{"type":"string"},"sesMessageId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"htmlPreview":{"type":"string"},"textPreview":{"type":"string"},"metadata":{"type":"object"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","recipientEmail","type","subject","status","createdAt","updatedAt"]},"AdminLoginDto":{"type":"object","properties":{"email":{"type":"string","example":"admin@loteriasapi.com"},"password":{"type":"string","example":"SuperSecret123!"},"turnstileToken":{"type":"string","description":"Cloudflare Turnstile token"},"useCookies":{"type":"boolean","description":"true: la sesión se entrega solo en cookies httpOnly y los tokens no van en el cuerpo"}},"required":["email","password"]},"AdminLoginTwoFactorDto":{"type":"object","properties":{"mfaToken":{"type":"string","description":"Token intermedio devuelto por /login"},"code":{"type":"string","description":"Código TOTP (6 dígitos) o de recuperación"},"useCookies":{"type":"boolean"}},"required":["mfaToken","code"]},"AdminRefreshTokenDto":{"type":"object","properties":{"refreshToken":{"type":"string","description":"Opcional: si no se envía se usa la cookie httpOnly"}}},"AdminForgotPasswordDto":{"type":"object","properties":{"email":{"type":"string"},"turnstileToken":{"type":"string","description":"Cloudflare Turnstile token"}},"required":["email"]},"AdminResetPasswordDto":{"type":"object","properties":{"token":{"type":"string"},"newPassword":{"type":"string"},"turnstileToken":{"type":"string","description":"Cloudflare Turnstile token"}},"required":["token","newPassword"]},"AdminChangePasswordDto":{"type":"object","properties":{"currentPassword":{"type":"string"},"newPassword":{"type":"string"}},"required":["currentPassword","newPassword"]},"AdminTwoFactorEnableDto":{"type":"object","properties":{"code":{"type":"string"},"currentPassword":{"type":"string"}},"required":["code","currentPassword"]},"AdminTwoFactorDisableDto":{"type":"object","properties":{"code":{"type":"string","description":"Código TOTP o de recuperación"},"currentPassword":{"type":"string"}},"required":["code","currentPassword"]},"AdminTwoFactorCodeDto":{"type":"object","properties":{"code":{"type":"string","description":"Código TOTP"}},"required":["code"]},"CreateUserAdminDto":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"sendWelcomeEmail":{"type":"boolean"}},"required":["email"]},"GiftSubscriptionDto":{"type":"object","properties":{"planId":{"type":"string"},"durationMonths":{"type":"number","description":"Meses a regalar. Omitir si lifetime=true."},"lifetime":{"type":"boolean","description":"Suscripción vitalicia (hasta año 2099)."}},"required":["planId"]},"ExtendTrialDto":{"type":"object","properties":{"days":{"type":"number"}},"required":["days"]},"UpdateMaintenanceDto":{"type":"object","properties":{"active":{"type":"boolean","description":"Activar ahora (hasta que se desactive o llegue endsAt)."},"startsAt":{"type":"string","nullable":true,"example":"2026-11-10T16:00:00.000Z"},"endsAt":{"type":"string","nullable":true,"example":"2026-11-10T18:00:00.000Z"},"message":{"type":"string","maxLength":280}},"required":["active"]},"UpdateRegistrationDto":{"type":"object","properties":{"open":{"type":"boolean","description":"true = registros abiertos."},"reason":{"type":"string","maxLength":200,"nullable":true}},"required":["open"]},"UpdateFeatureFlagDto":{"type":"object","properties":{"value":{"type":"boolean","description":"Nuevo valor del flag."},"reason":{"type":"string","minLength":3,"maxLength":200,"description":"Motivo del cambio (obligatorio, queda en auditoría)."}},"required":["value","reason"]},"UpdateMailProviderDto":{"type":"object","properties":{"provider":{"type":"string","example":"ses","description":"Id de un proveedor registrado."}},"required":["provider"]},"UpdateBlogProviderDto":{"type":"object","properties":{"provider":{"type":"string","example":"blogelia","description":"'native' o 'blogelia' (otro valor: 400)."}},"required":["provider"]},"BanIpDto":{"type":"object","properties":{"ipAddress":{"type":"string","example":"203.0.113.7"},"reason":{"type":"string","example":"Multicuenta gratuita"},"days":{"type":"number","description":"Duracion en dias. Sin valor = permanente. Con IPs dinamicas conviene un baneo temporal: la IP puede pasar a otra persona.","example":30}},"required":["ipAddress"]},"BanUserDto":{"type":"object","properties":{"reason":{"type":"string","description":"Motivo (interno; solo se muestra al usuario con showReason)","minLength":3,"maxLength":500},"until":{"type":"string","description":"Fin del baneo (ISO 8601, futura). Omitir o null = indefinido.","nullable":true,"example":"2026-12-31T23:59:59.000Z"},"showReason":{"type":"boolean","description":"Mostrar el motivo al usuario en la respuesta 403 BANNED","default":false},"notify":{"type":"boolean","description":"Avisar al usuario por email (por defecto no)","default":false}},"required":["reason"]},"ChangeUserRoleDto":{"type":"object","properties":{"role":{"type":"string","enum":["USER","ADMIN"]}},"required":["role"]},"UserReasonDto":{"type":"object","properties":{"reason":{"type":"string","description":"Motivo (queda en el audit log)"}}},"CreateAdminDto":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"role":{"type":"string","enum":["SUPERADMIN","ADMIN"]}},"required":["email","password"]},"UpdateAdminDto":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"role":{"type":"string","enum":["SUPERADMIN","ADMIN"]},"status":{"type":"string","enum":["ACTIVE","SUSPENDED"]}}},"ResetAdminPasswordDto":{"type":"object","properties":{"newPassword":{"type":"string"}},"required":["newPassword"]},"CreateCouponDto":{"type":"object","properties":{"name":{"type":"string","example":"Verano 2026"},"code":{"type":"string","example":"VERANO50"},"type":{"type":"string","enum":["percent_off","amount_off"],"example":"percent_off"},"percentOff":{"type":"number","example":50},"amountOff":{"type":"number","example":500,"description":"Amount in cents"},"currency":{"type":"string","example":"eur","default":"eur"},"duration":{"type":"string","enum":["once","repeating","forever"],"example":"once"},"durationInMonths":{"type":"number","example":3},"maxRedemptions":{"type":"number","example":100},"redeemBy":{"type":"string","example":"2026-12-31T23:59:59Z"},"minimumAmount":{"type":"number","example":1000,"description":"Minimum order in cents"}},"required":["name","type","duration"]},"UpdatePromotionCodeDto":{"type":"object","properties":{"active":{"type":"boolean","example":false}},"required":["active"]},"NotificationAudienceDto":{"type":"object","properties":{"type":{"type":"string","enum":["all","plan","users"],"example":"all"},"plan":{"type":"string","description":"Solo con type=plan: id o slug del plan (suscripcion ACTIVE).","example":"pro"},"users":{"description":"Solo con type=users: ids de usuario o emails (1-200). No se guardan.","type":"array","items":{"type":"string"}}},"required":["type"]},"NotificationPreviewDto":{"type":"object","properties":{"audience":{"$ref":"#/components/schemas/NotificationAudienceDto"},"channels":{"type":"array","example":["in_app","email"],"items":{"type":"string","enum":["in_app","email"]}}},"required":["audience","channels"]},"ConfirmRecipientsDto":{"type":"object","properties":{"inApp":{"type":"number","description":"Recuento de la vista previa (in_app)"},"email":{"type":"number","description":"Recuento de la vista previa (email)"}}},"CreateNotificationCampaignDto":{"type":"object","properties":{"title":{"type":"string","maxLength":100,"example":"Mantenimiento programado"},"message":{"type":"string","maxLength":500},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH","URGENT"],"default":"MEDIUM"},"actionUrl":{"type":"string","description":"Ruta relativa (/ruta, no //) o URL del origen de APP_URL. Otra cosa: 400.","example":"/dashboard"},"channels":{"type":"array","example":["in_app","email"],"items":{"type":"string","enum":["in_app","email"]}},"audience":{"$ref":"#/components/schemas/NotificationAudienceDto"},"confirmRecipients":{"description":"Recuentos de la vista previa de cada canal elegido. Si difieren de los actuales: 409 y 0 envios.","allOf":[{"$ref":"#/components/schemas/ConfirmRecipientsDto"}]},"expiresAt":{"format":"date-time","type":"string","description":"Caducidad de la notificacion in-app (futura, ISO 8601)."}},"required":["title","message","channels","audience","confirmRecipients"]},"SendNotificationTestDto":{"type":"object","properties":{"title":{"type":"string","maxLength":100,"example":"Mantenimiento programado"},"message":{"type":"string","maxLength":500},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH","URGENT"],"default":"MEDIUM"},"actionUrl":{"type":"string","description":"Ruta relativa (/ruta, no //) o URL del origen de APP_URL. Otra cosa: 400.","example":"/dashboard"},"channels":{"type":"array","example":["in_app","email"],"items":{"type":"string","enum":["in_app","email"]}}},"required":["title","message","channels"]},"UpdateContactMessageDto":{"type":"object","properties":{"status":{"type":"string","enum":["new","in_progress","resolved","spam"]},"internalNote":{"type":"string","description":"Nota interna (max 2000). null o vacio = borrar la nota.","maxLength":2000,"nullable":true}}},"DeleteContactMessageDto":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":200,"description":"Motivo del borrado (obligatorio, queda en auditoria)."}},"required":["reason"]},"RefundChargeDto":{"type":"object","properties":{"confirmAmountCents":{"type":"number","minimum":1,"description":"Confirmacion: debe ser igual al importe efectivo a reembolsar (centimos)"},"amountCents":{"type":"number","minimum":1,"description":"Centimos a reembolsar; si falta, todo lo reembolsable"},"reason":{"type":"string","minLength":3,"maxLength":200,"description":"Motivo interno (queda en auditoria)"},"stripeReason":{"type":"string","enum":["duplicate","fraudulent","requested_by_customer"]}},"required":["confirmAmountCents","reason"]},"BlogPostResponseDto":{"type":"object","properties":{"id":{"type":"string","example":"507f1f77bcf86cd799439011"},"slug":{"type":"string","example":"como-consultar-resultados-euromillones-api"},"title":{"type":"string","example":"Cómo consultar resultados de Euromillones con la API"},"excerpt":{"type":"string","example":"Aprende a integrar los resultados de Euromillones en tu aplicación usando nuestra API REST de forma sencilla y eficiente."},"content":{"type":"string","description":"HTML content of the post"},"category":{"type":"string","example":"guias","enum":["noticias","guias","estadisticas","tecnologia","curiosidades","consejos"]},"tags":{"example":["euromillones","api","tutorial"],"type":"array","items":{"type":"string"}},"author":{"type":"string","example":"Equipo Lotería API"},"publishedAt":{"format":"date-time","type":"string","example":"2026-03-15T10:00:00.000Z"},"readingTime":{"type":"number","example":5},"createdAt":{"format":"date-time","type":"string","example":"2026-03-15T10:00:00.000Z"},"updatedAt":{"format":"date-time","type":"string","example":"2026-03-15T10:00:00.000Z","description":"Ultima modificacion real del texto (titulo, entradilla, cuerpo, FAQs); sin cambios posteriores a la publicacion es publishedAt"},"contentUpdatedAt":{"format":"date-time","type":"string","example":"2026-03-15T10:00:00.000Z","description":"Igual que updatedAt; nombre explicito para dateModified"},"metaDescription":{"type":"string","description":"Meta description (posts generados con IA)"},"lead":{"type":"string","description":"Entradilla del post"},"faqs":{"description":"Preguntas frecuentes","type":"array","items":{"type":"string"}},"cover":{"type":"object","description":"Portada optimizada (WebP/AVIF en varios tamanos)"},"aiGenerated":{"type":"boolean","description":"Escrito con ayuda de IA"},"showcaseSite":{"type":"object","description":"Plataforma destacada del post (solo si esta activa). Se usa para la tarjeta del final.","example":{"name":"TuDécimo","url":"https://tudecimo.com","tagline":"Comparte décimos con amigos y familia.","linkRel":"follow","logoUrl":"https://img.loteriasapi.com/blog/logos/tudecimo-1a2b3c4d.webp"}},"url":{"type":"string","example":"https://loteriasapi.com/blog/como-consultar-resultados-euromillones-api"}},"required":["id","slug","title","excerpt","content","category","tags","author","publishedAt","readingTime","createdAt","updatedAt"]},"BlogPostListResponseDto":{"type":"object","properties":{"posts":{"type":"array","items":{"$ref":"#/components/schemas/BlogPostResponseDto"}},"total":{"type":"number","example":160},"page":{"type":"number","example":1},"limit":{"type":"number","example":10},"totalPages":{"type":"number","example":16}},"required":["posts","total","page","limit","totalPages"]},"UpdateBlogAutomationSettingsDto":{"type":"object","properties":{}},"GenerateDto":{"type":"object","properties":{"showcaseSiteId":{"type":"string","description":"ID de una plataforma activa (showcase_sites)","example":"507f1f77bcf86cd799439011"},"angle":{"type":"string","description":"Enfoque del post; si se indica, manda sobre la investigacion","minLength":10,"maxLength":500}}},"TestStyleDto":{"type":"object","properties":{}},"Object":{"type":"object","properties":{}},"RewriteThinDto":{"type":"object","properties":{"maxWords":{"type":"number","description":"Se reescriben los posts con menos palabras que este umbral","minimum":1,"maximum":20000,"default":400},"limit":{"type":"number","description":"Cuantos posts encolar como maximo (1 a 20)","minimum":1,"maximum":20,"default":5}}},"BlogFaqDto":{"type":"object","properties":{"question":{"type":"string","minLength":3,"maxLength":300},"answer":{"type":"string","minLength":3,"maxLength":3000}},"required":["question","answer"]},"UpdateBlogPostDto":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":160},"slug":{"type":"string","description":"Solo se puede cambiar mientras el post no es publico (409 si lo es)","example":"como-cobrar-la-loteria"},"excerpt":{"type":"string","minLength":3,"maxLength":500},"lead":{"type":"string","minLength":3,"maxLength":1000},"metaDescription":{"type":"string","minLength":3,"maxLength":300},"content":{"type":"string","description":"HTML del articulo; se sanea con la lista blanca del blog","maxLength":90000},"category":{"type":"string","enum":["noticias","guias","estadisticas","tecnologia","curiosidades","consejos"]},"tags":{"description":"Max 10, cada una de 1 a 60 caracteres","type":"array","items":{"type":"string"}},"faqs":{"description":"Max 10","type":"array","items":{"$ref":"#/components/schemas/BlogFaqDto"}},"publishedAt":{"type":"string","description":"Fecha de publicacion, ISO 8601 en UTC","example":"2026-10-20T08:00:00.000Z"}}},"ApproveBlogPostDto":{"type":"object","properties":{"publishedAt":{"type":"string","description":"Fecha de publicacion (ahora o futura), ISO 8601 en UTC","example":"2026-10-20T08:00:00.000Z"}}},"QueueItemInputDto":{"type":"object","properties":{"showcaseSiteId":{"type":"string","description":"ID de una plataforma activa (showcase_sites)","example":"507f1f77bcf86cd799439011"},"angle":{"type":"string","description":"Enfoque del post (opcional)","minLength":10,"maxLength":500},"publishAt":{"type":"string","description":"Fecha de publicacion, ISO 8601 en UTC; al menos 1 hora en el futuro","example":"2026-10-20T08:00:00.000Z"}},"required":["showcaseSiteId","publishAt"]},"CreateQueueItemsDto":{"type":"object","properties":{"items":{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/QueueItemInputDto"}}},"required":["items"]},"RetryQueueItemDto":{"type":"object","properties":{"publishAt":{"type":"string","description":"Nueva fecha de publicacion (ISO 8601 UTC, al menos 1 hora en el futuro)","example":"2026-10-20T08:00:00.000Z"}}},"NotificationResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Notification ID"},"type":{"type":"string","enum":["RESULT_AVAILABLE","DRAW_REMINDER","SUBSCRIPTION_CREATED","SUBSCRIPTION_EXPIRING","SUBSCRIPTION_RENEWED","SUBSCRIPTION_CANCELLED","PAYMENT_SUCCESS","PAYMENT_FAILED","TOKEN_LIMIT_WARNING","TOKEN_LIMIT_REACHED","ACCOUNT_SECURITY","SYSTEM_ANNOUNCEMENT","WEBHOOK_FAILURE"],"description":"Type of notification"},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH","URGENT"],"description":"Priority level"},"title":{"type":"string","description":"Notification title"},"message":{"type":"string","description":"Notification message"},"read":{"type":"boolean","description":"Whether the notification has been read"},"readAt":{"type":"string","description":"When the notification was read"},"data":{"type":"object","description":"Additional data specific to notification type"},"actionUrl":{"type":"string","description":"URL for the notification action"},"createdAt":{"type":"string","description":"When the notification was created"}},"required":["id","type","priority","title","message","read","createdAt"]},"NotificationListResponseDto":{"type":"object","properties":{"notifications":{"type":"array","items":{"$ref":"#/components/schemas/NotificationResponseDto"}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"totalPages":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["notifications","total","page","limit","totalPages","hasMore"]},"UnreadCountResponseDto":{"type":"object","properties":{"count":{"type":"number","description":"Total number of unread notifications"},"byPriority":{"type":"object","description":"Count by priority level"}},"required":["count","byPriority"]},"BulkOperationResponseDto":{"type":"object","properties":{"success":{"type":"boolean"},"modifiedCount":{"type":"number"},"message":{"type":"string"}},"required":["success","modifiedCount","message"]},"MarkSelectedAsReadDto":{"type":"object","properties":{"ids":{"description":"Notification IDs to mark as read","type":"array","items":{"type":"string"}}}},"ContactMessageDto":{"type":"object","properties":{"name":{"type":"string","example":"Ana Garcia"},"email":{"type":"string","example":"ana@example.com"},"subject":{"type":"string","example":"soporte"},"message":{"type":"string","example":"No consigo generar mi API key..."},"turnstileToken":{"type":"string","description":"Token de Cloudflare Turnstile (action \"contact\"). Opcional mientras TURNSTILE_ENFORCE=false; obligatorio cuando es true."}},"required":["name","email","subject","message"]},"CreateWebhookDto":{"type":"object","properties":{"url":{"type":"string","description":"HTTPS URL where webhook payloads will be sent","example":"https://tu-servidor.com/webhook"},"events":{"type":"array","description":"List of event types to subscribe to","example":["result.new","jackpot.milestone"],"items":{"type":"string","enum":["result.new","draw.upcoming","draw.imminent","jackpot.milestone"]}},"gameTypes":{"type":"array","description":"Filter events by game types. If not specified, you will receive events for all games.","example":["euromillones","primitiva"],"items":{"type":"string","enum":["euromillones","primitiva","bonoloto","gordo","nacional","eurodreams","quiniela","quinigol","lototurf","quintuple","quinto"]}},"description":{"type":"string","description":"Optional description to identify the webhook","example":"Webhook para resultados de produccion"}},"required":["url","events"]},"WebhookCreatedResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Webhook ID"},"url":{"type":"string","description":"Webhook URL"},"events":{"description":"Subscribed events","type":"array","items":{"type":"string"}},"gameTypes":{"description":"Game types filter (null = all games)","type":"array","items":{"type":"string"}},"isActive":{"type":"boolean","description":"Whether the webhook is active"},"description":{"type":"string","description":"Custom description"},"successCount":{"type":"number","description":"Number of successful deliveries"},"failureCount":{"type":"number","description":"Number of failed deliveries"},"lastTriggered":{"format":"date-time","type":"string","description":"Last triggered timestamp"},"lastSuccess":{"format":"date-time","type":"string","description":"Last successful delivery timestamp"},"lastFailure":{"format":"date-time","type":"string","description":"Last failed delivery timestamp"},"createdAt":{"format":"date-time","type":"string","description":"Creation timestamp"},"updatedAt":{"format":"date-time","type":"string","description":"Last update timestamp"},"secret":{"type":"string","description":"Secret key for signature verification (shown only once)","example":"whsec_abc123xyz..."}},"required":["id","url","events","isActive","successCount","failureCount","createdAt","updatedAt","secret"]},"WebhookResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Webhook ID"},"url":{"type":"string","description":"Webhook URL"},"events":{"description":"Subscribed events","type":"array","items":{"type":"string"}},"gameTypes":{"description":"Game types filter (null = all games)","type":"array","items":{"type":"string"}},"isActive":{"type":"boolean","description":"Whether the webhook is active"},"description":{"type":"string","description":"Custom description"},"successCount":{"type":"number","description":"Number of successful deliveries"},"failureCount":{"type":"number","description":"Number of failed deliveries"},"lastTriggered":{"format":"date-time","type":"string","description":"Last triggered timestamp"},"lastSuccess":{"format":"date-time","type":"string","description":"Last successful delivery timestamp"},"lastFailure":{"format":"date-time","type":"string","description":"Last failed delivery timestamp"},"createdAt":{"format":"date-time","type":"string","description":"Creation timestamp"},"updatedAt":{"format":"date-time","type":"string","description":"Last update timestamp"}},"required":["id","url","events","isActive","successCount","failureCount","createdAt","updatedAt"]},"WebhookListResponseDto":{"type":"object","properties":{"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/WebhookResponseDto"}},"total":{"type":"number","description":"Total count"}},"required":["webhooks","total"]},"WebhookStatsDto":{"type":"object","properties":{"total":{"type":"number","description":"Total webhooks"},"active":{"type":"number","description":"Active webhooks"},"totalSuccessful":{"type":"number","description":"Total successful deliveries"},"totalFailed":{"type":"number","description":"Total failed deliveries"},"successRate":{"type":"number","description":"Overall success rate (0-1)"}},"required":["total","active","totalSuccessful","totalFailed","successRate"]},"UpdateWebhookDto":{"type":"object","properties":{"url":{"type":"string","description":"HTTPS URL where webhook payloads will be sent","example":"https://tu-servidor.com/webhook"},"events":{"type":"array","description":"List of event types to subscribe to","example":["result.new","jackpot.milestone"],"items":{"type":"string","enum":["result.new","draw.upcoming","draw.imminent","jackpot.milestone"]}},"gameTypes":{"type":"array","description":"Filter events by game types. If not specified, you will receive events for all games.","example":["euromillones","primitiva"],"items":{"type":"string","enum":["euromillones","primitiva","bonoloto","gordo","nacional","eurodreams","quiniela","quinigol","lototurf","quintuple","quinto"]}},"isActive":{"type":"boolean","description":"Whether the webhook is active","example":true},"description":{"type":"string","description":"Optional description to identify the webhook","example":"Webhook para resultados de produccion"}}},"WebhookTestResultDto":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the test was successful"},"statusCode":{"type":"number","description":"HTTP status code returned"},"error":{"type":"string","description":"Error message if failed"},"duration":{"type":"number","description":"Response time in milliseconds"}},"required":["success","duration"]},"WebhookDeliveryResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Delivery ID"},"eventType":{"type":"string","description":"Event type"},"statusCode":{"type":"number","description":"HTTP status code"},"errorMessage":{"type":"string","description":"Error message if failed"},"attemptCount":{"type":"number","description":"Number of delivery attempts"},"deliveredAt":{"format":"date-time","type":"string","description":"Delivery timestamp if successful"},"createdAt":{"format":"date-time","type":"string","description":"Creation timestamp"}},"required":["id","eventType","attemptCount","createdAt"]},"WebhookDeliveryListResponseDto":{"type":"object","properties":{"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryResponseDto"}},"total":{"type":"number","description":"Total count"}},"required":["deliveries","total"]},"ImportShowcaseSitesDto":{"type":"object","properties":{"version":{"type":"number","example":1,"description":"Version del formato"},"sites":{"type":"array","items":{"type":"object"},"minItems":1,"maxItems":50,"description":"Fichas como las que devuelve GET /export. Se cruzan por slug: si existe se actualiza, si no se crea."}},"required":["version","sites"]},"CreateShowcaseSiteDto":{"type":"object","properties":{"name":{"type":"string","example":"TuDécimo","minLength":2,"maxLength":60},"slug":{"type":"string","example":"tudecimo","description":"Unico; [a-z0-9-]{2,60}"},"url":{"type":"string","example":"https://tudecimo.com","description":"https obligatorio, sin credenciales ni puerto"},"tagline":{"type":"string","minLength":10,"maxLength":140},"description":{"type":"string","minLength":80,"maxLength":2000,"description":"Que es y que hace; contexto de la IA"},"audience":{"type":"string","maxLength":300},"features":{"description":"Max 15, cada una 150","type":"array","items":{"type":"string"}},"linkRel":{"type":"string","enum":["follow","nofollow","sponsored"],"default":"follow"},"anchorTexts":{"description":"Max 8, cada una 80","type":"array","items":{"type":"string"}},"writingNotes":{"type":"string","maxLength":4000,"description":"Solo para la IA, nunca se muestra"},"isActive":{"type":"boolean","default":true}},"required":["name","slug","url","tagline","description"]},"UpdateShowcaseSiteDto":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":60},"slug":{"type":"string","description":"Unico; [a-z0-9-]{2,60}"},"url":{"type":"string","example":"https://tudecimo.com","description":"https obligatorio, sin credenciales ni puerto"},"tagline":{"type":"string","minLength":10,"maxLength":140},"description":{"type":"string","minLength":80,"maxLength":2000},"audience":{"type":"string","maxLength":300},"features":{"type":"array","items":{"type":"string"}},"linkRel":{"type":"string","enum":["follow","nofollow","sponsored"]},"anchorTexts":{"type":"array","items":{"type":"string"}},"writingNotes":{"type":"string","maxLength":4000},"isActive":{"type":"boolean"},"id":{"type":"string","readOnly":true,"description":"Se ignora"},"domain":{"type":"string","readOnly":true,"description":"Se ignora"},"logoUrl":{"type":"string","readOnly":true,"description":"Se ignora: el logo se cambia con POST/DELETE :id/logo"},"postsCount":{"type":"number","readOnly":true,"description":"Se ignora"},"createdAt":{"type":"string","readOnly":true,"description":"Se ignora"},"updatedAt":{"type":"string","readOnly":true,"description":"Se ignora"}}}}}}