Skip to content

Commit b3b90d6

Browse files
메시지 타입에 다양한 브랜드 메시지 유형(BMS) 추가 및 음성 옵션 스키마를 새로 정의함. 메시지 스키마에 음성 옵션 필드를 추가하여 메시지 전송 기능을 확장함.
1 parent 1b098fd commit b3b90d6

2 files changed

Lines changed: 65 additions & 2 deletions

File tree

src/models/base/messages/message.ts

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import {
2+
VoiceOptionSchema,
3+
voiceOptionSchema,
4+
} from '@/models/requests/voice/voiceOption';
15
import {
26
KakaoOption,
37
baseKakaoOptionSchema,
@@ -40,8 +44,42 @@ export type MessageType =
4044
| 'RCS_ITPL'
4145
| 'RCS_LTPL'
4246
| 'FAX'
43-
| 'VOICE';
47+
| 'VOICE'
48+
| 'BMS_TEXT'
49+
| 'BMS_IMAGE'
50+
| 'BMS_WIDE'
51+
| 'BMS_WIDE_ITEM_LIST'
52+
| 'BMS_CAROUSEL_FEED'
53+
| 'BMS_PREMIUM_VIDEO'
54+
| 'BMS_COMMERCE'
55+
| 'BMS_CAROUSEL_COMMERCE';
4456

57+
/**
58+
* 메시지 타입
59+
SMS: 단문 문자
60+
LMS: 장문 문자
61+
MMS: 사진 문자
62+
ATA: 알림톡
63+
CTA: 친구톡
64+
CTI: 친구톡 + 이미지
65+
NSA: 네이버 스마트 알림
66+
RCS_SMS: RCS 단문 문자
67+
RCS_LMS: RCS 장문 문자
68+
RCS_MMS: RCS 사진 문자
69+
RCS_TPL: RCS 템플릿 문자
70+
RCS_ITPL: RCS 이미지 템플릿 문자
71+
RCS_LTPL: RCS LMS 템플릿 문자
72+
FAX: 팩스
73+
VOICE: 보이스콜
74+
BMS_TEXT: 브랜드 메시지 텍스트형
75+
BMS_IMAGE: 브랜드 메시지 이미지형
76+
BMS_WIDE: 브랜드 메시지 와이드형
77+
BMS_WIDE_ITEM_LIST: 브랜드 메시지 와이드 아이템 리스트형
78+
BMS_CAROUSEL_FEED: 브랜드 메시지 캐러셀 피드형
79+
BMS_PREMIUM_VIDEO: 브랜드 메시지 프리미엄 비디오형
80+
BMS_COMMERCE: 브랜드 메시지 커머스형
81+
BMS_CAROUSEL_COMMERCE: 브랜드 메시지 캐러셀 커머스형
82+
*/
4583
export const messageTypeSchema = Schema.Literal(
4684
'SMS',
4785
'LMS',
@@ -58,6 +96,14 @@ export const messageTypeSchema = Schema.Literal(
5896
'RCS_LTPL',
5997
'FAX',
6098
'VOICE',
99+
'BMS_TEXT',
100+
'BMS_IMAGE',
101+
'BMS_WIDE',
102+
'BMS_WIDE_ITEM_LIST',
103+
'BMS_CAROUSEL_FEED',
104+
'BMS_PREMIUM_VIDEO',
105+
'BMS_COMMERCE',
106+
'BMS_CAROUSEL_COMMERCE',
61107
);
62108

63109
export const messageSchema = Schema.Struct({
@@ -75,10 +121,11 @@ export const messageSchema = Schema.Struct({
75121
customFields: Schema.optional(
76122
Schema.Record({key: Schema.String, value: Schema.String}),
77123
),
124+
naverOptions: Schema.optional(naverOptionSchema),
78125
faxOptions: Schema.optional(
79126
Schema.Struct({fileIds: Schema.Array(Schema.String)}),
80127
),
81-
naverOptions: Schema.optional(naverOptionSchema),
128+
voiceOptions: Schema.optional(voiceOptionSchema),
82129
});
83130

84131
export type MessageSchema = Schema.Schema.Type<typeof messageSchema>;
@@ -177,6 +224,8 @@ export class Message {
177224

178225
faxOptions?: FileIds;
179226

227+
voiceOptions?: VoiceOptionSchema;
228+
180229
constructor(parameter: MessageSchema) {
181230
this.to = parameter.to;
182231
this.from = parameter.from;
@@ -195,5 +244,6 @@ export class Message {
195244
this.customFields = parameter.customFields;
196245
this.replacements = parameter.replacements;
197246
this.faxOptions = parameter.faxOptions;
247+
this.voiceOptions = parameter.voiceOptions;
198248
}
199249
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import {Schema} from 'effect';
2+
3+
export const voiceOptionSchema = Schema.Struct({
4+
voiceType: Schema.Literal('FEMALE', 'MALE').pipe(
5+
Schema.optionalWith({default: () => 'FEMALE' as const}),
6+
),
7+
headerMessage: Schema.optional(Schema.String),
8+
tailMessage: Schema.optional(Schema.String),
9+
replyRate: Schema.optional(Schema.Literal(1, 2, 3)),
10+
counselorNumber: Schema.optional(Schema.String),
11+
});
12+
13+
export type VoiceOptionSchema = Schema.Schema.Type<typeof voiceOptionSchema>;

0 commit comments

Comments
 (0)