260623_01_ENH: 엑셀 다운로드를 제외한 기능 완성
This commit is contained in:
35
src/lib/gwcf/notification.ts
Normal file
35
src/lib/gwcf/notification.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import {PerformanceFull, UserCompact} from "@/types/gwcf";
|
||||
|
||||
export const toNotificationParamValue = (value: unknown) => value == null ? "" : String(value);
|
||||
|
||||
export const buildUserMsgParam = (user: UserCompact): Record<string, string> => ({
|
||||
...Object.fromEntries(
|
||||
Object.entries(user.userDetail ?? {}).map(([key, value]) => [key, toNotificationParamValue(value)])
|
||||
),
|
||||
userId: toNotificationParamValue(user.userId),
|
||||
userCmpn: toNotificationParamValue(user.userCmpn),
|
||||
userTeam: toNotificationParamValue(user.userTeam),
|
||||
userName: toNotificationParamValue(user.userName),
|
||||
userRole: toNotificationParamValue(user.userRole),
|
||||
});
|
||||
|
||||
export const buildPerformanceSmsParams = (performance: PerformanceFull): Record<string, string> => ({
|
||||
businessType: toNotificationParamValue(performance.businessType),
|
||||
performanceGenre: toNotificationParamValue(performance.performanceGenre),
|
||||
performanceArea: toNotificationParamValue(performance.performanceArea),
|
||||
artistName: toNotificationParamValue(performance.artistName),
|
||||
performanceName: toNotificationParamValue(performance.performanceName),
|
||||
performanceStartMonth: toNotificationParamValue(performance.performanceStartMonth),
|
||||
performanceDtInfo: toNotificationParamValue(performance.performanceDtInfo),
|
||||
performanceTimeInfo: toNotificationParamValue(performance.performanceTimeInfo),
|
||||
ticketReservationStatus: toNotificationParamValue(performance.ticketReservationStatus),
|
||||
ticketReservationMemo: toNotificationParamValue(performance.ticketReservationMemo),
|
||||
performanceMemo: toNotificationParamValue(performance.performanceMemo),
|
||||
...Object.fromEntries(
|
||||
Object.entries(performance.performanceDetail ?? {}).map(([key, value]) => [key, toNotificationParamValue(value)])
|
||||
),
|
||||
...Object.fromEntries(
|
||||
Object.entries(performance.performanceMonitoringSchedule ?? {}).map(([key, value]) => [key, toNotificationParamValue(value)])
|
||||
),
|
||||
performanceId: toNotificationParamValue(performance.id),
|
||||
});
|
||||
Reference in New Issue
Block a user