fix(wizard): bind @PayloadJson parameter in UpsertAsync INSERT
The UpsertAsync SQL used @Payload (without 'Json' suffix) but the WizardDraft POCO exposes the property as PayloadJson. Dapper.AOT requires parameter names to match property names, so the parameter went through unbinded and PostgreSQL rejected 'payload' as a column reference. Without integration tests this went unnoticed; the new WizardDraftRepositoryTests now exercise the path and surface it.
This commit is contained in:
@@ -43,7 +43,7 @@ public sealed class WizardDraftRepository(NpgsqlDataSource dataSource)
|
||||
INSERT INTO wizard_drafts
|
||||
(id, chat_id, message_thread_id, owner_telegram_id, step, payload, draft_message_id, created_at, updated_at, expires_at)
|
||||
VALUES
|
||||
(@Id, @ChatId, @MessageThreadId, @OwnerTelegramId, @Step, @Payload::jsonb, @DraftMessageId, @CreatedAt, @UpdatedAt, @ExpiresAt)
|
||||
(@Id, @ChatId, @MessageThreadId, @OwnerTelegramId, @Step, @PayloadJson::jsonb, @DraftMessageId, @CreatedAt, @UpdatedAt, @ExpiresAt)
|
||||
ON CONFLICT (id) DO UPDATE
|
||||
SET step = EXCLUDED.step,
|
||||
payload = EXCLUDED.payload,
|
||||
|
||||
Reference in New Issue
Block a user