feat(backend): 같은 출처에 두 번 등록된 전시를 하나로 합침

한국문화정보원에 같은 전시가 제목만 다르게 두 번 등록되어 목록에 2건으로 나왔다
("문준호 전 - 남겨진 것들을 위한 풍경" / "문준호 《남겨진 것들을 위한 풍경》", 같은 갤러리·같은 기간).

같은 장소 · 같은 시작·종료일 · 제목 비교 키가 연속 6글자 이상 겹치면 같은 전시로 보고
먼저 등록된 것만 남긴다. 장소·기간만으로 합치지 않는 이유는 여러 전시실에서 같은 날
여러 전시를 여는 곳이 있어서다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-03 23:27:59 +09:00
parent 7e59ac0205
commit e383c2e242
5 changed files with 195 additions and 8 deletions
+8 -2
View File
@@ -116,12 +116,14 @@ describe('한국문화정보원 전시 동기화 (e2e)', () => {
await moduleRef.close();
});
it('첫 실행: 전시만 넣고, 다른 출처에 있는 행사는 건너뛰고, 상세를 받는다(이미지는 넣지 않음)', async () => {
it('첫 실행: 전시만 넣고, 다른 출처·같은 출처 중복은 건너뛰고, 상세를 받는다(이미지는 넣지 않음)', async () => {
fakeList = [
item('99000001'),
item('99000002', { startDate: ymd(5), endDate: ymd(60) }),
item('99000003', { realmName: '음악/콘서트' }),
item('99000004', { title: '시험 비엔날레' }),
// 99000001 과 같은 장소·기간, 제목만 다르게 다시 등록된 전시
item('99000005', { title: '시험 전시 《99000001》 특별전' }),
];
const result = await sync.run({ regionCode: REGION });
@@ -130,7 +132,11 @@ describe('한국문화정보원 전시 동기화 (e2e)', () => {
inserted: 2,
detailed: 2,
detailRemaining: 0,
skipped: { not_exhibition: 1, duplicate_other_source: 1 },
skipped: {
not_exhibition: 1,
duplicate_other_source: 1,
duplicate_same_source: 1,
},
calls: { area2: 1, detail2: 2 },
});
expect(await event('99000001')).toMatchObject({