Fix SMS billing build and make credit conversion idempotent.

Import the purchase-price constant for Nest build, and only convert IRT-scale balances so migrate re-runs do not divide credits again.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-09-09 11:12:27 +03:30
co-authored by Cursor
parent 584c01fcee
commit 717a203d48
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
import { BadRequestException, Injectable, NotFoundException } from '@nestjs/common';
import { PrismaService } from '../prisma/prisma.service';
import { TenantService } from '../tenant/tenant.service';
import { calculateSmsCredits, irtToSmsCredits } from './sms-billing';
import { calculateSmsCredits, irtToSmsCredits, SMS_PURCHASE_PRICE_PER_CREDIT_IRT } from './sms-billing';
@Injectable()
export class SmsBillingService {