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