HEADER v3, primary аккаунты и подтверждения

This commit is contained in:
AidarKC
2026-11-27 12:29:24 +03:00
parent f9e7c4ef94
commit ae430e84c7
89 changed files with 1201 additions and 1596 deletions
+11
View File
@@ -0,0 +1,11 @@
// Только явно заявленный Primary может участвовать в официальных подтверждениях.
export function accountRoleFromHeader(accountType) {
return accountType === 1 ? 'primary' : accountType === 0 ? 'non_voting' : '';
}
export function confirmationRights(actor, target) {
const a = String(actor?.login || '').trim().toLowerCase();
const b = String(target?.login || '').trim().toLowerCase();
const primary = Boolean(a && b && a !== b && actor?.accountRole === 'primary' && target?.accountRole === 'primary');
return { primary, shine: primary && actor?.shineStatus === 'shining' && target?.shineStatus !== 'not_interested' };
}