fix: Resolve TypeScript build errors in billing service
This commit is contained in:
@@ -65,7 +65,7 @@ export class BillingService {
|
||||
);
|
||||
|
||||
if (result.mode === 'redirect') {
|
||||
payment.tx_ref = result.providerRef;
|
||||
payment.tx_ref = result.providerRef || null;
|
||||
payment.meta = { redirect_url: result.redirectUrl };
|
||||
await this.payments.save(payment);
|
||||
return { paymentId: payment.id, redirectUrl: result.redirectUrl };
|
||||
@@ -89,10 +89,10 @@ export class BillingService {
|
||||
throw new BadRequestException('Unexpected charge mode');
|
||||
}
|
||||
|
||||
async submitBankTransfer(tenantId: string, amount: number, currency: string, imageFile: Express.Multer.File) {
|
||||
if (!imageFile) throw new BadRequestException('Receipt image is required');
|
||||
async submitBankTransfer(tenantId: string, amount: number, currency: string, imageFile: any) {
|
||||
if (!imageFile || !imageFile.buffer) throw new BadRequestException('Receipt image is required');
|
||||
|
||||
const imageUrl = await this.storage.upload(imageFile, `transfers/${tenantId}`);
|
||||
const imageUrl = await this.storage.save(tenantId, 'transfers', imageFile.buffer, imageFile.originalname || '');
|
||||
|
||||
const payment = await this.payments.save(
|
||||
this.payments.create({
|
||||
|
||||
@@ -41,7 +41,7 @@ export class TenantBillingController {
|
||||
submitTransfer(
|
||||
@CurrentUser() user: AuthUser,
|
||||
@Body() body: { amount: number; currency?: string },
|
||||
@UploadedFile() receipt: Express.Multer.File,
|
||||
@UploadedFile() receipt: any,
|
||||
) {
|
||||
return this.billing.submitBankTransfer(user.tenantId, body.amount, body.currency || 'JOD', receipt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user