index.ts
4.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
export type HealthStatus = 'ok';
export type ProductType = 0 | 1;
export type PrelearningStepKind = 'normal' | 'highlight';
export type MaterialType = 'image' | 'video';
export type SopMaterialPreviewMessageType = 'SOP_MATERIAL_PREVIEW_READY' | 'SOP_MATERIAL_PREVIEW_INIT';
export type EntrySource = 'home_popup' | 'package_detail';
export type PrelearningBuriedPointEventType = 'page_view' | 'intercept_back' | 'task_completed' | 'reroll_case';
export interface HealthResponse {
status: HealthStatus;
service: string;
}
export interface ErrorResponse {
error: {
code: string;
message: string;
details?: unknown;
requestId?: string;
};
}
export interface MaterialItem {
type: string;
url: string;
}
export interface SopMaterialPreviewModel {
id?: number;
content: string;
bgColor: string;
intervalPx: number;
materials: MaterialItem[];
}
export interface SopMaterialPreviewInitPayload extends SopMaterialPreviewModel {}
export interface SopMaterialPreviewInitMessage {
type: 'SOP_MATERIAL_PREVIEW_INIT';
payload: SopMaterialPreviewInitPayload;
}
export interface SopMaterialPreviewReadyMessage {
type: 'SOP_MATERIAL_PREVIEW_READY';
}
export interface SopMaterialPreviewApiResponse extends SopMaterialPreviewModel {
id: number;
}
export type SopMaterialPreviewApiError = ErrorResponse;
export interface BackendConfig {
nodeEnv: 'development' | 'test' | 'production';
port: number;
host: string;
logLevel: 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'silent';
databaseUrl: string;
}
export interface PrelearningInitPayload {
entrySource: EntrySource;
activityId: string;
activityProductId: string;
staffName?: string;
staffUuid: string;
merchantId: string;
caseId?: string;
}
export interface PrelearningInitRequest {
payload: PrelearningInitPayload;
}
export type PrelearningActionType = 'learn_next' | 'complete' | 'view_other';
export interface PrelearningActionState {
actionType: PrelearningActionType;
buttonLabel: string;
disabled: boolean;
disabledReason?: string;
toastMessage?: string;
}
export interface PrelearningActionPayload extends PrelearningInitPayload {
sessionId?: string;
}
export interface PrelearningActionRequest {
actionType: PrelearningActionType;
payload: PrelearningActionPayload;
}
export interface PrelearningBuriedPointPayload {
entrySource: EntrySource;
eventType: PrelearningBuriedPointEventType;
staffName?: string;
staffUuid: string;
merchantId: string;
activityId: string;
activityProductId: string;
caseId: string;
sessionId: string;
durationSeconds: number;
eventTime: string;
}
export interface PrelearningBuriedPointRequest {
payload: PrelearningBuriedPointPayload;
}
export interface PrelearningBuriedPointResponse {
stored: boolean;
duplicate: boolean;
}
export interface PrelearningCompleteActivityPayload {
entrySource: EntrySource;
staffUuid: string;
merchantId: string;
activityId: string;
activityProductId: string;
caseId: string;
sessionId: string;
}
export interface PrelearningInitResponse {
sessionId: string;
productType: ProductType;
actionState: PrelearningActionState;
activityProduct: {
activityId: number;
activityProductId: string;
productType: ProductType;
tabName: string;
tabDescription: string;
goodsCode: string;
packageCode: string;
goodsType: number | null;
goodsTypeName: string | null;
mainImageUrl: string;
thumbImageUrl: string;
detailImageUrl: string;
currentPrice: string;
minimumPrice: string;
discountPrice: string;
salesIncentive: string;
isMainPush: boolean;
};
script: PrelearningScriptViewModel;
}
export interface PrelearningActionResponse extends PrelearningInitResponse {
notice?: string;
}
export interface PrelearningScriptViewModel {
caseId: string;
title: string;
packageInfo: PrelearningPackageInfo;
profile: PrelearningProfile;
gameSteps: PrelearningGameStep[];
}
export interface PrelearningPackageInfo {
name: string;
oldPrice: string;
newPrice: string;
includes: string[];
imageUrl: string;
}
export interface PrelearningProfile {
name: string;
type: string;
car: string;
job: string;
family: string;
behavior: string;
objections: string[];
needs: string[];
includes: string[];
}
export interface PrelearningGameStepBase {
stageName: string;
stageSummary: string;
audioStartTime: string;
audioEndTime: string;
}
export interface PrelearningNormalGameStep extends PrelearningGameStepBase {
kind: 'normal';
}
export interface PrelearningHighlightGameStep extends PrelearningGameStepBase {
kind: 'highlight';
highlightTitle: string;
prompt: string;
dialogue: string;
salesPitch: string;
analysis: string;
}
export type PrelearningGameStep = PrelearningNormalGameStep | PrelearningHighlightGameStep;
export interface PrelearningApiError {
error: {
code: string;
message: string;
details?: unknown;
requestId?: string;
};
}