Initial commit: Tapalka monorepo (bot, front, strapi)

This commit is contained in:
2026-05-21 11:54:44 +07:00
commit 9ec9485940
208 changed files with 58314 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import { IPlayer } from '@/interfaces/player.type';
export function CalculateReferralsCount(player: IPlayer | null): number {
if (!player) {
return 0;
}
let total = player.attributes.my_referrals.data?.length || 0;
player.attributes.my_referrals?.data?.forEach(referral => {
total += referral.attributes?.my_referrals.data?.length || 0;
});
return total;
}