Allow a collective to disable the integration endpoint

This commit is contained in:
Eike Kettner
2020-05-23 13:53:36 +02:00
parent f74f8e5198
commit f16632bc7f
14 changed files with 138 additions and 71 deletions

View File

@ -14,7 +14,7 @@ trait OCollective[F[_]] {
def find(name: Ident): F[Option[RCollective]]
def updateLanguage(collective: Ident, lang: Language): F[AddResult]
def updateSettings(collective: Ident, lang: OCollective.Settings): F[AddResult]
def listUser(collective: Ident): F[Vector[RUser]]
@ -45,6 +45,9 @@ object OCollective {
type InsightData = QCollective.InsightData
val insightData = QCollective.InsightData
type Settings = RCollective.Settings
val Settings = RCollective.Settings
sealed trait PassChangeResult
object PassChangeResult {
case object UserNotFound extends PassChangeResult
@ -85,9 +88,9 @@ object OCollective {
def find(name: Ident): F[Option[RCollective]] =
store.transact(RCollective.findById(name))
def updateLanguage(collective: Ident, lang: Language): F[AddResult] =
def updateSettings(collective: Ident, sett: Settings): F[AddResult] =
store
.transact(RCollective.updateLanguage(collective, lang))
.transact(RCollective.updateSettings(collective, sett))
.attempt
.map(AddResult.fromUpdate)

View File

@ -88,7 +88,13 @@ object OSignup {
for {
id2 <- Ident.randomId[F]
now <- Timestamp.current[F]
c = RCollective(data.collName, CollectiveState.Active, Language.German, now)
c = RCollective(
data.collName,
CollectiveState.Active,
Language.German,
true,
now
)
u = RUser(
id2,
data.login,