Skip to content

Commit

Permalink
[#177] refactor(Performance): 티켓 가격 업데이트 메서드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hoonyworld committed Aug 21, 2024
1 parent fc5af1a commit c4edfc9
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.beat.domain.performance.domain;

import com.beat.domain.BaseTimeEntity;
import com.beat.domain.performance.exception.PerformanceErrorCode;
import com.beat.domain.promotion.domain.Promotion;
import com.beat.domain.user.domain.Users;
import com.beat.global.common.exception.BadRequestException;
import jakarta.persistence.*;
import lombok.AccessLevel;
import lombok.Builder;
Expand Down Expand Up @@ -143,4 +145,11 @@ public void update(
this.performancePeriod = performancePeriod;
this.totalScheduleCount = totalScheduleCount;
}

public void updateTicketPrice(int newTicketPrice) {
if (newTicketPrice < 0) {
throw new BadRequestException(PerformanceErrorCode.NEGATIVE_TICKET_PRICE);
}
this.ticketPrice = newTicketPrice;
}
}

0 comments on commit c4edfc9

Please sign in to comment.