import { ApiHideProperty, ApiProperty } from '@nestjs/swagger'; import { Column, Entity, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToMany, Relation } from 'typeorm'; import { CommonEntity } from '~/common/entity/common.entity'; import { Storage } from '~/modules/tools/storage/storage.entity'; import { SaleQuotationComponentEntity } from '../component/sale_quotation_component.entity'; /** * 报价分组实体类 */ @Entity({ name: 'sale_quotation_group' }) export class SaleQuotationGroupEntity extends CommonEntity { @Column({ name: 'name', type: 'varchar', unique: true, length: 255, comment: '报价分组名称' }) @ApiProperty({ description: '报价分组名称' }) name: string; @Column({ name: 'is_delete', type: 'tinyint', default: 0, comment: '是否删除' }) @ApiProperty({ description: '删除状态:0未删除,1已删除' }) isDelete: number; @ManyToMany(() => SaleQuotationComponentEntity, component => component.groups) @JoinTable({ name: 'sale_quotation_group_component', joinColumn: { name: 'group_id', referencedColumnName: 'id' }, inverseJoinColumn: { name: 'component_id', referencedColumnName: 'id' } }) components: Relation; }