fix: decouple channel test sms records

This commit is contained in:
hectorzhao
2026-07-09 12:23:43 +08:00
parent c58a010951
commit e0579857c6
13 changed files with 190 additions and 135 deletions
+32 -4
View File
@@ -93,8 +93,7 @@ export type ChannelConnectionLogResponse = {
export type ChannelTestResponse = {
channelId: string;
status: string;
batchTaskId: string;
taskNo: string;
testNo: string;
submitted: number;
messages: Array<{
phoneNumber: string;
@@ -344,6 +343,7 @@ export type SmsMessageRecord = {
amountCents: number;
status: string;
errorMessage?: string | null;
errorCode?: string | null;
queuedAt: string;
submittedAt?: string | null;
deliveredAt?: string | null;
@@ -352,8 +352,36 @@ export type SmsMessageRecord = {
channel?: AdminChannel | null;
tenant?: TenantOption | null;
application?: { id: string; name: string };
submitRecords?: Array<Record<string, unknown>>;
receiptRecords?: Array<Record<string, unknown>>;
submitRecords?: SmsSubmitRecord[];
receiptRecords?: SmsReceiptRecord[];
};
export type SmsSubmitRecord = {
id: string;
channelId: string;
submitId: string;
sequenceId?: number | null;
gatewayMessageId?: string | null;
submitStatus: string;
errorCode?: string | null;
errorMessage?: string | null;
submittedAt?: string | null;
createdAt: string;
channel?: AdminChannel | null;
};
export type SmsReceiptRecord = {
id: string;
channelId?: string | null;
messageId: string;
gatewayMessageId: string;
sequenceId?: number | null;
receiptStatus: string;
rawStatus: string;
errorCode?: string | null;
deliveredAt: string;
createdAt: string;
channel?: AdminChannel | null;
};
export type SmsMessageSegmentAudit = {
+1 -1
View File
@@ -335,7 +335,7 @@ function SmsTestModal({
content,
accessNo: accessNo.trim() || undefined,
});
setResult(`已提交 ${response.submitted} 条测试短信,任务${response.taskNo}`);
setResult(`已提交 ${response.submitted} 条测试短信,测试流水${response.testNo}`);
} catch (failure) {
setError(failure instanceof Error ? failure.message : '测试短信发送失败');
} finally {