From 4d057eebc2e31f55b08805dd8539d94c9de3b410 Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Wed, 1 Oct 2025 18:25:22 +0200 Subject: [PATCH 1/2] fix: include v6 urls for CORS --- sql/reports/challenges/submission-links.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/reports/challenges/submission-links.sql b/sql/reports/challenges/submission-links.sql index 76ac2e9..885a9fe 100644 --- a/sql/reports/challenges/submission-links.sql +++ b/sql/reports/challenges/submission-links.sql @@ -18,7 +18,7 @@ LEFT JOIN LEFT JOIN resources."ResourceRole" rr on res."roleId" = rr.id LEFT JOIN - resources."MemberProfile" mp on res."memberId" = mp."userId"::text + members."member" mp on res."memberId" = mp."userId"::text LEFT JOIN reviews."submission" sub on sub."memberId"=res."memberId" AND sub."challengeId"=c.id WHERE rr.name = 'Submitter' From 4bd281e46cfa6705c22b7236b207c97abb8e31f0 Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Wed, 1 Oct 2025 18:27:07 +0200 Subject: [PATCH 2/2] fix: lint --- src/app-constants.ts | 3 +- .../challenges-reports.controller.ts | 5 +- .../challenges/dtos/submission-links.dto.ts | 57 ++++++++++--------- 3 files changed, 37 insertions(+), 28 deletions(-) diff --git a/src/app-constants.ts b/src/app-constants.ts index 30f8a9c..9a7cd99 100644 --- a/src/app-constants.ts +++ b/src/app-constants.ts @@ -5,7 +5,8 @@ export const Scopes = { TopgearCancelledChallenge: "reports:topgear-cancelled-challenge", AllReports: "reports:all", TopgearChallengeTechnology: "reports:topgear-challenge-technology", - TopgearChallengeRegistrantDetails: "reports:topgear-challenge-registrant-details", + TopgearChallengeRegistrantDetails: + "reports:topgear-challenge-registrant-details", SFDC: { PaymentsReport: "reports:sfdc-payments", BA: "reports:sfdc-ba", diff --git a/src/reports/challenges/challenges-reports.controller.ts b/src/reports/challenges/challenges-reports.controller.ts index a4fc7db..f6f78fc 100644 --- a/src/reports/challenges/challenges-reports.controller.ts +++ b/src/reports/challenges/challenges-reports.controller.ts @@ -13,7 +13,10 @@ import { Scopes as AppScopes } from "../../app-constants"; import { ChallengesReportsService } from "./challenges-reports.service"; import { ChallengeRegistrantsQueryDto } from "./dtos/registrants.dto"; import { ChallengesReportQueryDto } from "./dtos/challenge.dto"; -import { SubmissionLinksDto, SubmissionLinksQueryDto } from "./dtos/submission-links.dto"; +import { + SubmissionLinksDto, + SubmissionLinksQueryDto, +} from "./dtos/submission-links.dto"; @ApiTags("Challenges Reports") @Controller("/challenges") diff --git a/src/reports/challenges/dtos/submission-links.dto.ts b/src/reports/challenges/dtos/submission-links.dto.ts index 55141a7..fb3f403 100644 --- a/src/reports/challenges/dtos/submission-links.dto.ts +++ b/src/reports/challenges/dtos/submission-links.dto.ts @@ -1,12 +1,15 @@ -import { ApiProperty } from '@nestjs/swagger'; -import { IsDateString, IsNotEmpty, IsOptional, IsString } from 'class-validator'; -import { ChallengeStatus } from './challenge-status.enum'; -import { Transform } from 'class-transformer'; -import { transformArray } from 'src/common/validation.util'; - +import { ApiProperty } from "@nestjs/swagger"; +import { + IsDateString, + IsNotEmpty, + IsOptional, + IsString, +} from "class-validator"; +import { ChallengeStatus } from "./challenge-status.enum"; +import { Transform } from "class-transformer"; +import { transformArray } from "src/common/validation.util"; export class SubmissionLinksQueryDto { - @ApiProperty({ required: true, description: "Filter by challenge completion date (from)", @@ -24,17 +27,17 @@ export class SubmissionLinksQueryDto { @IsDateString() completionDateTo?: Date; - @ApiProperty({ - required: false, - enum: ChallengeStatus, - example: [ChallengeStatus.COMPLETED], - isArray: true, - }) - @IsOptional() - @IsString({ each: true }) - @IsNotEmpty({ each: true }) - @Transform(transformArray) - challengeStatus?: ChallengeStatus[]; + @ApiProperty({ + required: false, + enum: ChallengeStatus, + example: [ChallengeStatus.COMPLETED], + isArray: true, + }) + @IsOptional() + @IsString({ each: true }) + @IsNotEmpty({ each: true }) + @Transform(transformArray) + challengeStatus?: ChallengeStatus[]; } export class SubmissionLinksDto { @@ -44,42 +47,44 @@ export class SubmissionLinksDto { challengeId: number; @ApiProperty({ - description: "Status of the challenge" + description: "Status of the challenge", }) challengeStatus: ChallengeStatus; @ApiProperty({ - description: "The date at which the challenge is completed" + description: "The date at which the challenge is completed", }) challengeCompletedDate: string | null; @ApiProperty({ - description: "The registration handle of the submitter" + description: "The registration handle of the submitter", }) registrantHandle: string; @ApiProperty({ - description: "The final score received by the registrant on that submission" + description: + "The final score received by the registrant on that submission", }) registrantFinalScore: number; @ApiProperty({ - description: "This denotes if the submission has passed. If the final score is greater than 98 then its considered pass" + description: + "This denotes if the submission has passed. If the final score is greater than 98 then its considered pass", }) didSubmissionPass: boolean; @ApiProperty({ - description: "The link to the submission url" + description: "The link to the submission url", }) submissionUrl: string; @ApiProperty({ - description: "Submission ID" + description: "Submission ID", }) submissionId: number; @ApiProperty({ - description: "Submission creation date" + description: "Submission creation date", }) submissionCreatedDate: string; }