-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update based on review AB#6356
- Loading branch information
Showing
14 changed files
with
62 additions
and
53 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
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
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
4 changes: 2 additions & 2 deletions
4
...vice/src/api/event/dto/event-pcode.dto.ts → ...src/api/event/dto/event-place-code.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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { IsNotEmpty, IsNumber } from 'class-validator'; | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
|
||
export class EventPcodeDto { | ||
export class EventPlaceCodeDto { | ||
@ApiProperty() | ||
@IsNotEmpty() | ||
@IsNumber() | ||
public eventPcodeId: number; | ||
public eventPlacecodeId: number; | ||
} |
6 changes: 3 additions & 3 deletions
6
...rvice/src/api/event/event-pcode.entity.ts → .../src/api/event/event-place-code.entity.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
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 |
---|---|---|
@@ -1,25 +1,27 @@ | ||
/* eslint-disable @typescript-eslint/camelcase */ | ||
import { EventPcodeEntity } from './event-pcode.entity'; | ||
import { EventPlaceCodeEntity } from './event-place-code.entity'; | ||
import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; | ||
import { EventPcodeDto } from './dto/event-pcode.dto'; | ||
import { EventPlaceCodeDto } from './dto/event-place-code.dto'; | ||
import { Repository } from 'typeorm'; | ||
import { InjectRepository } from '@nestjs/typeorm'; | ||
|
||
@Injectable() | ||
export class EventService { | ||
@InjectRepository(EventPcodeEntity) | ||
private readonly eventPcodeRepo: Repository<EventPcodeEntity>; | ||
@InjectRepository(EventPlaceCodeEntity) | ||
private readonly eventPlaceCodeRepo: Repository<EventPlaceCodeEntity>; | ||
|
||
public async closeEventPcode(eventPcodeDto: EventPcodeDto): Promise<void> { | ||
const eventPcode = await this.eventPcodeRepo.findOne( | ||
eventPcodeDto.eventPcodeId, | ||
public async closeEventPcode( | ||
eventPlaceCodeDto: EventPlaceCodeDto, | ||
): Promise<void> { | ||
const eventPlaceCode = await this.eventPlaceCodeRepo.findOne( | ||
eventPlaceCodeDto.eventPlacecodeId, | ||
); | ||
if (!eventPcode) { | ||
if (!eventPlaceCode) { | ||
const errors = 'Event Pcode not found'; | ||
throw new HttpException({ errors }, HttpStatus.NOT_FOUND); | ||
} | ||
eventPcode.closed = true; | ||
eventPcode.manual_closed_date = new Date(); | ||
await this.eventPcodeRepo.save(eventPcode); | ||
eventPlaceCode.closed = true; | ||
eventPlaceCode.manual_closed_date = new Date(); | ||
await this.eventPlaceCodeRepo.save(eventPlaceCode); | ||
} | ||
} |
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