feat: multi-tier agent hierarchy, wallet ledger, and player UX polish
Add configurable agent max level and default sub-agent credit ratio, per-agent block direct player login on suspend, admin/agent wallet transaction views, and match detail my-bets section with refreshed player card styling. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -62,15 +62,20 @@ export class AuthService {
|
||||
}
|
||||
|
||||
if (portal === 'player' && user.parentId) {
|
||||
const agentSettings = await this.systemConfig.getAgentSuspendSettings();
|
||||
if (agentSettings.suspendBlockPlayerLogin) {
|
||||
const parentAgent = await this.prisma.user.findUnique({
|
||||
where: { id: user.parentId },
|
||||
select: { userType: true, status: true },
|
||||
});
|
||||
if (parentAgent?.userType === 'AGENT' && parentAgent.status !== 'ACTIVE') {
|
||||
throw appForbidden('PARENT_AGENT_SUSPENDED');
|
||||
}
|
||||
const parentAgent = await this.prisma.user.findUnique({
|
||||
where: { id: user.parentId },
|
||||
select: {
|
||||
userType: true,
|
||||
status: true,
|
||||
agentProfile: { select: { blockDirectPlayerLogin: true } },
|
||||
},
|
||||
});
|
||||
if (
|
||||
parentAgent?.userType === 'AGENT' &&
|
||||
parentAgent.status !== 'ACTIVE' &&
|
||||
parentAgent.agentProfile?.blockDirectPlayerLogin
|
||||
) {
|
||||
throw appForbidden('PARENT_AGENT_SUSPENDED');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user