-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: return/kg sell for rejected or expired products (#133)
* feature: add updateProductReturnState api * refactor: moved api location from clothingsales to product * refactor: save salesStartDate in clothingSales * fix: get products by userClothingSales api * refactor: use generic type and separate dto * chore: fix getProductsByUserClothingSales * chore: add swagger doc * chore: add swagger doc
- Loading branch information
Showing
19 changed files
with
297 additions
and
124 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
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: 11 additions & 0 deletions
11
src/main/java/com/example/repick/domain/product/dto/product/PatchProductReturn.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,11 @@ | ||
package com.example.repick.domain.product.dto.product; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
import java.util.List; | ||
|
||
public record PatchProductReturn( | ||
@Schema(description = "λ°ν μν") String returnState, | ||
@Schema(description = "μν id λͺ©λ£") List<Long> productIds | ||
) { | ||
} |
14 changes: 14 additions & 0 deletions
14
...example/repick/domain/product/dto/productClothingSales/GetKgSellProductClothingSales.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,14 @@ | ||
package com.example.repick.domain.product.dto.productClothingSales; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
public record GetKgSellProductClothingSales( | ||
@Schema(description = "μνμ½λ") String productCode, | ||
@Schema(description = "μΈλ€μΌ") String thumbnailImageUrl, | ||
@Schema(description = "μνλͺ ") String productName, | ||
@Schema(description = "λ±κΈ") String grade, | ||
@Schema(description = "μ μ²μΌ") String requestDate, | ||
@Schema(description = "λ§λ£ μ¬λΆ (kg 맀μ κ²½λ‘μ©)") Boolean isExpired, | ||
@Schema(description = "kg 맀μ μ μ° μν") Boolean settlementStatus | ||
) { | ||
} |
4 changes: 2 additions & 2 deletions
4
...les/dto/GetClothingSalesProductCount.java β ...ngSales/GetProductCountClothingSales.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
8 changes: 3 additions & 5 deletions
8
...ingSales/dto/GetClothingSalesProduct.java β ...othingSales/GetProductsClothingSales.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,17 +1,15 @@ | ||
package com.example.repick.domain.clothingSales.dto; | ||
package com.example.repick.domain.product.dto.productClothingSales; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
public record GetClothingSalesProduct( | ||
public record GetProductsClothingSales( | ||
@Schema(description = "μνμ½λ") String productCode, | ||
@Schema(description = "μΈλ€μΌ") String thumbnailImageUrl, | ||
@Schema(description = "μνλͺ ") String productName, | ||
@Schema(description = "λ±κΈ") String grade, | ||
@Schema(description = "ν맀기κ°") String salesPeriod, | ||
@Schema(description = "ν맀 κΈμ‘") Long salesPrice, | ||
@Schema(description = "μ μ°κΈ") Long settlementPrice, | ||
@Schema(description = "μμλ£") Long fee, | ||
@Schema(description = "μ μ²μΌ") String requestDate, | ||
@Schema(description = "λ°μ‘ μ¬λΆ") Boolean isReturned | ||
@Schema(description = "μμλ£") Long fee | ||
) { | ||
} |
12 changes: 12 additions & 0 deletions
12
...ample/repick/domain/product/dto/productClothingSales/GetReturnedProductClothingSales.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,12 @@ | ||
package com.example.repick.domain.product.dto.productClothingSales; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
public record GetReturnedProductClothingSales( | ||
@Schema(description = "μνμ½λ") String productCode, | ||
@Schema(description = "μΈλ€μΌ") String thumbnailImageUrl, | ||
@Schema(description = "μνλͺ ") String productName, | ||
@Schema(description = "λ±κΈ") String grade, | ||
@Schema(description = "μ μ²μΌ") String requestDate | ||
) { | ||
} |
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
29 changes: 29 additions & 0 deletions
29
src/main/java/com/example/repick/domain/product/entity/ProductReturnStateType.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,29 @@ | ||
package com.example.repick.domain.product.entity; | ||
|
||
import com.example.repick.global.error.exception.CustomException; | ||
import com.example.repick.global.error.exception.ErrorCode; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum ProductReturnStateType { | ||
KG_SELL(1, "KG 맀μ "), | ||
RETURN_REQUESTED(2, "λ°μ‘ μμ²"), | ||
RETURN_COMPLETED(3, "λ°μ‘ μλ£"); | ||
|
||
private final int id; | ||
private final String value; | ||
|
||
ProductReturnStateType(int id, String value) { | ||
this.id = id; | ||
this.value = value; | ||
} | ||
|
||
public static ProductReturnStateType fromValue(String keyword) { | ||
for (ProductReturnStateType productReturnStateType : values()) { | ||
if (productReturnStateType.getValue().equals(keyword)) { | ||
return productReturnStateType; | ||
} | ||
} | ||
throw new CustomException(ErrorCode.INVALID_PRODUCT_RETURN_STATE); | ||
} | ||
} |
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
Oops, something went wrong.