hrms-api-org/src/entities/ApiAttribute.ts

40 lines
895 B
TypeScript
Raw Normal View History

2025-08-07 13:05:58 +07:00
import { ApiName } from "./ApiName";
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
@Entity("apiAttribute")
export class ApiAttribute extends EntityBase {
@Column({
nullable: false,
comment: "ชื่อตาราง",
length: 50,
})
tbName: string;
@Column({
nullable: false,
comment: "คีย์ของแอตทริบิวต์",
length: 255,
})
propertyKey: string;
@Column({
nullable: false,
comment: "ลำดับการแสดงผล",
default: 0,
type: "int",
})
ordering: number;
@Column({
nullable: false,
comment: "ไอดีของ API Name",
length: 36, // UUID length
})
apiNameId: string;
@ManyToOne(() => ApiName, (apiName) => apiName.apiAttributes)
@JoinColumn({ name: "apiNameId" })
apiName: ApiName;
}