@@ -39,7 +39,7 @@ public class Product extends BaseEntity {
3939 private List <OrderItem > orderItems = new ArrayList <>();
4040
4141 private Product (String name , ProductPrice price , Integer stock , Brand brand ) {
42- validateRequiredFields (name , price , stock );
42+ validateRequiredFields (name , price , stock , brand );
4343 this .name = name ;
4444 this .price = price ;
4545 this .stock = Stock .of (stock );
@@ -50,7 +50,7 @@ public static Product create(String name, Long price, Integer stock, Brand brand
5050 return new Product (name , ProductPrice .of (price ), stock , brand );
5151 }
5252
53- private void validateRequiredFields (String name , ProductPrice price , Integer stock ) {
53+ private void validateRequiredFields (String name , ProductPrice price , Integer stock , Brand brand ) {
5454 if (name == null || name .isBlank ()) {
5555 throw new CoreException (ErrorType .BAD_REQUEST , "상품명은 필수입니다." );
5656 }
@@ -60,6 +60,9 @@ private void validateRequiredFields(String name, ProductPrice price, Integer sto
6060 if (stock == null ) {
6161 throw new CoreException (ErrorType .BAD_REQUEST , "재고는 필수입니다." );
6262 }
63+ if (brand == null ) {
64+ throw new CoreException (ErrorType .BAD_REQUEST , "브랜드는 필수입니다." );
65+ }
6366 }
6467
6568 public void decreaseStock (Integer quantity ) {
0 commit comments