-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 4300/publish-lottery-bug
- Loading branch information
Showing
20 changed files
with
547 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
-- CreateTable | ||
CREATE TABLE "application_lottery_totals" ( | ||
"id" UUID NOT NULL DEFAULT uuid_generate_v4(), | ||
"total" INTEGER NOT NULL, | ||
"listing_id" UUID NOT NULL, | ||
"multiselect_question_id" UUID, | ||
|
||
CONSTRAINT "application_lottery_totals_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "application_lottery_totals_listing_id_idx" ON "application_lottery_totals"("listing_id"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "application_lottery_totals" ADD CONSTRAINT "application_lottery_totals_listing_id_fkey" FOREIGN KEY ("listing_id") REFERENCES "listings"("id") ON DELETE CASCADE ON UPDATE NO ACTION; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "application_lottery_totals" ADD CONSTRAINT "application_lottery_totals_multiselect_question_id_fkey" FOREIGN KEY ("multiselect_question_id") REFERENCES "multiselect_questions"("id") ON DELETE NO ACTION ON UPDATE NO ACTION; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
api/src/dtos/applications/application-lottery-total.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; | ||
import { Expose } from 'class-transformer'; | ||
import { | ||
IsDefined, | ||
IsNumber, | ||
IsOptional, | ||
IsString, | ||
IsUUID, | ||
} from 'class-validator'; | ||
import { ValidationsGroupsEnum } from '../../enums/shared/validation-groups-enum'; | ||
|
||
export class ApplicationLotteryTotal { | ||
@Expose() | ||
@IsString({ groups: [ValidationsGroupsEnum.default] }) | ||
@IsUUID(4, { groups: [ValidationsGroupsEnum.default] }) | ||
@IsDefined({ groups: [ValidationsGroupsEnum.default] }) | ||
@ApiProperty() | ||
listingId: string; | ||
|
||
@Expose() | ||
@IsString({ groups: [ValidationsGroupsEnum.default] }) | ||
@IsUUID(4, { groups: [ValidationsGroupsEnum.default] }) | ||
@IsOptional({ groups: [ValidationsGroupsEnum.default] }) | ||
@ApiPropertyOptional() | ||
multiselectQuestionId?: string; | ||
|
||
@Expose() | ||
@IsNumber({}, { groups: [ValidationsGroupsEnum.default] }) | ||
@IsDefined({ groups: [ValidationsGroupsEnum.default] }) | ||
@ApiProperty() | ||
total: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; | ||
import { Expose } from 'class-transformer'; | ||
import { IsDefined, IsNumber, IsOptional, IsUUID } from 'class-validator'; | ||
import { ValidationsGroupsEnum } from '../../enums/shared/validation-groups-enum'; | ||
|
||
export class PublicLotteryTotal { | ||
@Expose() | ||
@IsNumber({}, { groups: [ValidationsGroupsEnum.default] }) | ||
@ApiProperty() | ||
@IsDefined({ groups: [ValidationsGroupsEnum.default] }) | ||
total: number; | ||
|
||
@Expose() | ||
@ApiPropertyOptional() | ||
@IsOptional({ groups: [ValidationsGroupsEnum.default] }) | ||
@IsUUID(4, { groups: [ValidationsGroupsEnum.default] }) | ||
multiselectQuestionId?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.