Skip to content

Commit 627f8fb

Browse files
committed
refactor(migrations): update index dropping syntax for promo codes and usages for consistency
1 parent b0ef27a commit 627f8fb

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

migrations/20260615140000-add-promo-code-indexes.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ module.exports = {
1919
const promoCodes = db.collection('promoCodes');
2020
const promoCodeUsages = db.collection('promoCodeUsages');
2121

22-
await promoCodes.dropIndex({ value: 1 });
23-
await promoCodeUsages.dropIndex({ promoCodeId: 1 });
24-
await promoCodeUsages.dropIndex({ promoCodeId: 1, userId: 1 });
25-
await promoCodeUsages.dropIndex({ promoCodeId: 1, workspaceId: 1 });
26-
await promoCodeUsages.dropIndex({ workspaceId: 1 });
27-
await promoCodeUsages.dropIndex({ userId: 1 });
22+
await promoCodes.dropIndex('value_1');
23+
await promoCodeUsages.dropIndex('promoCodeId_1');
24+
await promoCodeUsages.dropIndex('promoCodeId_1_userId_1');
25+
await promoCodeUsages.dropIndex('promoCodeId_1_workspaceId_1');
26+
await promoCodeUsages.dropIndex('workspaceId_1');
27+
await promoCodeUsages.dropIndex('userId_1');
2828
},
2929
};

src/resolvers/billingNew.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,16 @@ export default {
216216

217217
const checksum = await checksumService.generateChecksum(checksumData);
218218

219+
const loggedAmount = isCardLinkOperation ? AMOUNT_FOR_CARD_VALIDATION : paymentAmount;
220+
219221
/**
220222
* Send info to Telegram (non-blocking)
221223
*/
222224
telegram
223225
.sendMessage(`👀 [Billing / Compose payment]
224226
225227
card link operation: ${isCardLinkOperation}
226-
amount: ${+paymentAmount} RUB
228+
amount: ${+loggedAmount} RUB
227229
last charge date: ${workspace.lastChargeDate?.toISOString()}
228230
next payment date: ${nextPaymentDate.toISOString()}
229231
workspace id: ${workspace._id.toString()}

0 commit comments

Comments
 (0)