chore: import DH V2 D5.6.4 production baseline
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
import { Column, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { TimestampedEntity } from './timestamped.entity';
|
||||
|
||||
export enum AssetAttributeDataType {
|
||||
TEXT = 'TEXT',
|
||||
NUMBER = 'NUMBER',
|
||||
BOOLEAN = 'BOOLEAN',
|
||||
DATE = 'DATE',
|
||||
DATETIME = 'DATETIME',
|
||||
SELECT = 'SELECT',
|
||||
}
|
||||
|
||||
@Entity({ name: 'asset_attribute_definitions' })
|
||||
@Index('idx_asset_attribute_definitions_type', ['assetTypeId', 'sortOrder'])
|
||||
@Index('idx_asset_attribute_definitions_active', ['isActive'])
|
||||
export class AssetAttributeDefinition extends TimestampedEntity {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id!: string;
|
||||
|
||||
@Column({ name: 'asset_type_id', type: 'uuid' })
|
||||
assetTypeId!: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 80 })
|
||||
code!: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 160 })
|
||||
name!: string;
|
||||
|
||||
@Column({
|
||||
name: 'data_type',
|
||||
type: 'enum',
|
||||
enum: AssetAttributeDataType,
|
||||
enumName: 'asset_attribute_data_type',
|
||||
})
|
||||
dataType!: AssetAttributeDataType;
|
||||
|
||||
@Column({ name: 'is_required', type: 'boolean', default: false })
|
||||
isRequired!: boolean;
|
||||
|
||||
@Column({ name: 'is_active', type: 'boolean', default: true })
|
||||
isActive!: boolean;
|
||||
|
||||
@Column({ type: 'varchar', length: 40, nullable: true })
|
||||
unit!: string | null;
|
||||
|
||||
@Column({ type: 'jsonb', nullable: true })
|
||||
options!: string[] | null;
|
||||
|
||||
@Column({ name: 'sort_order', type: 'integer', default: 0 })
|
||||
sortOrder!: number;
|
||||
}
|
||||
Reference in New Issue
Block a user