Skip to content

Commit

Permalink
feat: event 입금기한
Browse files Browse the repository at this point in the history
  • Loading branch information
ssoxong committed May 1, 2024
1 parent de20650 commit c5bc91e
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 4 deletions.
12 changes: 12 additions & 0 deletions src/event/dto/create-event.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ export class CreateEventDto {
})
endDate: Date;

@ApiProperty({
description: '이벤트 입금 시작일',
example: new Date().toISOString(),
})
transactionStartDate: Date;

@ApiProperty({
description: '이벤트 입금 마감일',
example: new Date(),
})
transactionEndDate: Date;

@ApiProperty({
description: '이벤트 참가비',
example: 10000,
Expand Down
2 changes: 2 additions & 0 deletions src/event/entities/event.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export class Event {
description: string;
startDate: Date;
endDate: Date;
transactionStartDate: Date;
transactionEndDate: Date;
fee: number;
attendees: string[];
}
2 changes: 2 additions & 0 deletions src/event/interfaces/event.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export interface EventInterface extends Document {
description: string;
startDate: Date;
endDate: Date;
transactionStartDate: Date;
transactionEndDate: Date;
fee: number;
attendees: string[];
}
2 changes: 2 additions & 0 deletions src/event/schemas/event.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export const EventSchema = new Schema({
description: String,
startDate: Date,
endDate: Date,
transactionStartDate: Date,
transactionEndDate: Date,
fee: Number,
attendees: { type: [String], default: [] },
});
4 changes: 2 additions & 2 deletions src/group/group.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ export class GroupService {
//eventId로 eventTransaction 정보 가져오기
const event = await this.eventService.getOne(eventId);
// startTransactionDate, endTransactionDate로 변경 필요
const eventStart = event.startDate;
const eventEnd = event.endDate;
const eventStart = event.transactionStartDate;
const eventEnd = event.transactionEndDate;

return this.transactionService.getTransactionsByPeriod(
groupId,
Expand Down
4 changes: 2 additions & 2 deletions src/transaction/transaction.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export class TransactionRepository {
.find({
'metadata.groupId': groupId,
timestamp: {
$gte: new Date(startDate),
$lt: new Date(endDate),
$gte: new Date(startDate).toISOString(),
$lt: new Date(endDate).toISOString(),
},
})
.exec();
Expand Down

0 comments on commit c5bc91e

Please sign in to comment.