oa_based/src/modules/sale_quotation/group/sale_quotation_group.entity.ts

34 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-04-12 09:55:02 +08:00
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<SaleQuotationComponentEntity[]>;
}