wip league admin tools

This commit is contained in:
2025-12-28 12:04:12 +01:00
parent 5dc8c2399c
commit 6edf12fda8
401 changed files with 15365 additions and 6047 deletions

View File

@@ -162,7 +162,7 @@ describe('ProtestService', () => {
const input = {
protestId: 'protest-123',
stewardId: 'steward-456',
decision: 'upheld',
decision: 'uphold',
decisionNotes: 'Test notes',
};
@@ -170,10 +170,7 @@ describe('ProtestService', () => {
await service.reviewProtest(input);
expect(mockApiClient.reviewProtest).toHaveBeenCalledWith({
...input,
enum: 'uphold',
});
expect(mockApiClient.reviewProtest).toHaveBeenCalledWith(input);
});
});

View File

@@ -84,15 +84,13 @@ export class ProtestService {
* Review protest
*/
async reviewProtest(input: { protestId: string; stewardId: string; decision: string; decisionNotes: string }): Promise<void> {
const normalizedDecision = input.decision.toLowerCase();
const enumValue: ReviewProtestCommandDTO['enum'] =
normalizedDecision === 'uphold' || normalizedDecision === 'upheld' ? 'uphold' : 'dismiss';
const normalizedDecision =
input.decision.toLowerCase() === 'upheld' ? 'uphold' : input.decision.toLowerCase();
const command: ReviewProtestCommandDTO = {
protestId: input.protestId,
stewardId: input.stewardId,
enum: enumValue,
decision: input.decision,
decision: normalizedDecision,
decisionNotes: input.decisionNotes,
};