refactor(platformevent): remove CallbackTarget field and all usages
D-01: callback_target contract drift cleanup. - Remove CallbackTarget from Event struct and Validate - Remove CallbackTarget from PlatformInboundMeta - Remove defaultCallbackTarget and assignment from builder - Remove callback_target column from INSERT/SELECT/dead_letter SQL - Clean up all test literals and assertions DB migration left untouched; column remains empty until a future schema cleanup migration.
This commit is contained in:
@@ -68,12 +68,11 @@ func TestWorker_ShouldDeliverPendingEventToCallbackServer(t *testing.T) {
|
||||
now := time.Now().UTC().Truncate(time.Second)
|
||||
store := &stubEventStore{
|
||||
events: []platformevent.Event{{
|
||||
ID: "evt-1",
|
||||
Platform: "sub2api",
|
||||
EventType: platformevent.TypeReplyGenerated,
|
||||
CallbackTarget: "default",
|
||||
Payload: map[string]any{"reply": "好的"},
|
||||
Status: platformevent.StatusPending,
|
||||
ID: "evt-1",
|
||||
Platform: "sub2api",
|
||||
EventType: platformevent.TypeReplyGenerated,
|
||||
Payload: map[string]any{"reply": "好的"},
|
||||
Status: platformevent.StatusPending,
|
||||
NextAttemptAt: now,
|
||||
OccurredAt: now,
|
||||
CreatedAt: now,
|
||||
@@ -113,12 +112,11 @@ func TestWorker_ShouldRetryWhenCallbackReturns5xx(t *testing.T) {
|
||||
now := time.Now().UTC().Truncate(time.Second)
|
||||
store := &stubEventStore{
|
||||
events: []platformevent.Event{{
|
||||
ID: "evt-1",
|
||||
Platform: "sub2api",
|
||||
EventType: platformevent.TypeReplyGenerated,
|
||||
CallbackTarget: "default",
|
||||
Payload: map[string]any{"reply": "好的"},
|
||||
Status: platformevent.StatusPending,
|
||||
ID: "evt-1",
|
||||
Platform: "sub2api",
|
||||
EventType: platformevent.TypeReplyGenerated,
|
||||
Payload: map[string]any{"reply": "好的"},
|
||||
Status: platformevent.StatusPending,
|
||||
NextAttemptAt: now,
|
||||
OccurredAt: now,
|
||||
CreatedAt: now,
|
||||
@@ -152,12 +150,11 @@ func TestWorker_ShouldMoveEventToDeadLetterAfterMaxRetries(t *testing.T) {
|
||||
now := time.Now().UTC().Truncate(time.Second)
|
||||
store := &stubEventStore{
|
||||
events: []platformevent.Event{{
|
||||
ID: "evt-1",
|
||||
Platform: "sub2api",
|
||||
EventType: platformevent.TypeReplyGenerated,
|
||||
CallbackTarget: "default",
|
||||
Payload: map[string]any{"reply": "失败"},
|
||||
Status: platformevent.StatusRetrying,
|
||||
ID: "evt-1",
|
||||
Platform: "sub2api",
|
||||
EventType: platformevent.TypeReplyGenerated,
|
||||
Payload: map[string]any{"reply": "失败"},
|
||||
Status: platformevent.StatusRetrying,
|
||||
AttemptCount: 1,
|
||||
NextAttemptAt: now,
|
||||
OccurredAt: now,
|
||||
@@ -185,12 +182,11 @@ func TestWorker_ShouldPersistDeliveryAttemptAudit(t *testing.T) {
|
||||
now := time.Now().UTC().Truncate(time.Second)
|
||||
store := &stubEventStore{
|
||||
events: []platformevent.Event{{
|
||||
ID: "evt-1",
|
||||
Platform: "sub2api",
|
||||
EventType: platformevent.TypeReplyGenerated,
|
||||
CallbackTarget: "default",
|
||||
Payload: map[string]any{"reply": "失败"},
|
||||
Status: platformevent.StatusPending,
|
||||
ID: "evt-1",
|
||||
Platform: "sub2api",
|
||||
EventType: platformevent.TypeReplyGenerated,
|
||||
Payload: map[string]any{"reply": "失败"},
|
||||
Status: platformevent.StatusPending,
|
||||
NextAttemptAt: now,
|
||||
OccurredAt: now,
|
||||
CreatedAt: now,
|
||||
|
||||
Reference in New Issue
Block a user