261022_03_ENH: 발송 취소 가능 여부 타입과 판별 헬퍼 추가

This commit is contained in:
2026-10-22 15:42:49 +09:00
parent 1e71bdcfee
commit 63ee0ab049
6 changed files with 36 additions and 6 deletions

View File

@@ -7,8 +7,16 @@ export const EMAIL_RESERVE_CANCELED_RESULT_CODE = 108;
/** 문자(SMS, LMS_MMS)·알림톡(KKO) 예약 취소 결과 코드. */
export const SMS_KKO_RESERVE_CANCELED_RESULT_CODE = 9998;
/**
* 예약 취소 버튼을 활성화할 수 있는지 판단한다. cancelable === true일 때만 true.
* 값이 없으면(구버전 응답) false. cancelDt나 결과 라벨·코드로 추정하지 않는다.
*/
export const isSendCancelable = (item: { cancelable?: boolean }): boolean =>
item.cancelable === true;
/**
* 채널과 resultCode로 개별 건의 현재 예약 취소 상태를 판단한다.
* 현재 취소 상태 표시용이며, 취소 가능 여부 판단에는 isSendCancelable을 사용한다.
* cancelDt는 요청 이력이므로 상태 판정에 사용하지 않는다. 알 수 없는 채널은 false.
* 표시명은 서버의 resultViewLabel/resultLabel을 그대로 사용한다("예약 취소").
* 별도 결과 코드 목록 API는 없다.