feat: 기관 배정에 아이티앤 담당자(ITN) 역할을 추가
신청기관/문정원/변호사 3종 배정과 동일한 패턴으로 itn_contact_id 컬럼과 배정 검증(구분 불일치 400), 조인 조회를 추가한다. 기존 배정 API/시드/ 회원명단 자동배정 호출부의 updateAssignments 시그니처를 갱신하고, 관련 테스트를 확장한다.
@765fc8b17ffc194d5bfc913177d5cfd803425ed7
--- src/main/java/kr/itn/itnhub/contact/MemberImportService.java
+++ src/main/java/kr/itn/itnhub/contact/MemberImportService.java
... | ... | @@ -97,7 +97,8 @@ |
| 97 | 97 |
return false; |
| 98 | 98 |
} |
| 99 | 99 |
orgMapper.updateAssignments(org.getId(), contact.getId(), |
| 100 |
- org.getMjContactId(), org.getLawyerContactId(), org.getLawyerAssignedDate()); |
|
| 100 |
+ org.getMjContactId(), org.getItnContactId(), |
|
| 101 |
+ org.getLawyerContactId(), org.getLawyerAssignedDate()); |
|
| 101 | 102 |
return true; |
| 102 | 103 |
} |
| 103 | 104 |
} |
--- src/main/java/kr/itn/itnhub/org/AssignmentRequest.java
+++ src/main/java/kr/itn/itnhub/org/AssignmentRequest.java
... | ... | @@ -1,13 +1,14 @@ |
| 1 | 1 |
package kr.itn.itnhub.org; |
| 2 | 2 |
|
| 3 | 3 |
/** |
| 4 |
- * 채널관리 화면에서 담당자 3종(신청기관/문정원/변호사)을 배정한다. |
|
| 5 |
- * null은 "그 역할의 배정을 해제한다"는 뜻이며, 매 호출마다 세 배정값 + 배정일을 모두 보낸다 |
|
| 4 |
+ * 채널관리 화면에서 담당자 4종(신청기관/문정원/아이티앤/변호사)을 배정한다. |
|
| 5 |
+ * null은 "그 역할의 배정을 해제한다"는 뜻이며, 매 호출마다 네 배정값 + 배정일을 모두 보낸다 |
|
| 6 | 6 |
* (부분 갱신이 아니다 - PUT 하나가 항상 현재 상태 전체를 반영한다). |
| 7 | 7 |
*/ |
| 8 | 8 |
public record AssignmentRequest( |
| 9 | 9 |
Long applicantContactId, |
| 10 | 10 |
Long mjContactId, |
| 11 |
+ Long itnContactId, |
|
| 11 | 12 |
Long lawyerContactId, |
| 12 | 13 |
String lawyerAssignedDate) {
|
| 13 | 14 |
} |
--- src/main/java/kr/itn/itnhub/org/OrgResponse.java
+++ src/main/java/kr/itn/itnhub/org/OrgResponse.java
... | ... | @@ -9,6 +9,7 @@ |
| 9 | 9 |
OrgStatus status, |
| 10 | 10 |
Contact applicant, |
| 11 | 11 |
Contact mj, |
| 12 |
+ Contact itn, |
|
| 12 | 13 |
Contact lawyer, |
| 13 | 14 |
String lawyerAssignedDate, |
| 14 | 15 |
String channelIdMj, |
... | ... | @@ -22,6 +23,7 @@ |
| 22 | 23 |
org.getStatus(), |
| 23 | 24 |
org.getApplicant(), |
| 24 | 25 |
org.getMj(), |
| 26 |
+ org.getItn(), |
|
| 25 | 27 |
org.getLawyer(), |
| 26 | 28 |
org.getLawyerAssignedDate(), |
| 27 | 29 |
org.getChannelIdMj(), |
--- src/main/java/kr/itn/itnhub/org/Organization.java
+++ src/main/java/kr/itn/itnhub/org/Organization.java
... | ... | @@ -10,6 +10,7 @@ |
| 10 | 10 |
private String channelSlug; |
| 11 | 11 |
private Long applicantContactId; |
| 12 | 12 |
private Long mjContactId; |
| 13 |
+ private Long itnContactId; |
|
| 13 | 14 |
private Long lawyerContactId; |
| 14 | 15 |
private String lawyerAssignedDate; |
| 15 | 16 |
private String channelIdMj; |
... | ... | @@ -18,6 +19,7 @@ |
| 18 | 19 |
/** findAll/findById가 contact 테이블과 조인해 채워준다. 시드/upsert 경로에서는 비어 있다. */ |
| 19 | 20 |
private Contact applicant; |
| 20 | 21 |
private Contact mj; |
| 22 |
+ private Contact itn; |
|
| 21 | 23 |
private Contact lawyer; |
| 22 | 24 |
|
| 23 | 25 |
/** |
... | ... | @@ -64,6 +66,9 @@ |
| 64 | 66 |
public Long getMjContactId() { return mjContactId; }
|
| 65 | 67 |
public void setMjContactId(Long mjContactId) { this.mjContactId = mjContactId; }
|
| 66 | 68 |
|
| 69 |
+ public Long getItnContactId() { return itnContactId; }
|
|
| 70 |
+ public void setItnContactId(Long itnContactId) { this.itnContactId = itnContactId; }
|
|
| 71 |
+ |
|
| 67 | 72 |
public Long getLawyerContactId() { return lawyerContactId; }
|
| 68 | 73 |
public void setLawyerContactId(Long lawyerContactId) { this.lawyerContactId = lawyerContactId; }
|
| 69 | 74 |
|
... | ... | @@ -82,6 +87,9 @@ |
| 82 | 87 |
public Contact getMj() { return mj; }
|
| 83 | 88 |
public void setMj(Contact mj) { this.mj = mj; }
|
| 84 | 89 |
|
| 90 |
+ public Contact getItn() { return itn; }
|
|
| 91 |
+ public void setItn(Contact itn) { this.itn = itn; }
|
|
| 92 |
+ |
|
| 85 | 93 |
public Contact getLawyer() { return lawyer; }
|
| 86 | 94 |
public void setLawyer(Contact lawyer) { this.lawyer = lawyer; }
|
| 87 | 95 |
} |
--- src/main/java/kr/itn/itnhub/org/OrganizationMapper.java
+++ src/main/java/kr/itn/itnhub/org/OrganizationMapper.java
... | ... | @@ -24,6 +24,7 @@ |
| 24 | 24 |
int updateAssignments(@Param("id") Long id,
|
| 25 | 25 |
@Param("applicantContactId") Long applicantContactId,
|
| 26 | 26 |
@Param("mjContactId") Long mjContactId,
|
| 27 |
+ @Param("itnContactId") Long itnContactId,
|
|
| 27 | 28 |
@Param("lawyerContactId") Long lawyerContactId,
|
| 28 | 29 |
@Param("lawyerAssignedDate") String lawyerAssignedDate);
|
| 29 | 30 |
|
--- src/main/java/kr/itn/itnhub/org/OrganizationService.java
+++ src/main/java/kr/itn/itnhub/org/OrganizationService.java
... | ... | @@ -24,8 +24,8 @@ |
| 24 | 24 |
} |
| 25 | 25 |
|
| 26 | 26 |
/** |
| 27 |
- * 담당자관리에서 이미 등록된 담당자를 신청기관/문정원/변호사 역할에 배정한다. |
|
| 28 |
- * null인 필드는 그 역할의 배정을 해제한다는 뜻이며, 매 호출은 세 배정값과 |
|
| 27 |
+ * 담당자관리에서 이미 등록된 담당자를 신청기관/문정원/아이티앤/변호사 역할에 배정한다. |
|
| 28 |
+ * null인 필드는 그 역할의 배정을 해제한다는 뜻이며, 매 호출은 네 배정값과 |
|
| 29 | 29 |
* 배정일을 통째로 덮어쓴다(부분 갱신이 아니다). |
| 30 | 30 |
*/ |
| 31 | 31 |
@Transactional |
... | ... | @@ -37,10 +37,11 @@ |
| 37 | 37 |
|
| 38 | 38 |
validateAssignment(request.applicantContactId(), "APPLICANT", "신청기관 담당자"); |
| 39 | 39 |
validateAssignment(request.mjContactId(), "MJ", "문정원 담당자"); |
| 40 |
+ validateAssignment(request.itnContactId(), "ITN", "아이티앤 담당자"); |
|
| 40 | 41 |
validateAssignment(request.lawyerContactId(), "LAWYER", "담당 변호사"); |
| 41 | 42 |
|
| 42 | 43 |
mapper.updateAssignments(id, request.applicantContactId(), request.mjContactId(), |
| 43 |
- request.lawyerContactId(), request.lawyerAssignedDate()); |
|
| 44 |
+ request.itnContactId(), request.lawyerContactId(), request.lawyerAssignedDate()); |
|
| 44 | 45 |
|
| 45 | 46 |
return OrgResponse.of(mapper.findById(id)); |
| 46 | 47 |
} |
--- src/main/java/kr/itn/itnhub/seed/SeedService.java
+++ src/main/java/kr/itn/itnhub/seed/SeedService.java
... | ... | @@ -98,7 +98,8 @@ |
| 98 | 98 |
} |
| 99 | 99 |
|
| 100 | 100 |
mapper.updateAssignments(saved.getId(), contact.getId(), |
| 101 |
- saved.getMjContactId(), saved.getLawyerContactId(), saved.getLawyerAssignedDate()); |
|
| 101 |
+ saved.getMjContactId(), saved.getItnContactId(), |
|
| 102 |
+ saved.getLawyerContactId(), saved.getLawyerAssignedDate()); |
|
| 102 | 103 |
} |
| 103 | 104 |
|
| 104 | 105 |
private String key(String orgNo, String orgName) {
|
+++ src/main/resources/db/migration/V7__itn_assignment.sql
... | ... | @@ -0,0 +1,2 @@ |
| 1 | +alter table organization | |
| 2 | + add column itn_contact_id bigint references contact (id) on delete set null; |
--- src/main/resources/mapper/OrganizationMapper.xml
+++ src/main/resources/mapper/OrganizationMapper.xml
... | ... | @@ -4,9 +4,9 @@ |
| 4 | 4 |
<mapper namespace="kr.itn.itnhub.org.OrganizationMapper"> |
| 5 | 5 |
|
| 6 | 6 |
<!-- |
| 7 |
- 담당자 3종은 contact 테이블을 세 번 조인해서 채운다(신청기관/문정원/변호사 배정이 각각 |
|
| 8 |
- 다른 contact 행을 가리킬 수 있으므로). 각 조인에 별칭 컬럼을 붙여야 resultMap의 |
|
| 9 |
- association 세 개가 서로 컬럼을 침범하지 않는다. |
|
| 7 |
+ 담당자 4종은 contact 테이블을 네 번 조인해서 채운다(신청기관/문정원/아이티앤/변호사 배정이 |
|
| 8 |
+ 각각 다른 contact 행을 가리킬 수 있으므로). 각 조인에 별칭 컬럼을 붙여야 resultMap의 |
|
| 9 |
+ association 네 개가 서로 컬럼을 침범하지 않는다. |
|
| 10 | 10 |
--> |
| 11 | 11 |
<resultMap id="organizationResultMap" type="kr.itn.itnhub.org.Organization"> |
| 12 | 12 |
<id property="id" column="id"/> |
... | ... | @@ -15,6 +15,7 @@ |
| 15 | 15 |
<result property="channelSlug" column="channel_slug"/> |
| 16 | 16 |
<result property="applicantContactId" column="applicant_contact_id"/> |
| 17 | 17 |
<result property="mjContactId" column="mj_contact_id"/> |
| 18 |
+ <result property="itnContactId" column="itn_contact_id"/> |
|
| 18 | 19 |
<result property="lawyerContactId" column="lawyer_contact_id"/> |
| 19 | 20 |
<result property="lawyerAssignedDate" column="lawyer_assigned_date"/> |
| 20 | 21 |
<result property="channelIdMj" column="channel_id_mj"/> |
... | ... | @@ -42,6 +43,17 @@ |
| 42 | 43 |
<result property="email" column="mj_c_email"/> |
| 43 | 44 |
</association> |
| 44 | 45 |
|
| 46 |
+ <association property="itn" javaType="kr.itn.itnhub.contact.Contact"> |
|
| 47 |
+ <id property="id" column="itn_c_id"/> |
|
| 48 |
+ <result property="category" column="itn_c_category"/> |
|
| 49 |
+ <result property="name" column="itn_c_name"/> |
|
| 50 |
+ <result property="affiliation" column="itn_c_affiliation"/> |
|
| 51 |
+ <result property="deptName" column="itn_c_dept_name"/> |
|
| 52 |
+ <result property="title" column="itn_c_title"/> |
|
| 53 |
+ <result property="phone" column="itn_c_phone"/> |
|
| 54 |
+ <result property="email" column="itn_c_email"/> |
|
| 55 |
+ </association> |
|
| 56 |
+ |
|
| 45 | 57 |
<association property="lawyer" javaType="kr.itn.itnhub.contact.Contact"> |
| 46 | 58 |
<id property="id" column="lawyer_c_id"/> |
| 47 | 59 |
<result property="category" column="lawyer_c_category"/> |
... | ... | @@ -56,7 +68,7 @@ |
| 56 | 68 |
|
| 57 | 69 |
<sql id="joinedColumns"> |
| 58 | 70 |
o.id, o.org_no, o.org_name, o.channel_slug, |
| 59 |
- o.applicant_contact_id, o.mj_contact_id, o.lawyer_contact_id, |
|
| 71 |
+ o.applicant_contact_id, o.mj_contact_id, o.itn_contact_id, o.lawyer_contact_id, |
|
| 60 | 72 |
o.lawyer_assigned_date, o.channel_id_mj, o.channel_id_law, |
| 61 | 73 |
ac.id as applicant_id, ac.category as applicant_category, ac.name as applicant_name, |
| 62 | 74 |
ac.affiliation as applicant_affiliation, ac.dept_name as applicant_dept_name, |
... | ... | @@ -64,6 +76,9 @@ |
| 64 | 76 |
mc.id as mj_c_id, mc.category as mj_c_category, mc.name as mj_c_name, |
| 65 | 77 |
mc.affiliation as mj_c_affiliation, mc.dept_name as mj_c_dept_name, |
| 66 | 78 |
mc.title as mj_c_title, mc.phone as mj_c_phone, mc.email as mj_c_email, |
| 79 |
+ ic.id as itn_c_id, ic.category as itn_c_category, ic.name as itn_c_name, |
|
| 80 |
+ ic.affiliation as itn_c_affiliation, ic.dept_name as itn_c_dept_name, |
|
| 81 |
+ ic.title as itn_c_title, ic.phone as itn_c_phone, ic.email as itn_c_email, |
|
| 67 | 82 |
lc.id as lawyer_c_id, lc.category as lawyer_c_category, lc.name as lawyer_c_name, |
| 68 | 83 |
lc.affiliation as lawyer_c_affiliation, lc.dept_name as lawyer_c_dept_name, |
| 69 | 84 |
lc.title as lawyer_c_title, lc.phone as lawyer_c_phone, lc.email as lawyer_c_email |
... | ... | @@ -73,6 +88,7 @@ |
| 73 | 88 |
from organization o |
| 74 | 89 |
left join contact ac on ac.id = o.applicant_contact_id |
| 75 | 90 |
left join contact mc on mc.id = o.mj_contact_id |
| 91 |
+ left join contact ic on ic.id = o.itn_contact_id |
|
| 76 | 92 |
left join contact lc on lc.id = o.lawyer_contact_id |
| 77 | 93 |
</sql> |
| 78 | 94 |
|
... | ... | @@ -118,6 +134,7 @@ |
| 118 | 134 |
update organization set |
| 119 | 135 |
applicant_contact_id = #{applicantContactId},
|
| 120 | 136 |
mj_contact_id = #{mjContactId},
|
| 137 |
+ itn_contact_id = #{itnContactId},
|
|
| 121 | 138 |
lawyer_contact_id = #{lawyerContactId},
|
| 122 | 139 |
lawyer_assigned_date = #{lawyerAssignedDate},
|
| 123 | 140 |
updated_at = now() |
--- src/test/java/kr/itn/itnhub/contact/ContactControllerTest.java
+++ src/test/java/kr/itn/itnhub/contact/ContactControllerTest.java
... | ... | @@ -166,7 +166,7 @@ |
| 166 | 166 |
org.setChannelSlug("001");
|
| 167 | 167 |
orgMapper.upsertBySeed(org); |
| 168 | 168 |
Long orgId = orgMapper.findAll().get(0).getId(); |
| 169 |
- orgMapper.updateAssignments(orgId, contact.getId(), null, null, null); |
|
| 169 |
+ orgMapper.updateAssignments(orgId, contact.getId(), null, null, null, null); |
|
| 170 | 170 |
|
| 171 | 171 |
assertThat(orgMapper.findById(orgId).getStatus().name()).isEqualTo("READY");
|
| 172 | 172 |
|
--- src/test/java/kr/itn/itnhub/org/OrganizationControllerTest.java
+++ src/test/java/kr/itn/itnhub/org/OrganizationControllerTest.java
... | ... | @@ -101,6 +101,7 @@ |
| 101 | 101 |
void 문정원_담당자와_변호사를_함께_배정하면_응답과_재조회에_모두_반영된다() throws Exception {
|
| 102 | 102 |
Long applicantId = createContact("APPLICANT", "송민지");
|
| 103 | 103 |
Long mjId = createContact("MJ", "김문정");
|
| 104 |
+ Long itnId = createContact("ITN", "박아이티");
|
|
| 104 | 105 |
Long lawyerId = createContact("LAWYER", "이변호");
|
| 105 | 106 |
|
| 106 | 107 |
mvc.perform(put("/api/orgs/{id}/assignments", orgId)
|
... | ... | @@ -110,18 +111,21 @@ |
| 110 | 111 |
{
|
| 111 | 112 |
"applicantContactId": %d, |
| 112 | 113 |
"mjContactId": %d, |
| 114 |
+ "itnContactId": %d, |
|
| 113 | 115 |
"lawyerContactId": %d, |
| 114 | 116 |
"lawyerAssignedDate": "2026-07-21" |
| 115 | 117 |
} |
| 116 |
- """.formatted(applicantId, mjId, lawyerId))) |
|
| 118 |
+ """.formatted(applicantId, mjId, itnId, lawyerId))) |
|
| 117 | 119 |
.andExpect(status().isOk()) |
| 118 | 120 |
.andExpect(jsonPath("$.mj.name").value("김문정"))
|
| 121 |
+ .andExpect(jsonPath("$.itn.name").value("박아이티"))
|
|
| 119 | 122 |
.andExpect(jsonPath("$.lawyer.name").value("이변호"))
|
| 120 | 123 |
.andExpect(jsonPath("$.lawyerAssignedDate").value("2026-07-21"));
|
| 121 | 124 |
|
| 122 | 125 |
mvc.perform(get("/api/orgs"))
|
| 123 | 126 |
.andExpect(status().isOk()) |
| 124 | 127 |
.andExpect(jsonPath("$[0].mj.name").value("김문정"))
|
| 128 |
+ .andExpect(jsonPath("$[0].itn.name").value("박아이티"))
|
|
| 125 | 129 |
.andExpect(jsonPath("$[0].lawyer.name").value("이변호"));
|
| 126 | 130 |
} |
| 127 | 131 |
|
... | ... | @@ -142,7 +146,7 @@ |
| 142 | 146 |
@Test |
| 143 | 147 |
void 배정_해제는_null을_보내면_반영되어_정보대기로_돌아간다() throws Exception {
|
| 144 | 148 |
Long applicantId = createContact("APPLICANT", "송민지");
|
| 145 |
- mapper.updateAssignments(orgId, applicantId, null, null, null); |
|
| 149 |
+ mapper.updateAssignments(orgId, applicantId, null, null, null, null); |
|
| 146 | 150 |
|
| 147 | 151 |
mvc.perform(put("/api/orgs/{id}/assignments", orgId)
|
| 148 | 152 |
.with(csrf()) |
... | ... | @@ -151,6 +155,49 @@ |
| 151 | 155 |
.andExpect(status().isOk()) |
| 152 | 156 |
.andExpect(jsonPath("$.status").value("INFO_PENDING"))
|
| 153 | 157 |
.andExpect(jsonPath("$.applicant").value(nullValue()));
|
| 158 |
+ } |
|
| 159 |
+ |
|
| 160 |
+ @Test |
|
| 161 |
+ void 아이티앤_담당자를_배정하면_응답과_재조회에_반영된다() throws Exception {
|
|
| 162 |
+ Long itnId = createContact("ITN", "박아이티");
|
|
| 163 |
+ |
|
| 164 |
+ mvc.perform(put("/api/orgs/{id}/assignments", orgId)
|
|
| 165 |
+ .with(csrf()) |
|
| 166 |
+ .contentType(MediaType.APPLICATION_JSON) |
|
| 167 |
+ .content("{\"itnContactId\": " + itnId + "}"))
|
|
| 168 |
+ .andExpect(status().isOk()) |
|
| 169 |
+ .andExpect(jsonPath("$.itn.name").value("박아이티"));
|
|
| 170 |
+ |
|
| 171 |
+ mvc.perform(get("/api/orgs"))
|
|
| 172 |
+ .andExpect(status().isOk()) |
|
| 173 |
+ .andExpect(jsonPath("$[0].itn.name").value("박아이티"));
|
|
| 174 |
+ } |
|
| 175 |
+ |
|
| 176 |
+ @Test |
|
| 177 |
+ void 구분이_맞지_않는_담당자를_아이티앤에_배정하면_400이다() throws Exception {
|
|
| 178 |
+ Long lawyerId = createContact("LAWYER", "이변호");
|
|
| 179 |
+ |
|
| 180 |
+ mvc.perform(put("/api/orgs/{id}/assignments", orgId)
|
|
| 181 |
+ .with(csrf()) |
|
| 182 |
+ .contentType(MediaType.APPLICATION_JSON) |
|
| 183 |
+ .content("{\"itnContactId\": " + lawyerId + "}"))
|
|
| 184 |
+ .andExpect(status().isBadRequest()) |
|
| 185 |
+ .andExpect(jsonPath("$.message").value(containsString("아이티앤 담당자")));
|
|
| 186 |
+ } |
|
| 187 |
+ |
|
| 188 |
+ @Test |
|
| 189 |
+ void 아이티앤_담당자_배정_해제는_null을_보내면_반영된다() throws Exception {
|
|
| 190 |
+ Long itnId = createContact("ITN", "박아이티");
|
|
| 191 |
+ mapper.updateAssignments(orgId, null, null, itnId, null, null); |
|
| 192 |
+ |
|
| 193 |
+ mvc.perform(put("/api/orgs/{id}/assignments", orgId)
|
|
| 194 |
+ .with(csrf()) |
|
| 195 |
+ .contentType(MediaType.APPLICATION_JSON) |
|
| 196 |
+ .content("{\"itnContactId\": null}"))
|
|
| 197 |
+ .andExpect(status().isOk()) |
|
| 198 |
+ .andExpect(jsonPath("$.itn").value(nullValue()));
|
|
| 199 |
+ |
|
| 200 |
+ assertThat(mapper.findById(orgId).getItnContactId()).isNull(); |
|
| 154 | 201 |
} |
| 155 | 202 |
|
| 156 | 203 |
@Test |
... | ... | @@ -191,7 +238,7 @@ |
| 191 | 238 |
@Test |
| 192 | 239 |
void 채널생성을_요청하면_결과를_돌려준다() throws Exception {
|
| 193 | 240 |
Long applicantId = createContact("APPLICANT", "송민지");
|
| 194 |
- mapper.updateAssignments(orgId, applicantId, null, null, null); |
|
| 241 |
+ mapper.updateAssignments(orgId, applicantId, null, null, null, null); |
|
| 195 | 242 |
|
| 196 | 243 |
when(mattermost.findChannelIdByInternalName(anyString())).thenReturn(Optional.empty()); |
| 197 | 244 |
when(mattermost.findChannelIdByDisplayName(anyString())).thenReturn(Optional.empty()); |
... | ... | @@ -221,7 +268,7 @@ |
| 221 | 268 |
@Test |
| 222 | 269 |
void 법률검토만_실패해도_200과_부분실패_결과를_돌려준다() throws Exception {
|
| 223 | 270 |
Long applicantId = createContact("APPLICANT", "송민지");
|
| 224 |
- mapper.updateAssignments(orgId, applicantId, null, null, null); |
|
| 271 |
+ mapper.updateAssignments(orgId, applicantId, null, null, null, null); |
|
| 225 | 272 |
|
| 226 | 273 |
when(mattermost.findChannelIdByInternalName(anyString())).thenReturn(Optional.empty()); |
| 227 | 274 |
when(mattermost.findChannelIdByDisplayName(anyString())).thenReturn(Optional.empty()); |
--- src/test/java/kr/itn/itnhub/org/OrganizationMapperTest.java
+++ src/test/java/kr/itn/itnhub/org/OrganizationMapperTest.java
... | ... | @@ -84,7 +84,7 @@ |
| 84 | 84 |
void 채널ID를_한쪽만_저장할_수_있다() {
|
| 85 | 85 |
mapper.upsertBySeed(seedRow("002", "세종학당재단"));
|
| 86 | 86 |
Long id = mapper.findAll().get(0).getId(); |
| 87 |
- mapper.updateAssignments(id, insertContact("APPLICANT", "담당자"), null, null, null);
|
|
| 87 |
+ mapper.updateAssignments(id, insertContact("APPLICANT", "담당자"), null, null, null, null);
|
|
| 88 | 88 |
|
| 89 | 89 |
mapper.updateChannelIdMj(id, "only-mj"); |
| 90 | 90 |
|
... | ... | @@ -95,25 +95,28 @@ |
| 95 | 95 |
} |
| 96 | 96 |
|
| 97 | 97 |
@Test |
| 98 |
- void 담당자_3종을_배정하면_조인된_담당자_정보가_그대로_읽힌다() {
|
|
| 98 |
+ void 담당자_4종을_배정하면_조인된_담당자_정보가_그대로_읽힌다() {
|
|
| 99 | 99 |
mapper.upsertBySeed(seedRow("003", "한국문학번역원"));
|
| 100 | 100 |
Organization org = mapper.findAll().get(0); |
| 101 | 101 |
|
| 102 | 102 |
Long applicantId = insertContact("APPLICANT", "송민지");
|
| 103 | 103 |
Long mjId = insertContact("MJ", "김문정");
|
| 104 |
+ Long itnId = insertContact("ITN", "박아이티");
|
|
| 104 | 105 |
Long lawyerId = insertContact("LAWYER", "이변호");
|
| 105 | 106 |
|
| 106 |
- mapper.updateAssignments(org.getId(), applicantId, mjId, lawyerId, "2026-07-21"); |
|
| 107 |
+ mapper.updateAssignments(org.getId(), applicantId, mjId, itnId, lawyerId, "2026-07-21"); |
|
| 107 | 108 |
|
| 108 | 109 |
Organization after = mapper.findById(org.getId()); |
| 109 | 110 |
assertThat(after.getApplicantContactId()).isEqualTo(applicantId); |
| 110 | 111 |
assertThat(after.getMjContactId()).isEqualTo(mjId); |
| 112 |
+ assertThat(after.getItnContactId()).isEqualTo(itnId); |
|
| 111 | 113 |
assertThat(after.getLawyerContactId()).isEqualTo(lawyerId); |
| 112 | 114 |
assertThat(after.getLawyerAssignedDate()).isEqualTo("2026-07-21");
|
| 113 | 115 |
|
| 114 | 116 |
assertThat(after.getApplicant().getName()).isEqualTo("송민지");
|
| 115 | 117 |
assertThat(after.getApplicant().getCategory()).isEqualTo("APPLICANT");
|
| 116 | 118 |
assertThat(after.getMj().getName()).isEqualTo("김문정");
|
| 119 |
+ assertThat(after.getItn().getName()).isEqualTo("박아이티");
|
|
| 117 | 120 |
assertThat(after.getLawyer().getName()).isEqualTo("이변호");
|
| 118 | 121 |
assertThat(after.getStatus()).isEqualTo(OrgStatus.READY); |
| 119 | 122 |
} |
... | ... | @@ -124,11 +127,12 @@ |
| 124 | 127 |
Organization org = mapper.findAll().get(0); |
| 125 | 128 |
|
| 126 | 129 |
Long applicantId = insertContact("APPLICANT", "담당자");
|
| 127 |
- mapper.updateAssignments(org.getId(), applicantId, null, null, null); |
|
| 130 |
+ mapper.updateAssignments(org.getId(), applicantId, null, null, null, null); |
|
| 128 | 131 |
|
| 129 | 132 |
Organization after = mapper.findById(org.getId()); |
| 130 | 133 |
assertThat(after.getApplicant()).isNotNull(); |
| 131 | 134 |
assertThat(after.getMj()).isNull(); |
| 135 |
+ assertThat(after.getItn()).isNull(); |
|
| 132 | 136 |
assertThat(after.getLawyer()).isNull(); |
| 133 | 137 |
} |
| 134 | 138 |
|
... | ... | @@ -138,8 +142,8 @@ |
| 138 | 142 |
Organization org = mapper.findAll().get(0); |
| 139 | 143 |
|
| 140 | 144 |
Long applicantId = insertContact("APPLICANT", "담당자");
|
| 141 |
- mapper.updateAssignments(org.getId(), applicantId, null, null, null); |
|
| 142 |
- mapper.updateAssignments(org.getId(), null, null, null, null); |
|
| 145 |
+ mapper.updateAssignments(org.getId(), applicantId, null, null, null, null); |
|
| 146 |
+ mapper.updateAssignments(org.getId(), null, null, null, null, null); |
|
| 143 | 147 |
|
| 144 | 148 |
Organization after = mapper.findById(org.getId()); |
| 145 | 149 |
assertThat(after.getApplicantContactId()).isNull(); |
--- src/test/java/kr/itn/itnhub/provision/ChannelProvisionServiceTest.java
+++ src/test/java/kr/itn/itnhub/provision/ChannelProvisionServiceTest.java
... | ... | @@ -65,7 +65,7 @@ |
| 65 | 65 |
contact.setCategory("APPLICANT");
|
| 66 | 66 |
contact.setName(name); |
| 67 | 67 |
contactMapper.insert(contact); |
| 68 |
- mapper.updateAssignments(id, contact.getId(), null, null, null); |
|
| 68 |
+ mapper.updateAssignments(id, contact.getId(), null, null, null, null); |
|
| 69 | 69 |
return contact.getId(); |
| 70 | 70 |
} |
| 71 | 71 |
|
--- src/test/java/kr/itn/itnhub/seed/SeedServiceTest.java
+++ src/test/java/kr/itn/itnhub/seed/SeedServiceTest.java
... | ... | @@ -204,7 +204,7 @@ |
| 204 | 204 |
manual.setCategory("APPLICANT");
|
| 205 | 205 |
manual.setName("사람이 직접 배정한 담당자");
|
| 206 | 206 |
contactMapper.insert(manual); |
| 207 |
- mapper.updateAssignments(id, manual.getId(), null, null, null); |
|
| 207 |
+ mapper.updateAssignments(id, manual.getId(), null, null, null, null); |
|
| 208 | 208 |
|
| 209 | 209 |
seedService.seed(new ByteArrayInputStream(xlsx)); |
| 210 | 210 |
|
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?