FareRuleService
운임 규정을 조회하는 서비스. 동기 및 비동기(폴링) 방식의 운임 규정 조회를 지원한다.
의존성
| 서비스 | 용도 |
|---|---|
| AdapterClient | GDS/NDC 운임 규정 조회 |
| FareRuleRepository | 폴링 결과 캐싱 |
| FlightSearchService | MIX 항공편 검증 |
메서드
getFareRules
fun getFareRules(detailKey: String, adult: Int, child: Int, infant: Int): List<FareRule>동기 방식으로 운임 규정을 조회한다.
getFareRulesGroups
fun getFareRulesGroups(
detailKeys: List<String>,
adult: Int,
child: Int,
infant: Int,
): List<FareRuleGroup>1~2개 detailKey에 대한 운임 규정 그룹을 조회한다. 멀티티켓 지원.
| Caller | Callee |
|---|---|
| FareRuleProxyController.getFareRulesGroup | FareRuleService.validateMultiTicketParameter |
| AdapterClient.getFareRulesGroups (pmap 병렬) |
getStructuredFareRules
fun getStructuredFareRules(detailKey1: String, detailKey2: String?): List<StructuredFareRule>구조화된 운임 규정(변경/환불 조건 등)을 조회한다.
| Caller | Callee |
|---|---|
| FareRuleProxyController.getStructuredFareRules | AdapterClient.getStructuredFareRules (pmap 병렬) |
| StructuredFareRule.of |
getFareRules (by UUID)
fun getFareRules(fareRuleKey: UUID): FareRuleInfo폴링용 운임 규정 결과를 조회한다.
init
fun init(detailKey: String, adult: Int, child: Int, infant: Int): UUID비동기 운임 규정 조회를 시작한다. UUID를 반환하고 백그라운드에서 조회 수행.
| Caller | Callee |
|---|---|
| FareRuleController.init | CacheKeyGenerator.getFareRuleCacheKey |
| FareRuleRepository.save (PENDING) | |
| FareRuleService.getFareRules (코루틴) | |
| FareRuleRepository.save (COMPLETE/ERROR) |
validateMultiTicketParameter (private)
private fun validateMultiTicketParameter(detailKeys: List<String>)멀티티켓 파라미터 검증. 2개 이상일 때 각각 MIX 항공편이어야 함.
| Caller | Callee |
|---|---|
| FareRuleService.getFareRulesGroups | FlightSearchService.getFlightItem (pmap 병렬) |
폴링 상태
| 상태 | 설명 |
|---|---|
PENDING | 조회 진행 중 |
COMPLETE | 조회 완료 |
ERROR | 조회 실패 |
특징
- 비동기 폴링: 운임 규정 조회가 오래 걸릴 수 있어 비동기 폴링 패턴 지원
- 병렬 처리: 멀티티켓 조회 시 pmap으로 병렬 처리
- 구조화된 규정: 변경/환불 조건을 구조화된 형태로 제공