76 lines
1.4 KiB
TypeScript
76 lines
1.4 KiB
TypeScript
export interface Role {
|
|
id: string;
|
|
name: string;
|
|
code: string;
|
|
description?: string;
|
|
scope: 'platform' | 'tenant' | 'module';
|
|
is_system?: boolean;
|
|
tenant_id?: string | null;
|
|
module_ids?: string[] | null;
|
|
modules?: string[] | null;
|
|
permissions?: Permission[] | null;
|
|
created_at: string;
|
|
updated_at: string;
|
|
}
|
|
|
|
export interface Pagination {
|
|
page: number;
|
|
limit: number;
|
|
total: number;
|
|
totalPages: number;
|
|
hasMore: boolean;
|
|
}
|
|
|
|
export interface RolesResponse {
|
|
success: boolean;
|
|
data: Role[];
|
|
pagination: Pagination;
|
|
}
|
|
|
|
export interface Permission {
|
|
resource: string;
|
|
action: string;
|
|
}
|
|
|
|
export interface CreateRoleRequest {
|
|
name: string;
|
|
code: string;
|
|
description: string;
|
|
tenant_id?: string | null;
|
|
module_ids?: string[] | null;
|
|
modules?: string[] | null;
|
|
permissions?: Permission[] | null;
|
|
}
|
|
|
|
export interface CreateRoleResponse {
|
|
success: boolean;
|
|
data: Role;
|
|
message?: string;
|
|
}
|
|
|
|
export interface GetRoleResponse {
|
|
success: boolean;
|
|
data: Role;
|
|
}
|
|
|
|
export interface UpdateRoleRequest {
|
|
name: string;
|
|
code: string;
|
|
description: string;
|
|
tenant_id?: string | null;
|
|
module_ids?: string[] | null;
|
|
modules?: string[] | null;
|
|
permissions?: Permission[] | null;
|
|
}
|
|
|
|
export interface UpdateRoleResponse {
|
|
success: boolean;
|
|
data: Role;
|
|
message?: string;
|
|
}
|
|
|
|
export interface DeleteRoleResponse {
|
|
success: boolean;
|
|
message?: string;
|
|
}
|