Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

import konkuk.chacall.domain.foodtruck.domain.model.FoodTruckDocument;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Collection;
import java.util.List;

public interface FoodTruckDocumentRepository extends JpaRepository<FoodTruckDocument, Long> {
@Query("""
SELECT ftd
FROM FoodTruckDocument ftd
WHERE ftd.foodTruck.foodTruckId IN :foodTruckIds
""")
List<FoodTruckDocument> findAllInFoodTruckIds(List<Long> foodTruckIds);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
import konkuk.chacall.domain.foodtruck.domain.value.FoodTruckStatus;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Slice;
import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Optional;

public interface FoodTruckRepository extends JpaRepository<FoodTruck, Long>, FoodTruckSearchRepository {
Expand Down Expand Up @@ -46,4 +48,9 @@ boolean existsByFoodTruckIdAndOwnerIdAndFoodTruckStatus(

boolean existsByFoodTruckInfo_Name(String name);

@EntityGraph(attributePaths = {"owner"})
List<FoodTruck> findAllByFoodTruckStatus(FoodTruckStatus foodTruckStatus);

@EntityGraph(attributePaths = {"owner"})
List<FoodTruck> findAll();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package konkuk.chacall.domain.foodtruck.domain.value;

import com.fasterxml.jackson.annotation.JsonCreator;
import konkuk.chacall.global.common.exception.DomainRuleException;
import konkuk.chacall.global.common.exception.code.ErrorCode;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

Expand All @@ -11,4 +14,13 @@ public enum FoodTruckStatus {
REJECTED("승인 거부"); // 관리자가 승인을 거부한 상태

private final String description;

public static FoodTruckStatus from(String status) {
for (FoodTruckStatus foodTruckStatus : FoodTruckStatus.values()) {
if (foodTruckStatus.getDescription().equals(status)) {
return foodTruckStatus;
}
}
throw new DomainRuleException(ErrorCode.FOOD_TRUCK_STATUS_MISMATCH);
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package konkuk.chacall.domain.user.application;

import konkuk.chacall.domain.foodtruck.presentation.dto.response.FoodTruckResponse;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

사용되지 않는 import인지 확인하세요.

FoodTruckResponse import가 추가되었지만 이 파일에서 사용되지 않는 것으로 보입니다. 실제로 사용되지 않는다면 제거하는 것이 좋습니다.

다음 스크립트로 사용 여부를 확인하세요:


🏁 Script executed:

#!/bin/bash
# FoodTruckResponse가 UserService.java에서 실제로 사용되는지 확인
rg -n "FoodTruckResponse" src/main/java/konkuk/chacall/domain/user/application/UserService.java

Length of output: 85


사용되지 않는 import 제거 필요

검증 결과 FoodTruckResponse는 파일 내에서 import 문 외에 다른 곳에서 사용되지 않습니다. 3번 줄의 import 문을 제거하세요.

import konkuk.chacall.domain.foodtruck.presentation.dto.response.FoodTruckResponse;
🤖 Prompt for AI Agents
In src/main/java/konkuk/chacall/domain/user/application/UserService.java around
line 3, remove the unused import "import
konkuk.chacall.domain.foodtruck.presentation.dto.response.FoodTruckResponse;" —
delete that import line so the file no longer contains an unused dependency and
then run a quick build or IDE organize imports to ensure no other unused imports
remain.

import konkuk.chacall.domain.user.application.admin.AdminService;
import konkuk.chacall.domain.user.application.validator.AdminValidator;
import konkuk.chacall.domain.user.presentation.dto.request.ApproveFoodTruckStatusRequest;
import konkuk.chacall.domain.user.domain.model.User;
import konkuk.chacall.domain.user.domain.repository.UserRepository;
import konkuk.chacall.domain.user.presentation.dto.request.UpdateUserInfoRequest;
import konkuk.chacall.domain.user.presentation.dto.response.FoodTruckForAdminResponse;
import konkuk.chacall.domain.user.presentation.dto.response.UserResponse;
import konkuk.chacall.global.common.exception.EntityNotFoundException;
import konkuk.chacall.global.common.exception.code.ErrorCode;
Expand All @@ -17,6 +19,8 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
Expand Down Expand Up @@ -62,4 +66,10 @@ public ImageResponse createUserImagePresignedUrl(Long userId, ImageRequest reque
KeyUtils::buildUserProfileImageKey
);
}

public List<FoodTruckForAdminResponse> getAllFoodTrucks(Long userId, String status) {
adminValidator.validateAdmin(userId);

return adminService.getAllFoodTrucks(status);
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
package konkuk.chacall.domain.user.application.admin;

import konkuk.chacall.domain.foodtruck.domain.model.FoodTruck;
import konkuk.chacall.domain.foodtruck.domain.model.FoodTruckDocument;
import konkuk.chacall.domain.foodtruck.domain.repository.FoodTruckDocumentRepository;
import konkuk.chacall.domain.foodtruck.domain.repository.FoodTruckRepository;
import konkuk.chacall.domain.foodtruck.domain.value.FoodTruckStatus;
import konkuk.chacall.domain.user.presentation.dto.request.ApproveFoodTruckStatusRequest;
import konkuk.chacall.domain.user.presentation.dto.response.FoodTruckForAdminResponse;
import konkuk.chacall.global.common.exception.EntityNotFoundException;
import konkuk.chacall.global.common.exception.code.ErrorCode;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@Service
@RequiredArgsConstructor
public class AdminService {

private final FoodTruckRepository foodTruckRepository;
private final FoodTruckDocumentRepository foodTruckDocumentRepository;

public void approveFoodTruckStatus(Long foodTruckId, ApproveFoodTruckStatusRequest request) {
FoodTruck foodTruck = foodTruckRepository.findById(foodTruckId)
Expand All @@ -21,4 +30,34 @@ public void approveFoodTruckStatus(Long foodTruckId, ApproveFoodTruckStatusReque
foodTruck.approveFoodTruck(request.status());
}

public List<FoodTruckForAdminResponse> getAllFoodTrucks(String status) {
List<FoodTruck> foodTruckList;

if(status != null && !status.isEmpty()) {
FoodTruckStatus foodTruckStatus = FoodTruckStatus.from(status);
foodTruckList = foodTruckRepository.findAllByFoodTruckStatus(foodTruckStatus);
} else {
foodTruckList = foodTruckRepository.findAll();
}
Comment on lines +36 to +41
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

문자열 검증 로직을 개선하세요.

isEmpty() 대신 isBlank()를 사용하여 공백 문자열도 처리하는 것이 더 안전합니다.

-if(status != null && !status.isEmpty()) {
+if(status != null && !status.isBlank()) {
     FoodTruckStatus foodTruckStatus = FoodTruckStatus.from(status);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if(status != null && !status.isEmpty()) {
FoodTruckStatus foodTruckStatus = FoodTruckStatus.from(status);
foodTruckList = foodTruckRepository.findAllByFoodTruckStatus(foodTruckStatus);
} else {
foodTruckList = foodTruckRepository.findAll();
}
if(status != null && !status.isBlank()) {
FoodTruckStatus foodTruckStatus = FoodTruckStatus.from(status);
foodTruckList = foodTruckRepository.findAllByFoodTruckStatus(foodTruckStatus);
} else {
foodTruckList = foodTruckRepository.findAll();
}
🤖 Prompt for AI Agents
In src/main/java/konkuk/chacall/domain/user/application/admin/AdminService.java
around lines 36 to 41, the string validation uses status != null &&
!status.isEmpty(), which misses pure-whitespace values; change the condition to
status != null && !status.isBlank() so blank strings are treated as empty,
ensuring you use Java 11+ (or an equivalent utility) and update any unit tests
or callers if necessary.


Map<Long, List<FoodTruckDocument>> documentMap = foodTruckDocumentRepository.findAllInFoodTruckIds(
foodTruckList.stream()
.map(FoodTruck::getFoodTruckId)
.toList()
).stream()
.collect(
Collectors.groupingBy(document -> document.getFoodTruck().getFoodTruckId())
);
Comment on lines +43 to +50
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stream 으로 처리를 깔끔하게 잘 하신 것 같습니다! 좋아요

다만 한가지 궁금한 점은, 지금 특정 푸드트럭에 대한 푸드트럭 서류를 조회하기 위해 별도의 쿼리를 날리는 상황이라고 이해되는데, 현재 운영자 - 푸드트럭 조회 로직에서는 페이징이 구현이 되어있지 않은 상황인 것 같습니다.
만약 페이징 로직이 존재하지 않고 모든 푸드트럭을 한 번에 반환하는 구조라면, FoodTruck 테이블을 조회하는 시점에 FoodTruckDocument 테이블까지 한 번에 조회해서 fetch join 으로 2번이 아닌 1번의 쿼리 만으로도 데이터를 조회해올 수 있을 것 같은데, 이 부분에 대한 현준님의 의견이 궁금합니다!

만약 페이징이 존재한다면 FoodTruck <-> FoodTruckDocument 가 OneToMany 관계를 갖고 있어서 fetch join 이 불가하지만, 현재처럼 페이징이 존재하지 않는다면 fetch join 이 가능할 것 같아서 여쭤봅니당

Copy link
Contributor Author

@buzz0331 buzz0331 Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

상균님 말씀이 FoodTruck 엔티티에 OneToMany로 List<FoodTruckDocument> 양방향 연관관계를 걸자는 말씀 맞나요??

그게 맞다면, 그렇게 진행하는게 더 좋을 것 같긴하네요!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 지금 양방향이 안걸려있구나.. 그럼 좀 애매하긴 하네요.
일단 다른 엔티티들도 다 양방향 안걸린 상태로 유지중이니까 통일성 맞추도록 현재 구조로 가도 좋을 것 같습니다.
사실상 성능 차이는 거의 없다고 봐도 될 것 같아서요!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네넵 그러면 일단 현재 코드 유지하고 머지하겠습니다~



return foodTruckList.stream()
.map(foodTruck -> FoodTruckForAdminResponse.from(
foodTruck,
documentMap.getOrDefault(foodTruck.getFoodTruckId(), List.of()).stream()
.map(FoodTruckDocument::getDocumentUrl)
.collect(Collectors.toList())
)
)
.collect(Collectors.toList());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import konkuk.chacall.domain.user.presentation.dto.request.ApproveFoodTruckStatusRequest;
import konkuk.chacall.domain.user.application.UserService;
import konkuk.chacall.domain.user.presentation.dto.request.UpdateUserInfoRequest;
import konkuk.chacall.domain.user.presentation.dto.response.FoodTruckForAdminResponse;
import konkuk.chacall.domain.user.presentation.dto.response.UserResponse;
import konkuk.chacall.global.common.annotation.ExceptionDescription;
import konkuk.chacall.global.common.annotation.UserId;
Expand All @@ -17,6 +18,8 @@
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Tag(name = "User API", description = "전체 사용자(마이페이지) 관련 API")
@RestController
@RequestMapping("/users")
Expand Down Expand Up @@ -53,7 +56,7 @@ public BaseResponse<Void> updateUserInfo(
}

@Operation(
summary = "푸드트럭 승인 상태 변경",
summary = "[운영자용] 푸드트럭 승인 상태 변경",
description = "운영자 - 푸드트럭 승인 상태를 변경합니다."
)
@ExceptionDescription(SwaggerResponseDescription.APPROVE_FOOD_TRUCK_STATUS)
Expand All @@ -79,4 +82,18 @@ public BaseResponse<ImageResponse> getProfilePresignedUrl(
) {
return BaseResponse.ok(userService.createUserImagePresignedUrl(userId, request));
}

@Operation(
summary = "[운영자용] 서비스내에 모든 푸드트럭 조회",
description = "운영자 - 서비스내에 모든 푸드트럭을 조회합니다."
)
@ExceptionDescription(SwaggerResponseDescription.GET_ALL_FOOD_TRUCKS)
@GetMapping("/admin/food-trucks")
public BaseResponse<List<FoodTruckForAdminResponse>> getAllFoodTrucks (
@Parameter(hidden = true) @UserId final Long userId,
@Parameter(description = "푸드트럭 승인 상태 필터링 (APPROVED, PENDING, REJECTED) / 안 보낼 경우 전체", example = "APPROVED")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

지금 와프상으로는 승인 상태 기반 필터링이 존재하지는 않는 상황인 것 같습니다. 이 부분은 확장을 여지에 둔 구현이라고 생각하면 될까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 저는 관리자 입장에서 푸드트럭 승인 상태 정도는 필터링이 필요하다고 생각했습니다. 이 부분은 구현 후에 디자인/기획 측에 말씀드려야 할 것 같아요!

@RequestParam(required = false) final String status
) {
return BaseResponse.ok(userService.getAllFoodTrucks(userId, status));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package konkuk.chacall.domain.user.presentation.dto.response;

import io.swagger.v3.oas.annotations.media.Schema;
import konkuk.chacall.domain.foodtruck.domain.model.FoodTruck;

import java.util.List;

public record FoodTruckForAdminResponse(
@Schema(description = "푸드트럭 ID", example = "1")
Long foodTruckId,
@Schema(description = "푸드트럭 이름", example = "차콜 푸드트럭")
String foodTruckName,
@Schema(description = "푸드트럭 사장님 이름", example = "홍길동")
String ownerName,
@Schema(description = "푸드트럭 상태", example = "승인 대기")
String foodTruckStatus,
@Schema(description = "푸드트럭 서류 URL 목록 (사업자 등록증 포함)", example = "[\"https://cdn.chacall.com/foodtrucks/osori/doc1.jpg\", \"https://cdn.chacall.com/foodtrucks/osori/doc2.jpg\", \"https://cdn.chacall.com/foodtrucks/osori/doc3.jpg\", \"https://cdn.chacall.com/foodtrucks/osori/doc4.jpg\", \"https://cdn.chacall.com/foodtrucks/osori/doc5.jpg\"]")
List<String> foodTruckDocumentUrls
) {
public static FoodTruckForAdminResponse from(FoodTruck foodTruck, List<String> foodTruckDocumentUrls) {
return new FoodTruckForAdminResponse(
foodTruck.getFoodTruckId(),
foodTruck.getFoodTruckInfo().getName(),
foodTruck.getOwner().getName(),
foodTruck.getFoodTruckStatus().getDescription(),
foodTruckDocumentUrls
);
}
Comment on lines +20 to +28
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

팩토리 메서드에 null 안전성 검증을 추가하세요.

현재 구현은 여러 지점에서 NullPointerException 위험이 있습니다:

  • foodTruck 파라미터 자체
  • foodTruck.getFoodTruckInfo() 반환값
  • foodTruck.getOwner() 반환값
  • foodTruck.getFoodTruckStatus() 반환값
  • foodTruckDocumentUrls 파라미터

관리자 승인 워크플로우에서 사용되는 코드이므로 런타임 안정성이 중요합니다.

다음과 같이 방어적 null 체크를 추가하는 것을 권장합니다:

 public static FoodTruckForAdminResponse from(FoodTruck foodTruck, List<String> foodTruckDocumentUrls) {
+    if (foodTruck == null) {
+        throw new IllegalArgumentException("foodTruck cannot be null");
+    }
+    if (foodTruck.getFoodTruckInfo() == null || foodTruck.getOwner() == null || foodTruck.getFoodTruckStatus() == null) {
+        throw new IllegalStateException("FoodTruck has null required fields");
+    }
     return new FoodTruckForAdminResponse(
             foodTruck.getFoodTruckId(),
             foodTruck.getFoodTruckInfo().getName(),
             foodTruck.getOwner().getName(),
             foodTruck.getFoodTruckStatus().getDescription(),
-            foodTruckDocumentUrls
+            foodTruckDocumentUrls == null ? List.of() : foodTruckDocumentUrls
     );
 }

또는, 도메인 모델이 null을 반환하지 않는다는 것이 보장된다면, 다음 스크립트로 FoodTruck 엔티티의 null 안전성 보장을 확인해주세요:


🏁 Script executed:

#!/bin/bash
# FoodTruck 엔티티와 관련 메서드의 null 안전성 확인

# FoodTruck 엔티티에서 @NotNull/@NonNull 어노테이션 확인
echo "=== FoodTruck 엔티티의 null 안전성 어노테이션 확인 ==="
fd -e java -x rg -n -A 2 -B 2 'class FoodTruck' {} \; | head -30

# getFoodTruckInfo, getOwner, getFoodTruckStatus 메서드 시그니처 확인
echo -e "\n=== getter 메서드 시그니처 확인 ==="
ast-grep --pattern $'getFoodTruckInfo() {
  $$$
}'

ast-grep --pattern $'getOwner() {
  $$$
}'

ast-grep --pattern $'getFoodTruckStatus() {
  $$$
}'

Length of output: 940



---

🏁 Script executed:

```shell
#!/bin/bash
# Find FoodTruck entity file
echo "=== FoodTruck 엔티티 파일 위치 찾기 ==="
fd -e java "FoodTruck.java" -type f

# Show full FoodTruck entity class definition
echo -e "\n=== FoodTruck 엔티티 전체 정의 ==="
fd -e java "FoodTruck.java" -type f -exec cat {} \;

# Check FoodTruckInfo, Owner, FoodTruckStatus for null annotations
echo -e "\n=== 관련 엔티티 파일 찾기 ==="
fd -e java -type f | xargs rg -l "class FoodTruckInfo|class.*Owner|class FoodTruckStatus" | head -10

Length of output: 1112


🏁 Script executed:

#!/bin/bash
# Find FoodTruck.java without type filter issues
echo "=== FoodTruck.java 파일 찾기 ==="
find . -name "FoodTruck.java" 2>/dev/null

# Show content of FoodTruck entity
echo -e "\n=== FoodTruck 엔티티 정의 ==="
find . -name "FoodTruck.java" -exec cat {} \; 2>/dev/null

# Find FoodTruckInfo entity
echo -e "\n=== FoodTruckInfo 엔티티 정의 ==="
find . -name "FoodTruckInfo.java" -exec cat {} \; 2>/dev/null

# Search for Owner entity
echo -e "\n=== Owner 엔티티 찾기 ==="
find . -path "*/domain/owner/domain/*.java" -name "*.java" | grep -i "owner" | head -5
find . -path "*/domain/owner/domain/*.java" -exec grep -l "class.*Owner.*Entity\|@Entity.*class.*Owner" {} \; 2>/dev/null | head -3

Length of output: 8365


팩토리 메서드에 null 안전성 검증을 추가하세요.

도메인 모델 분석 결과 다음 지점에서 NullPointerException 위험이 있습니다:

  • foodTruckInfo: @Embedded 필드이며 null-safety 어노테이션 없음 → getFoodTruckInfo().getName() 호출 시 NPE 위험
  • owner: @JoinColumn(nullable = false) DB 제약만 있고 @NotNull 어노테이션 없음 → 런타임 검증 필요
  • foodTruckStatus: @Column(nullable = false) DB 제약만 있고 @NotNull 어노테이션 없음 → 런타임 검증 필요

관리자 승인 워크플로우의 중요한 메서드이므로 방어적 검증이 필수입니다.

다음과 같이 수정하세요:

 public static FoodTruckForAdminResponse from(FoodTruck foodTruck, List<String> foodTruckDocumentUrls) {
+    Objects.requireNonNull(foodTruck, "foodTruck cannot be null");
+    Objects.requireNonNull(foodTruck.getFoodTruckInfo(), "foodTruckInfo cannot be null");
+    Objects.requireNonNull(foodTruck.getOwner(), "owner cannot be null");
+    Objects.requireNonNull(foodTruck.getFoodTruckStatus(), "foodTruckStatus cannot be null");
+    
     return new FoodTruckForAdminResponse(
             foodTruck.getFoodTruckId(),
             foodTruck.getFoodTruckInfo().getName(),
             foodTruck.getOwner().getName(),
             foodTruck.getFoodTruckStatus().getDescription(),
-            foodTruckDocumentUrls
+            foodTruckDocumentUrls != null ? foodTruckDocumentUrls : Collections.emptyList()
     );
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public static FoodTruckForAdminResponse from(FoodTruck foodTruck, List<String> foodTruckDocumentUrls) {
return new FoodTruckForAdminResponse(
foodTruck.getFoodTruckId(),
foodTruck.getFoodTruckInfo().getName(),
foodTruck.getOwner().getName(),
foodTruck.getFoodTruckStatus().getDescription(),
foodTruckDocumentUrls
);
}
public static FoodTruckForAdminResponse from(FoodTruck foodTruck, List<String> foodTruckDocumentUrls) {
Objects.requireNonNull(foodTruck, "foodTruck cannot be null");
Objects.requireNonNull(foodTruck.getFoodTruckInfo(), "foodTruckInfo cannot be null");
Objects.requireNonNull(foodTruck.getOwner(), "owner cannot be null");
Objects.requireNonNull(foodTruck.getFoodTruckStatus(), "foodTruckStatus cannot be null");
return new FoodTruckForAdminResponse(
foodTruck.getFoodTruckId(),
foodTruck.getFoodTruckInfo().getName(),
foodTruck.getOwner().getName(),
foodTruck.getFoodTruckStatus().getDescription(),
foodTruckDocumentUrls != null ? foodTruckDocumentUrls : Collections.emptyList()
);
}
🤖 Prompt for AI Agents
In
src/main/java/konkuk/chacall/domain/user/presentation/dto/response/FoodTruckForAdminResponse.java
around lines 20 to 28, the factory method should defensively validate inputs to
avoid NullPointerException when accessing nested fields; add null checks for
foodTruck and for foodTruck.getFoodTruckInfo(), foodTruck.getOwner(), and
foodTruck.getFoodTruckStatus() before dereferencing them (and optionally for
foodTruckDocumentUrls), and if any are null throw a clear
IllegalArgumentException (or use Objects.requireNonNull with descriptive
messages) so the method fails fast with an informative error rather than NPE at
runtime.

}
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public enum ErrorCode implements ResponseCode {
AVAILABLE_QUANTITY_MISMATCH(HttpStatus.BAD_REQUEST, 110007, "제조 가능 수량 값이 올바르지 않습니다."),
NEED_ELECTRICITY_MISMATCH(HttpStatus.BAD_REQUEST, 110008, "전기 사용 여부 값이 올바르지 않습니다."),
PAYMENT_METHOD_MISMATCH(HttpStatus.BAD_REQUEST, 110009, "결제 수단 값이 올바르지 않습니다."),
FOOD_TRUCK_STATUS_MISMATCH(HttpStatus.BAD_REQUEST, 110010, "푸드트럭 상태 값이 올바르지 않습니다."),

/**
* Image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ public enum SwaggerResponseDescription {
FOOD_TRUCK_NOT_FOUND,
FOOD_TRUCK_NOT_OWNED
))),
GET_ALL_FOOD_TRUCKS(new LinkedHashSet<>(Set.of(
USER_NOT_FOUND,
USER_FORBIDDEN
))),

// Default
DEFAULT(new LinkedHashSet<>())
Expand Down