fix(rbac): Make role.slug NOT NULL to match DDL
- Updated role.entity.ts: slug is now required (NOT NULL) - Updated rbac.service.ts: generate slug from code when creating roles - Tenant entity already complete with all DDL fields (no changes needed) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
e2abeaca9c
commit
9baaf4af85
@ -26,9 +26,9 @@ export class Role {
|
|||||||
@Index()
|
@Index()
|
||||||
code: string;
|
code: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 100, nullable: true })
|
@Column({ type: 'varchar', length: 100 })
|
||||||
@Index()
|
@Index()
|
||||||
slug: string | null;
|
slug: string;
|
||||||
|
|
||||||
@Column({ type: 'text', nullable: true })
|
@Column({ type: 'text', nullable: true })
|
||||||
description: string | null;
|
description: string | null;
|
||||||
|
|||||||
@ -38,6 +38,7 @@ export class RbacService {
|
|||||||
tenant_id: tenantId,
|
tenant_id: tenantId,
|
||||||
name: dto.name,
|
name: dto.name,
|
||||||
code: dto.code,
|
code: dto.code,
|
||||||
|
slug: dto.code.toLowerCase().replace(/[^a-z0-9]+/g, '_'),
|
||||||
description: dto.description || null,
|
description: dto.description || null,
|
||||||
is_system: false,
|
is_system: false,
|
||||||
is_active: true,
|
is_active: true,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user