generated from ttipo/project-base
feat(backend): 행사 출처 구분·전시 종류·공연장 테이블 추가
KOPIS 공연·한국문화정보원 전시를 관광공사 행사와 같은 테이블에 받으려면 관광공사 contentid 단독 유니크로는 출처가 섞인다. (source, source_id) 로 바꾸고, KOPIS 공연은 좌표가 공연장 상세에만 있어 event_venue 에 따로 둔다. - 전시는 몇 달씩 하는 것이 보통이라 상시 프로그램 기간 상한을 종류별로 나눔(전시 183일) - 관광공사 동기화는 관광공사 행사만 숨기도록 범위를 좁힘 - 조회 API 에 장르·예매 링크·출처별 표기 추가, 없는 날짜(2030-13-01)가 500 이 되던 것을 VAL_001 로 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -145,6 +145,14 @@ describe('축제·행사 조회 API (e2e)', () => {
|
||||
endDate: '2030-05-21',
|
||||
...at(null),
|
||||
});
|
||||
await save('E8', {
|
||||
kind: 'exhibition',
|
||||
name: '이투이 기획전시',
|
||||
startDate: '2030-03-01',
|
||||
endDate: '2030-07-31', // 5개월 — 전시는 기간 상한이 길어 목록에 남는다
|
||||
...at(0.0025),
|
||||
genre: '전시',
|
||||
});
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
@@ -158,32 +166,43 @@ describe('축제·행사 조회 API (e2e)', () => {
|
||||
it('기간과 겹치는 행사를 시작일순으로 주고, 상시 프로그램·숨김·기간 밖은 뺀다', async () => {
|
||||
const res = await get(`/api/events?${may}`).expect(200);
|
||||
expect(names(res)).toEqual([
|
||||
'이투이 기획전시',
|
||||
'이투이 봄꽃축제',
|
||||
'이투이 먼축제',
|
||||
'이투이 재즈공연',
|
||||
'이투이 좌표없는행사',
|
||||
]);
|
||||
expect(list(res).data.pageInfo.total).toBe(4);
|
||||
expect(list(res).data.pageInfo.total).toBe(5);
|
||||
expect(list(res).data.items.every((i) => i.ongoing === false)).toBe(true);
|
||||
});
|
||||
|
||||
it('좌표를 주면 반경 안 행사를 거리순으로 준다(좌표 없는 행사는 빠진다)', async () => {
|
||||
const res = await get(`/api/events?${near}`).expect(200);
|
||||
expect(names(res)).toEqual(['이투이 봄꽃축제', '이투이 재즈공연']);
|
||||
expect(names(res)).toEqual([
|
||||
'이투이 봄꽃축제',
|
||||
'이투이 재즈공연',
|
||||
'이투이 기획전시',
|
||||
]);
|
||||
expect(list(res).data.items[0].distanceM).toBeGreaterThan(100);
|
||||
});
|
||||
|
||||
it('분류 필터', async () => {
|
||||
const res = await get(`/api/events?${may}&kind=performance`).expect(200);
|
||||
expect(names(res)).toEqual(['이투이 재즈공연']);
|
||||
const ex = await get(`/api/events?${may}&kind=exhibition`).expect(200);
|
||||
expect(names(ex)).toEqual(['이투이 기획전시']);
|
||||
});
|
||||
|
||||
it('커서로 이어 받으면 겹치거나 빠지는 행사가 없다', async () => {
|
||||
const p1 = await get(`/api/events?${may}&limit=2`).expect(200);
|
||||
expect(names(p1)).toEqual(['이투이 봄꽃축제', '이투이 먼축제']);
|
||||
const p1 = await get(`/api/events?${may}&limit=3`).expect(200);
|
||||
expect(names(p1)).toEqual([
|
||||
'이투이 기획전시',
|
||||
'이투이 봄꽃축제',
|
||||
'이투이 먼축제',
|
||||
]);
|
||||
const cursor = list(p1).data.pageInfo.nextCursor ?? '';
|
||||
const p2 = await get(
|
||||
`/api/events?${may}&limit=2&cursor=${encodeURIComponent(cursor)}`,
|
||||
`/api/events?${may}&limit=3&cursor=${encodeURIComponent(cursor)}`,
|
||||
).expect(200);
|
||||
expect(names(p2)).toEqual(['이투이 재즈공연', '이투이 좌표없는행사']);
|
||||
expect(list(p2).data.pageInfo.hasNext).toBe(false);
|
||||
@@ -194,6 +213,7 @@ describe('축제·행사 조회 API (e2e)', () => {
|
||||
['92일을 넘는 기간', 'from=2030-01-01&to=2030-06-30'],
|
||||
['형식이 틀린 날짜', 'from=2030/05/01'],
|
||||
['없는 날짜', 'from=2030-02-30&to=2030-03-01'],
|
||||
['해석이 안 되는 날짜(13월)', 'from=2030-13-01&to=2030-12-31'],
|
||||
['없는 분류', `${may}&kind=parade`],
|
||||
['lat 만 보낸 경우', `${may}&lat=36.6`],
|
||||
])('%s 는 VAL_001(400)', async (_, query) => {
|
||||
|
||||
Reference in New Issue
Block a user