-
Notifications
You must be signed in to change notification settings - Fork 2
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 #69 from Try-AngIe/feat/billing
feat: 청구를 생성할 수 있다.
- Loading branch information
Showing
21 changed files
with
312 additions
and
48 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
20 changes: 20 additions & 0 deletions
20
server/src/main/java/kr/or/kosa/cmsplusmain/domain/billing/dto/BillingProductReq.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,20 @@ | ||
package kr.or.kosa.cmsplusmain.domain.billing.dto; | ||
|
||
import kr.or.kosa.cmsplusmain.domain.billing.entity.BillingProduct; | ||
import kr.or.kosa.cmsplusmain.domain.product.entity.Product; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class BillingProductReq { | ||
private Long productId; | ||
private Integer price; | ||
private Integer quantity; | ||
|
||
public BillingProduct toEntity() { | ||
return BillingProduct.builder() | ||
.product(Product.of(productId)) | ||
.price(price) | ||
.quantity(quantity) | ||
.build(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
server/src/main/java/kr/or/kosa/cmsplusmain/domain/billing/dto/BillingReq.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,22 @@ | ||
package kr.or.kosa.cmsplusmain.domain.billing.dto; | ||
|
||
import java.time.LocalDate; | ||
import java.util.List; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import kr.or.kosa.cmsplusmain.domain.billing.entity.BillingType; | ||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
@Getter | ||
@ToString | ||
public class BillingReq { | ||
@NotNull | ||
private BillingType billingType; | ||
@NotNull | ||
private LocalDate billingDate; | ||
@NotNull | ||
private Long contractId; | ||
@NotNull | ||
private List<BillingProductReq> billingProducts; | ||
} |
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
7 changes: 7 additions & 0 deletions
7
...in/java/kr/or/kosa/cmsplusmain/domain/billing/exception/EmptyBillingProductException.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,7 @@ | ||
package kr.or.kosa.cmsplusmain.domain.billing.exception; | ||
|
||
public class EmptyBillingProductException extends RuntimeException { | ||
public EmptyBillingProductException() { | ||
super("청구는 최소 한개의 상품을 포함해야합니다."); | ||
} | ||
} |
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
10 changes: 10 additions & 0 deletions
10
server/src/main/java/kr/or/kosa/cmsplusmain/domain/billing/repository/BillingRepository.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 kr.or.kosa.cmsplusmain.domain.billing.repository; | ||
|
||
import org.springframework.stereotype.Repository; | ||
|
||
import kr.or.kosa.cmsplusmain.domain.base.repository.BaseRepository; | ||
import kr.or.kosa.cmsplusmain.domain.billing.entity.Billing; | ||
|
||
@Repository | ||
public interface BillingRepository extends BaseRepository<Billing, Long> { | ||
} |
10 changes: 10 additions & 0 deletions
10
...main/java/kr/or/kosa/cmsplusmain/domain/billing/repository/BillingStandardRepository.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 kr.or.kosa.cmsplusmain.domain.billing.repository; | ||
|
||
import org.springframework.stereotype.Repository; | ||
|
||
import kr.or.kosa.cmsplusmain.domain.base.repository.BaseRepository; | ||
import kr.or.kosa.cmsplusmain.domain.billing.entity.BillingStandard; | ||
|
||
@Repository | ||
public interface BillingStandardRepository extends BaseRepository<BillingStandard, Long> { | ||
} |
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.