260826_01_ENH: notihub 수정으로 인한 후속 조치

This commit is contained in:
2026-08-26 12:27:06 +09:00
parent d84c8b2c34
commit 3ea6905e00
6 changed files with 148 additions and 7 deletions

View File

@@ -1,4 +1,18 @@
import {PerformanceFull, UserCompact} from "@/types/gwcf";
import {TMPLAT_PURPOSE, Template} from "@/types/notification";
export const PHONE_VERIFICATION_PREVIEW = "인증번호는 [######] 입니다.";
export const isPhoneVerificationSupported = (template: Pick<Template, "tmplatTy">) =>
template.tmplatTy === 10 || template.tmplatTy === 20;
export const buildTemplatePreviewBody = (template: Pick<Template, "tmplatBody" | "tmplatPurpose">) =>
template.tmplatPurpose === TMPLAT_PURPOSE.PHONE_VERIFICATION
? `${template.tmplatBody}\n${PHONE_VERIFICATION_PREVIEW}`
: template.tmplatBody;
export const getSmsByteLength = (value: string) =>
Array.from(value).reduce((total, character) => total + (character.charCodeAt(0) > 0x7f ? 2 : 1), 0);
export const toNotificationParamValue = (value: unknown) => value == null ? "" : String(value);