payment
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
import { Module, forwardRef } from '@nestjs/common';
|
import { Module, forwardRef } from '@nestjs/common';
|
||||||
// import { PaymentsService } from './services/payments.service';
|
|
||||||
import { MikroOrmModule } from '@mikro-orm/nestjs';
|
import { MikroOrmModule } from '@mikro-orm/nestjs';
|
||||||
import { PaymentController } from './controllers/payment.controller';
|
import { PaymentController } from './controllers/payment.controller';
|
||||||
import { AuthModule } from '../auth/auth.module';
|
import { AuthModule } from '../auth/auth.module';
|
||||||
@@ -11,8 +10,9 @@ import { PaymentRepository } from './repositories/payment.repository';
|
|||||||
import { PaymentListeners } from './listeners/payment.listeners';
|
import { PaymentListeners } from './listeners/payment.listeners';
|
||||||
import { AdminModule } from '../admin/admin.module';
|
import { AdminModule } from '../admin/admin.module';
|
||||||
import { NotificationsModule } from '../notification/notifications.module';
|
import { NotificationsModule } from '../notification/notifications.module';
|
||||||
// import { OrderModule } from '../order/order.module';
|
|
||||||
import { UserModule } from '../user/user.module';
|
import { UserModule } from '../user/user.module';
|
||||||
|
import { PaymentService } from './services/payments.service';
|
||||||
|
import { InvoiceModule } from '../invoice/invoice.module';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -21,12 +21,12 @@ import { UserModule } from '../user/user.module';
|
|||||||
JwtModule,
|
JwtModule,
|
||||||
AdminModule,
|
AdminModule,
|
||||||
NotificationsModule,
|
NotificationsModule,
|
||||||
// forwardRef(() => OrderModule),
|
forwardRef(() => InvoiceModule),
|
||||||
UserModule
|
UserModule
|
||||||
],
|
],
|
||||||
controllers: [PaymentController],
|
controllers: [PaymentController],
|
||||||
providers: [
|
providers: [
|
||||||
// PaymentService,
|
PaymentService,
|
||||||
PaymentRepository,
|
PaymentRepository,
|
||||||
ZarinpalGateway,
|
ZarinpalGateway,
|
||||||
GatewayManager,
|
GatewayManager,
|
||||||
@@ -34,7 +34,7 @@ import { UserModule } from '../user/user.module';
|
|||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
PaymentRepository,
|
PaymentRepository,
|
||||||
// PaymentService,
|
PaymentService,
|
||||||
// PaymentGatewayService,
|
// PaymentGatewayService,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ export class PaymentService {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly em: EntityManager,
|
private readonly em: EntityManager,
|
||||||
private readonly orderService: OrderService,
|
|
||||||
private readonly paymentRepository: PaymentRepository,
|
private readonly paymentRepository: PaymentRepository,
|
||||||
private readonly gatewayManager: GatewayManager,
|
private readonly gatewayManager: GatewayManager,
|
||||||
private readonly eventEmitter: EventEmitter2,
|
private readonly eventEmitter: EventEmitter2,
|
||||||
|
|||||||
@@ -102,12 +102,17 @@ export class RequestService {
|
|||||||
.filter(Boolean),
|
.filter(Boolean),
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
console.log(fieldIds);
|
||||||
|
|
||||||
if (fieldIds.length === 0) return;
|
if (fieldIds.length === 0) return;
|
||||||
|
|
||||||
const fields = await this.fieldRepository.find(
|
const fields = await this.fieldRepository.find(
|
||||||
{ id: { $in: fieldIds } },
|
{ id: { $in: fieldIds } },
|
||||||
{ populate: ['options'] },
|
{ populate: ['options'] },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log('fields',fields)
|
||||||
|
|
||||||
const fieldMap = new Map(fields.map((f) => [f.id, f]));
|
const fieldMap = new Map(fields.map((f) => [f.id, f]));
|
||||||
|
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export const rolesData: RoleConfig[] = [
|
|||||||
name: 'designer',
|
name: 'designer',
|
||||||
title: 'طراح',
|
title: 'طراح',
|
||||||
isSystem: true,
|
isSystem: true,
|
||||||
permissionFilter: (name: PermissionEnum) => [PermissionEnum.VIEW_MY_ASSIGNED_INVOICED_REQUESTS].includes(name)
|
permissionFilter: (name: PermissionEnum) => [PermissionEnum.VIEW_ASSIGNED_ORDERS].includes(name)
|
||||||
},
|
},
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user