mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 21:21:10 +02:00
🐛 fix(gifts): explicitly set nullable fields to null in DB inserts
Drizzle ORM requires explicit null values for optional fields instead of leaving them undefined. Added explicit null for organizationId, idempotencyKey, portionNumber, and creditTransactionId. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
102f0df518
commit
ab677b28c8
1 changed files with 6 additions and 0 deletions
|
|
@ -359,6 +359,8 @@ export class GiftCodeService {
|
|||
redeemerUserId: userId,
|
||||
status: 'failed_wrong_user',
|
||||
creditsReceived: 0,
|
||||
portionNumber: null,
|
||||
creditTransactionId: null,
|
||||
sourceAppId: dto.sourceAppId ?? null,
|
||||
});
|
||||
|
||||
|
|
@ -383,6 +385,8 @@ export class GiftCodeService {
|
|||
redeemerUserId: userId,
|
||||
status: 'failed_wrong_answer',
|
||||
creditsReceived: 0,
|
||||
portionNumber: null,
|
||||
creditTransactionId: null,
|
||||
sourceAppId: dto.sourceAppId ?? null,
|
||||
});
|
||||
|
||||
|
|
@ -463,7 +467,9 @@ export class GiftCodeService {
|
|||
balanceAfter: newBalance,
|
||||
appId: dto.sourceAppId || 'gift',
|
||||
description: `Gift received: ${giftCode.code}`,
|
||||
organizationId: null,
|
||||
metadata: { giftCodeId: giftCode.id, portionNumber },
|
||||
idempotencyKey: null,
|
||||
completedAt: new Date(),
|
||||
})
|
||||
.returning();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue