690514:2019 204-rfa-approval-refactor #01
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
// File: backend/src/modules/user/entities/role.entity.ts
|
||||
// Change Log:
|
||||
// - v1.9.0 (2026-05-13): เพิ่ม publicId (uuid) column ตาม delta-11 + ADR-019
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
@@ -6,7 +9,9 @@ import {
|
||||
JoinTable,
|
||||
} from 'typeorm';
|
||||
import { Permission } from './permission.entity';
|
||||
import { UuidBaseEntity } from '../../../common/entities/uuid-base.entity';
|
||||
|
||||
/** ขอบเขตของบทบาท */
|
||||
export enum RoleScope {
|
||||
GLOBAL = 'Global',
|
||||
ORGANIZATION = 'Organization',
|
||||
@@ -14,8 +19,15 @@ export enum RoleScope {
|
||||
CONTRACT = 'Contract',
|
||||
}
|
||||
|
||||
/**
|
||||
* Entity สำหรับตาราง roles
|
||||
*
|
||||
* @remarks
|
||||
* - Internal PK: roleId (INT) — ห้าม expose ใน API (ADR-019)
|
||||
* - Public ID: publicId (UUID) — ใช้ใน API Response และ distribution_recipients (delta-11)
|
||||
*/
|
||||
@Entity('roles')
|
||||
export class Role {
|
||||
export class Role extends UuidBaseEntity {
|
||||
@PrimaryGeneratedColumn({ name: 'role_id' })
|
||||
roleId!: number;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user