Skip to content

Commit

Permalink
ORV2-3258 DB Model Relationship between ORBC_RECEIPT and ORBC_TRANSAC…
Browse files Browse the repository at this point in the history
…TION in Scheduler (#1743)
  • Loading branch information
praju-aot authored Jan 14, 2025
1 parent 2219e3e commit 6175b55
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
4 changes: 3 additions & 1 deletion scheduler/src/modules/cgi-sftp/cgi-sftp.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
13 changes: 3 additions & 10 deletions scheduler/src/modules/permit/entities/receipt.entity.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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[];
}
8 changes: 5 additions & 3 deletions scheduler/src/modules/permit/entities/transaction.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 6175b55

Please sign in to comment.