Add business team access controls and customer role filters.

Super-admins can assign Admin; owners/admins manage Editor/Viewer via team/access, and the customers list supports all/customers/managers filtering.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-10 21:31:28 +03:30
co-authored by Cursor
parent 2c4d02bd0e
commit e59db25814
8 changed files with 334 additions and 12 deletions
@@ -0,0 +1,17 @@
import { IsIn, IsOptional, IsString, Matches, ValidateIf } from 'class-validator';
import { ASSIGNABLE_TEAM_ROLES } from '../../auth/auth.types';
export class AssignTeamAccessDto {
@IsString()
@Matches(/^\d+$/)
userId!: string;
@IsString()
@IsIn(['customer', 'staff'])
access!: 'customer' | 'staff';
@ValidateIf((dto: AssignTeamAccessDto) => dto.access === 'staff')
@IsString()
@IsIn([...ASSIGNABLE_TEAM_ROLES])
roleSlug?: string;
}