103 lines
1.5 KiB
TypeScript
103 lines
1.5 KiB
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
CreateDateColumn,
|
|
UpdateDateColumn,
|
|
DeleteDateColumn,
|
|
Index,
|
|
} from 'typeorm';
|
|
|
|
import { Status } from '../types/status';
|
|
|
|
@Entity('fixed_assets')
|
|
export class FixedAssetClassification {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column({
|
|
nullable: false,
|
|
length: 128,
|
|
})
|
|
name: string;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
length: 255,
|
|
})
|
|
description: string;
|
|
|
|
@Column({
|
|
nullable: false,
|
|
length: 64,
|
|
unique: true,
|
|
})
|
|
asset_code: string;
|
|
|
|
@Column({
|
|
nullable: false,
|
|
type: 'decimal',
|
|
precision: 12,
|
|
scale: 2,
|
|
})
|
|
acquisition_cost: number;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
type: 'date',
|
|
})
|
|
acquisition_date: Date;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
type: 'date',
|
|
})
|
|
depreciation_start_date: Date;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
type: 'decimal',
|
|
precision: 5,
|
|
scale: 2,
|
|
})
|
|
depreciation_rate: number;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
type: 'uuid',
|
|
})
|
|
category_id: string;
|
|
|
|
@Index()
|
|
@Column({
|
|
nullable: true,
|
|
type: 'uuid',
|
|
})
|
|
created_by: string;
|
|
|
|
@Index()
|
|
@Column({
|
|
nullable: true,
|
|
type: 'uuid',
|
|
})
|
|
updated_by: string;
|
|
|
|
@Column({
|
|
nullable: false,
|
|
length: 64,
|
|
})
|
|
status: Status;
|
|
|
|
@Column()
|
|
@CreateDateColumn()
|
|
created_at: Date;
|
|
|
|
@Column({ nullable: true })
|
|
@UpdateDateColumn()
|
|
updated_at: Date;
|
|
|
|
@Column({ nullable: true })
|
|
@DeleteDateColumn()
|
|
deleted_at: Date;
|
|
}
|