Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ public class IdeaMarketPriceDto {
@NotNull(message = "수량 설정은 필수입니다.")
@Min(value = 1, message = "수량은 최소 1개 이상이어야 합니다.")
private Long totalQuantity;

public void updateTotalQuantity(Long totalQuantity) {
this.totalQuantity = totalQuantity;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.brainpix.api.code.error.IdeaMarketErrorCode;
import com.brainpix.api.code.error.PostErrorCode;
import com.brainpix.api.exception.BrainPixException;
import com.brainpix.joining.dto.IdeaMarketPriceDto;
import com.brainpix.joining.entity.quantity.Price;
import com.brainpix.joining.repository.CollectionGatheringRepository;
import com.brainpix.joining.repository.RequestTaskPurchasingRepository;
Expand Down Expand Up @@ -58,9 +57,7 @@ public Long createIdeaMarket(Long userId, IdeaMarketCreateDto createDto) {

// IDEA_SOLUTION은 수량화가 불가능한 무형의 자산이므로 totalQuantity를 무한으로 설정
if (createDto.getIdeaMarketType().equals(IdeaMarketType.IDEA_SOLUTION)) {
IdeaMarketPriceDto ideaMarketPriceDto = new IdeaMarketPriceDto(createDto.getPriceDto().getPrice(),
(long)Integer.MAX_VALUE);
createDto = new IdeaMarketCreateDto(createDto.getIdeaMarketType(), ideaMarketPriceDto);
createDto.getPriceDto().updateTotalQuantity((long)Integer.MAX_VALUE);
}

Price price = priceService.createIdeaMarketPrice(createDto.getPriceDto());
Expand Down