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

34 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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[]>;
}