Skip to content

Commit

Permalink
✨ 서비스 신청, 조회 시 돌봄 메모 추가 (#46)
Browse files Browse the repository at this point in the history
* 🐛 신청 목록 반환 시 신청 기본키 반환 (#35) (#36)

* 🐛 신청 api 응답으로 applyId 반환 (#39)

* 🐛 신청 목록 반환 시 신청 기본키 반환 (#35)

* 🐛 신청 api 응답으로 applyId 반환 (#38)

* 🐛 신청 목록 반환 시 신청 기본키 반환 (#35) (#36)

* ✨ 신청 API applyId 반환

* 🐛 신청 세부 조회 로직 수정  (#42)

* 🐛 신청 목록 반환 시 신청 기본키 반환 (#35)

* 🐛 신청 api 응답으로 applyId 반환 (#38)

* 🐛 신청 목록 반환 시 신청 기본키 반환 (#35) (#36)

* ✨ 신청 API applyId 반환

* 🐛 신청 조회 로직 수정  (#41)

* 🐛 신청 목록 반환 시 신청 기본키 반환 (#35) (#36)

* 🐛 신청 api 응답으로 applyId 반환 (#39)

* 🐛 신청 목록 반환 시 신청 기본키 반환 (#35)

* 🐛 신청 api 응답으로 applyId 반환 (#38)

* 🐛 신청 목록 반환 시 신청 기본키 반환 (#35) (#36)

* ✨ 신청 API applyId 반환

* 🐛 신청 세부 조회 오류 수정

* 🚀 Cd 파이프라인 수정

* chore: CD 파이프라인 수정

* 🎨 카카오페이 approval_url 배포 도메인으로 수정 (#44)

* 🎨 카카오페이 approval_url 배포 도메인으로 수정

* 🐛 신청 - 서류 연관관계 수정

* ✨ Status에 상태 추가

* ✨ 메모 추가

* ✨ GetStatus 메소드 수정

---------

Co-authored-by: GiHwan2 <[email protected]>
  • Loading branch information
Juye0nLee and GiHwan2 authored Nov 26, 2024
1 parent 6f9fe8a commit 07a399e
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
runs-on: self-hosted

steps:
# 1. backend 서비스 중지
# 1. 기존의 컨테이너를 중지시킵니다
- name: Stop backend service
run: sudo docker stop Ivory-Backend

Expand Down
9 changes: 7 additions & 2 deletions src/main/java/com/ivory/ivory/domain/Apply.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public class Apply extends BaseEntity {
@Column(name="status", nullable = false)
private Status status;

@Column(name="memo")
private String memo;

@ManyToOne
@JoinColumn(name="member_id")
private Member member;
Expand All @@ -47,11 +50,11 @@ public class Apply extends BaseEntity {
@JoinColumn(name="child_id")
private Child child;

@OneToOne
@ManyToOne
@JoinColumn(name="medical_certificate_id")
private MedicalCertificate medicalCertificate;

@OneToOne
@ManyToOne
@JoinColumn(name="absence_certificate_id")
private AbsenceCertificate absenceCertificate;

Expand All @@ -61,6 +64,7 @@ public static Apply toEntity(
Long subsidy,
IncomeType incomeType,
Status status,
String memo,
Member member,
Child child,
MedicalCertificate medicalCertificate,
Expand All @@ -73,6 +77,7 @@ public static Apply toEntity(
.subsidy(subsidy)
.incomeType(incomeType)
.status(status)
.memo(memo)
.member(member)
.child(child)
.medicalCertificate(medicalCertificate)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ivory/ivory/domain/Status.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.ivory.ivory.domain;

public enum Status {
YET, IN_PROGRESS, COMPLETE
YET, MATCHED, IN_PROGRESS, COMPLETE
}
3 changes: 3 additions & 0 deletions src/main/java/com/ivory/ivory/dto/ApplyDetailDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class ApplyDetailDto {
private String incomeType;
private String careDate;
private String careTime;
private String memo;
private String totalAmount;
private String subsidy;
private String copay;
Expand All @@ -34,6 +35,7 @@ public static ApplyDetailDto from(
String incomeType,
String careDate,
String careTime,
String memo,
String totalAmount,
String subsidy,
String copay,
Expand All @@ -49,6 +51,7 @@ public static ApplyDetailDto from(
.incomeType(incomeType)
.careDate(careDate)
.careTime(careTime)
.memo(memo)
.totalAmount(totalAmount)
.subsidy(subsidy)
.copay(copay)
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/ivory/ivory/dto/ApplyDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
Expand All @@ -28,4 +29,6 @@ public class ApplyDto {

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endDate;

private String memo;
}
8 changes: 7 additions & 1 deletion src/main/java/com/ivory/ivory/service/ApplyService.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public CustomApiResponse<?> applyService(ApplyDto dto, Long currentMemberId) {
Status status = getNowStatus(startDate,endDate);

//엔티티 생성
Apply apply = Apply.toEntity(dto,totalAmount,subsidy,incomeType,status,member.get(),child.get(),medicalCertificate.get(),absenceCertificate.get());
Apply apply = Apply.toEntity(dto,totalAmount,subsidy,incomeType,status,dto.getMemo(),member.get(),child.get(),medicalCertificate.get(),absenceCertificate.get());
//DB에 저장
Apply newApply = serviceRepository.save(apply);

Expand Down Expand Up @@ -193,6 +193,9 @@ public CustomApiResponse<?> getApplyDetail(Long applyId, Long currentMemberId) {
//서비스 이용시간
String careTime = getCareTime(startDate,endDate);

//돌봄 메모
String memo = apply.get().getMemo();

//기본 요금
Long totalAmount = apply.get().getTotalAmount();

Expand Down Expand Up @@ -238,6 +241,7 @@ public CustomApiResponse<?> getApplyDetail(Long applyId, Long currentMemberId) {
incomeType.getDescription(),
careDate,
careTime,
memo,
amountFormat(totalAmount),
amountFormat(subsidy),
amountFormat(copay),
Expand Down Expand Up @@ -283,6 +287,7 @@ else if (IncomeType.C.equals(incomeType) || IncomeType.D.equals(incomeType)) {
}

//현재 서비스 상태 계산 메소드
//TODO : MATCHED 일 때 추가 해야함
public Status getNowStatus(LocalDateTime startDate, LocalDateTime endDate) {
LocalDateTime now = LocalDateTime.now();
if (now.isBefore(startDate)) {
Expand Down Expand Up @@ -310,6 +315,7 @@ public String getCareTime(LocalDateTime startDate, LocalDateTime endDate) {
public String getStatus(Status Status) {
switch (Status) {
case YET: return "서비스 신청 완료";
case MATCHED: return "돌보미 매칭";
case IN_PROGRESS: return "돌봄 서비스 이용 중";
case COMPLETE: return "이용 완료";
default: return "";
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ivory/ivory/service/KakaoPayService.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public KakaoPayReadyDto kakaoPayReady(Long applyId) {
parameters.put("total_amount",copay);
parameters.put("vat_amount","200");
parameters.put("tax_free_amount","0");
parameters.put("approval_url","http://localhost:3000/apply/payments/success"); //TODO: 추후 배포된 도메인으로 수정해야함
parameters.put("approval_url","https://danpoong-ivory.vercel.app/apply/payments/success"); // 도메인
parameters.put("fail_url","http://localhost:3000/apply/payments/fail");
parameters.put("cancel_url","http://localhost:3000/apply/payments/cancel");

Expand Down

0 comments on commit 07a399e

Please sign in to comment.