ProfileCreator.kt 542 Bytes
Newer Older
Julien Topçu's avatar
Julien Topçu committed
1 2 3 4 5 6 7 8 9 10 11 12 13
package org.craftsrecords.talkadvisor.recommendation.profile

import org.craftsrecords.talkadvisor.recommendation.api.CreateProfile
import org.craftsrecords.talkadvisor.recommendation.preferences.Preferences
import org.craftsrecords.talkadvisor.recommendation.spi.Profiles

class ProfileCreator(val profiles: Profiles) : CreateProfile {
    override fun forUserWithPreferences(userId: String, preferences: Preferences): Profile {
        val profile = Profile(userId, preferences)
        profiles.save(profile)
        return profile
    }
}