From c9f6d50cceb9fed5a297dc461c1984711b4d8599 Mon Sep 17 00:00:00 2001
From: Ted Wollman <25165500+TheTedder@users.noreply.github.com>
Date: Mon, 22 Jul 2024 16:02:32 -0400
Subject: [PATCH] Add Type to CreateCategoryRequest.
---
LeaderboardBackend.Test/Categories.cs | 4 +++-
LeaderboardBackend.Test/Runs.cs | 4 +++-
LeaderboardBackend/Models/Requests/CategoryRequests.cs | 3 +++
LeaderboardBackend/openapi.json | 6 +++++-
4 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/LeaderboardBackend.Test/Categories.cs b/LeaderboardBackend.Test/Categories.cs
index b95e31f1..59120f99 100644
--- a/LeaderboardBackend.Test/Categories.cs
+++ b/LeaderboardBackend.Test/Categories.cs
@@ -1,5 +1,6 @@
using System.Net;
using System.Threading.Tasks;
+using LeaderboardBackend.Models;
using LeaderboardBackend.Models.Entities;
using LeaderboardBackend.Models.Requests;
using LeaderboardBackend.Models.ViewModels;
@@ -74,7 +75,8 @@ public static async Task CreateCategory_GetCategory_OK()
Slug = "1_player",
LeaderboardId = createdLeaderboard.Id,
Info = null,
- SortDirection = SortDirection.Ascending
+ SortDirection = SortDirection.Ascending,
+ Type = RunType.Time
},
Jwt = _jwt
}
diff --git a/LeaderboardBackend.Test/Runs.cs b/LeaderboardBackend.Test/Runs.cs
index 3d988131..016c9f3e 100644
--- a/LeaderboardBackend.Test/Runs.cs
+++ b/LeaderboardBackend.Test/Runs.cs
@@ -1,5 +1,6 @@
using System;
using System.Threading.Tasks;
+using LeaderboardBackend.Models;
using LeaderboardBackend.Models.Entities;
using LeaderboardBackend.Models.Requests;
using LeaderboardBackend.Models.ViewModels;
@@ -57,7 +58,8 @@ public async Task SetUp()
Slug = "120_stars",
LeaderboardId = createdLeaderboard.Id,
Info = null,
- SortDirection = SortDirection.Ascending
+ SortDirection = SortDirection.Ascending,
+ Type = RunType.Time
},
Jwt = _jwt,
}
diff --git a/LeaderboardBackend/Models/Requests/CategoryRequests.cs b/LeaderboardBackend/Models/Requests/CategoryRequests.cs
index 0a4f644a..97573b51 100644
--- a/LeaderboardBackend/Models/Requests/CategoryRequests.cs
+++ b/LeaderboardBackend/Models/Requests/CategoryRequests.cs
@@ -34,4 +34,7 @@ public record CreateCategoryRequest
///
public required SortDirection SortDirection { get; set; }
+
+ ///
+ public required RunType Type { get; set; }
}
diff --git a/LeaderboardBackend/openapi.json b/LeaderboardBackend/openapi.json
index b8c9c689..01410866 100644
--- a/LeaderboardBackend/openapi.json
+++ b/LeaderboardBackend/openapi.json
@@ -976,7 +976,8 @@
"leaderboardId",
"name",
"slug",
- "sortDirection"
+ "sortDirection",
+ "type"
],
"type": "object",
"properties": {
@@ -1003,6 +1004,9 @@
},
"sortDirection": {
"$ref": "#/components/schemas/SortDirection"
+ },
+ "type": {
+ "$ref": "#/components/schemas/RunType"
}
},
"additionalProperties": false,