-
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.
Merge pull request #20 from ClothingStoreService/test/order-unit
구매자 구매확정 기능 단위테스트를 kotest 형식으로 변경
- Loading branch information
Showing
24 changed files
with
359 additions
and
410 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,6 @@ class MemberLoginRequest( | |
val password: String, | ||
) { | ||
constructor() : this("", "") { | ||
|
||
} | ||
} |
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
19 changes: 0 additions & 19 deletions
19
src/main/kotlin/org/store/clothstar/order/controller/OrderDetailController.kt
This file was deleted.
Oops, something went wrong.
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
42 changes: 0 additions & 42 deletions
42
src/main/kotlin/org/store/clothstar/order/dto/response/OrderDetailResponse.kt
This file was deleted.
Oops, something went wrong.
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
19 changes: 3 additions & 16 deletions
19
src/main/kotlin/org/store/clothstar/order/repository/OrderRepository.kt
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,25 +1,12 @@ | ||
package org.store.clothstar.order.repository | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository | ||
import org.springframework.data.jpa.repository.Modifying | ||
import org.springframework.data.jpa.repository.Query | ||
import org.springframework.data.repository.query.Param | ||
import org.springframework.transaction.annotation.Transactional | ||
import org.store.clothstar.order.domain.Order | ||
|
||
interface OrderRepository : JpaRepository<Order, String> { | ||
@Query("SELECT o FROM orders o WHERE o.status = 'CONFIRMED' AND o.deletedAt is null") | ||
fun findConfirmedOrders(): List<Order?> | ||
|
||
@Transactional | ||
@Modifying | ||
@Query("UPDATE orders o SET o.status = 'APPROVE' WHERE o.orderId = :orderId") | ||
fun approveOrder(@Param("orderId") orderId: String) | ||
|
||
@Transactional | ||
@Modifying | ||
@Query("UPDATE orders o SET o.status = 'CANCEL' WHERE o.orderId = :orderId") | ||
fun cancelOrder(@Param("orderId") orderId: String) | ||
|
||
fun findByOrderIdAndDeletedAtIsNull(orderId: String): Order? | ||
|
||
@Query("SELECT o FROM orders o WHERE o.status = 'CONFIRMED' AND o.deletedAt is null") | ||
fun findConfirmedAndNotDeletedOrders(): List<Order> | ||
} |
Oops, something went wrong.