251211:1314 Frontend: reeactor Admin panel
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { BaseEntity } from '../../../common/entities/base.entity';
|
||||
|
||||
/**
|
||||
* OrganizationRole Entity
|
||||
* Represents the role/type of an organization in the system
|
||||
* (OWNER, DESIGNER, CONSULTANT, CONTRACTOR, THIRD_PARTY)
|
||||
*
|
||||
* Schema reference: organization_roles table (lines 205-211 in schema SQL)
|
||||
*/
|
||||
@Entity('organization_roles')
|
||||
export class OrganizationRole extends BaseEntity {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column({
|
||||
name: 'role_name',
|
||||
length: 20,
|
||||
unique: true,
|
||||
comment: 'Role name (OWNER, DESIGNER, CONSULTANT, CONTRACTOR, THIRD_PARTY)'
|
||||
})
|
||||
roleName!: string;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
import {
|
||||
Entity,
|
||||
Column,
|
||||
PrimaryGeneratedColumn,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
Index,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from 'typeorm';
|
||||
import { OrganizationRole } from './organization-role.entity';
|
||||
|
||||
@Entity('organizations')
|
||||
export class Organization {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column({ name: 'organization_code', length: 20, unique: true })
|
||||
@Index('idx_org_code')
|
||||
organizationCode!: string;
|
||||
|
||||
@Column({ name: 'organization_name', length: 255 })
|
||||
organizationName!: string;
|
||||
|
||||
@Column({ name: 'role_id', nullable: true })
|
||||
roleId?: number;
|
||||
|
||||
@Column({ name: 'is_active', default: true })
|
||||
isActive!: boolean;
|
||||
|
||||
@CreateDateColumn({ name: 'created_at' })
|
||||
createdAt!: Date;
|
||||
|
||||
@UpdateDateColumn({ name: 'updated_at' })
|
||||
updatedAt!: Date;
|
||||
|
||||
@DeleteDateColumn({ name: 'deleted_at' })
|
||||
deletedAt!: Date;
|
||||
|
||||
// Relations
|
||||
@ManyToOne(() => OrganizationRole, { nullable: true })
|
||||
@JoinColumn({ name: 'role_id' })
|
||||
organizationRole?: OrganizationRole;
|
||||
}
|
||||
Reference in New Issue
Block a user