-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat : mealDelivery 도메인 orderType 추가
- 배송목록 조회시에 배송목록 한개당 orderType의 조회를 위해 APi 요청을 1개씩 또 보내야하는 이슈 -> 비정규화 진행
- Loading branch information
1 parent
24f906d
commit 9d97b06
Showing
23 changed files
with
271 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
public enum DeliveryState { | ||
PENDING, | ||
DELIVERY_REQUESTED, | ||
DELIVERING, | ||
DELIVERED | ||
} |
37 changes: 28 additions & 9 deletions
37
domain/src/main/java/core/startup/mealtoktok/domain/mealdelivery/MealDelivery.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
domain/src/main/java/core/startup/mealtoktok/domain/mealdelivery/OrderTypeForDelivery.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package core.startup.mealtoktok.domain.mealdelivery; | ||
|
||
public enum OrderTypeForDelivery { | ||
IMMEDIATE, | ||
SCHEDULED | ||
} |
10 changes: 10 additions & 0 deletions
10
...va/core/startup/mealtoktok/domain/mealdelivery/exception/MealDeliveryDomainException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package core.startup.mealtoktok.domain.mealdelivery.exception; | ||
|
||
import core.startup.mealtoktok.common.exception.DomainException; | ||
|
||
public class MealDeliveryDomainException extends DomainException { | ||
|
||
public MealDeliveryDomainException(String message) { | ||
super(MealDeliveryErrorCode.MEAL_DELIVERY_DOMAIN_ERROR.setMessage(message)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
domain/src/main/java/core/startup/mealtoktok/domain/order/OrderType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
package core.startup.mealtoktok.domain.order; | ||
|
||
import core.startup.mealtoktok.domain.mealdelivery.OrderTypeForDelivery; | ||
|
||
public enum OrderType { | ||
IMMEDIATE, | ||
SCHEDULED | ||
SCHEDULED; | ||
|
||
public OrderTypeForDelivery toOrderTypeForDelivery() { | ||
return switch (this) { | ||
case IMMEDIATE -> OrderTypeForDelivery.IMMEDIATE; | ||
case SCHEDULED -> OrderTypeForDelivery.SCHEDULED; | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...altoktok/infra/user/entity/AddressVO.java → ...toktok/infra/global/entity/AddressVO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
infra/src/main/java/core/startup/mealtoktok/infra/global/entity/ImageEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package core.startup.mealtoktok.infra.global.entity; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.Table; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import core.startup.mealtoktok.common.dto.Image; | ||
|
||
@Entity | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor | ||
@Getter | ||
@Table(name = "image") | ||
public class ImageEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
private String imageUrl; | ||
|
||
public static ImageEntity from(Image image) { | ||
|
||
if (image == null) { | ||
return null; | ||
} | ||
|
||
return new ImageEntity(image.getId() != null ? image.getId() : null, image.getImageUrl()); | ||
} | ||
|
||
public Image toImage() { | ||
return new Image(id, imageUrl); | ||
} | ||
} |
Oops, something went wrong.