diff --git a/scheduler/src/modules/cgi-sftp/cgi-sftp.service.ts b/scheduler/src/modules/cgi-sftp/cgi-sftp.service.ts index dd8b5ffd5..5aff21440 100644 --- a/scheduler/src/modules/cgi-sftp/cgi-sftp.service.ts +++ b/scheduler/src/modules/cgi-sftp/cgi-sftp.service.ts @@ -17,7 +17,9 @@ export class CgiSftpService { try { await sftp.connect(connectionInfo); - this.logger.log(`Successfully connected to ${process.env.CFS_SFTP_HOST} via SFTP.`); + this.logger.log( + `Successfully connected to ${process.env.CFS_SFTP_HOST} via SFTP.`, + ); } catch (error) { this.logger.error('Cannot connect to sftp.'); this.logger.error(error); diff --git a/scheduler/src/modules/permit/entities/receipt.entity.ts b/scheduler/src/modules/permit/entities/receipt.entity.ts index 340713eed..c7c68311a 100644 --- a/scheduler/src/modules/permit/entities/receipt.entity.ts +++ b/scheduler/src/modules/permit/entities/receipt.entity.ts @@ -1,11 +1,5 @@ import { ApiProperty } from '@nestjs/swagger'; -import { - Entity, - Column, - PrimaryGeneratedColumn, - OneToOne, - JoinColumn, -} from 'typeorm'; +import { Entity, Column, PrimaryGeneratedColumn, OneToMany } from 'typeorm'; import { AutoMap } from '@automapper/classes'; import { Base } from '../../common/entities/base.entity'; import { Transaction } from './transaction.entity'; @@ -43,7 +37,6 @@ export class Receipt extends Base { }) receiptDocumentId: string; - @OneToOne(() => Transaction, (transaction) => transaction.receipt) - @JoinColumn({ name: 'TRANSACTION_ID' }) - transaction: Transaction; + @OneToMany(() => Transaction, (transaction) => transaction.receipt) + public transactions: Transaction[]; } diff --git a/scheduler/src/modules/permit/entities/transaction.entity.ts b/scheduler/src/modules/permit/entities/transaction.entity.ts index bba716b52..3cc3c3917 100644 --- a/scheduler/src/modules/permit/entities/transaction.entity.ts +++ b/scheduler/src/modules/permit/entities/transaction.entity.ts @@ -3,8 +3,9 @@ import { Entity, Column, PrimaryGeneratedColumn, - OneToOne, OneToMany, + ManyToOne, + JoinColumn, } from 'typeorm'; import { AutoMap } from '@automapper/classes'; import { Base } from '../../common/entities/base.entity'; @@ -222,8 +223,9 @@ export class Transaction extends Base { }) pgMessageText: string; - @OneToOne(() => Receipt, (receipt) => receipt.transaction) - receipt: Receipt; + @ManyToOne(() => Receipt, (receipt) => receipt.transactions) + @JoinColumn({ name: 'RECEIPT_ID' }) + public receipt: Receipt; @OneToMany( () => PermitTransaction,