NCBACK-36: [Referral] Referral Service
Test Workflow / test (push) Successful in 3s

This commit is contained in:
milidev
2026-02-05 15:43:42 +07:00
parent 6643070999
commit 27b812b0da
13 changed files with 196 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
package ru.soune
interface ReferralRepo {
fun getUserReferralLink(userId: String): String
fun getUserIdByLink(link: String): String
fun getInviterIdForUser(userId: String): String?
fun getReferralLevelForUser(userId: String): String
fun getReferralByUserId(userId: String): Referral
fun getReferralInvitees(userId: String, pageSize: Int, pageNumber: Int): List<ReferralInvitee>
// создаем новую запись в БД
fun createReferralEntity(entity: Referral)
// прибавить к totalIncome и availableIncome значение transferAmount
fun increaseIncome(userId: String, transferAmount: Int)
// установить active в true
fun activateUser(userId: String): Boolean
// посчитать записи, у которых inviter == userId и active == true
fun getActiveInviteeForUser(userId: String): Int
// посчитать записи, у которых inviter == userId
fun getTotalInviteeForUser(userId: String): Int
fun upgradeReferralLevelForUser(userId: String, newLevelId: String)
}