251211:1314 Frontend: reeactor Admin panel
Spec Validation / validate-markdown (push) Has been cancelled
Spec Validation / validate-diagrams (push) Has been cancelled
Spec Validation / check-todos (push) Has been cancelled

This commit is contained in:
admin
2025-12-11 13:14:15 +07:00
parent c8a0f281ef
commit 3fa28bd14f
79 changed files with 6571 additions and 206 deletions
@@ -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;
}