|
|
@@ -1,4 +1,4 @@
|
|
|
-import { Entity, PrimaryGeneratedColumn, Column, Index, ForeignKey, ManyToOne } from 'typeorm';
|
|
|
+import { Entity, PrimaryGeneratedColumn, Column, Index, ForeignKey, ManyToOne, JoinColumn } from 'typeorm';
|
|
|
import { Client } from '../clients/client.entity';
|
|
|
|
|
|
import { z } from '@hono/zod-openapi';
|
|
|
@@ -10,9 +10,10 @@ export class HetongRenew {
|
|
|
id!: number;
|
|
|
|
|
|
@Column({ name: 'contract_id', type: 'int', unsigned: true })
|
|
|
- @ForeignKey(() => Hetong)
|
|
|
contractId!: number;
|
|
|
+
|
|
|
@ManyToOne(() => Hetong, hetong => hetong.renews)
|
|
|
+ @JoinColumn({ name: 'contract_id' })
|
|
|
contract!: Hetong;
|
|
|
|
|
|
@Column({ name: 'amount', type: 'varchar', length: 50, nullable: true })
|