diff --git a/libs/wire-api/src/Wire/API/Team/Feature.hs b/libs/wire-api/src/Wire/API/Team/Feature.hs index 9a349ed97d..7da702db99 100644 --- a/libs/wire-api/src/Wire/API/Team/Feature.hs +++ b/libs/wire-api/src/Wire/API/Team/Feature.hs @@ -309,11 +309,11 @@ modelForTeamFeature TeamFeatureSSO = modelTeamFeatureStatusNoConfig modelForTeamFeature TeamFeatureSearchVisibility = modelTeamFeatureStatusNoConfig modelForTeamFeature TeamFeatureValidateSAMLEmails = modelTeamFeatureStatusNoConfig modelForTeamFeature TeamFeatureDigitalSignatures = modelTeamFeatureStatusNoConfig -modelForTeamFeature name@TeamFeatureAppLock = modelTeamFeatureStatusWithConfig name modelTeamFeatureAppLockConfig modelPaymentStatus +modelForTeamFeature name@TeamFeatureAppLock = modelTeamFeatureStatusWithConfig name modelTeamFeatureAppLockConfig modelForTeamFeature TeamFeatureFileSharing = modelTeamFeatureStatusNoConfig -modelForTeamFeature name@TeamFeatureClassifiedDomains = modelTeamFeatureStatusWithConfig name modelTeamFeatureClassifiedDomainsConfig modelPaymentStatus +modelForTeamFeature name@TeamFeatureClassifiedDomains = modelTeamFeatureStatusWithConfig name modelTeamFeatureClassifiedDomainsConfig modelForTeamFeature TeamFeatureConferenceCalling = modelTeamFeatureStatusNoConfig -modelForTeamFeature name@TeamFeatureSelfDeletingMessages = modelTeamFeatureStatusWithConfig name modelTeamFeatureSelfDeletingMessagesConfig modelPaymentStatus +modelForTeamFeature name@TeamFeatureSelfDeletingMessages = modelTeamFeatureStatusWithConfig name modelTeamFeatureSelfDeletingMessagesConfig ---------------------------------------------------------------------- -- TeamFeatureStatusNoConfig @@ -353,12 +353,12 @@ data TeamFeatureStatusWithConfig (cfg :: *) = TeamFeatureStatusWithConfig instance Arbitrary cfg => Arbitrary (TeamFeatureStatusWithConfig cfg) where arbitrary = TeamFeatureStatusWithConfig <$> arbitrary <*> arbitrary <*> arbitrary -modelTeamFeatureStatusWithConfig :: TeamFeatureName -> Doc.Model -> Doc.Model -> Doc.Model -modelTeamFeatureStatusWithConfig name cfgModel paymentStatusModel = Doc.defineModel (cs $ show name) $ do +modelTeamFeatureStatusWithConfig :: TeamFeatureName -> Doc.Model -> Doc.Model +modelTeamFeatureStatusWithConfig name cfgModel = Doc.defineModel (cs $ show name) $ do Doc.description $ "Status and config of " <> cs (show name) Doc.property "status" typeTeamFeatureStatusValue $ Doc.description "status" Doc.property "config" (Doc.ref cfgModel) $ Doc.description "config" - Doc.property "paymentStatus" (Doc.ref paymentStatusModel) $ Doc.description "payment status" + Doc.property "paymentStatus" typePaymentStatusValue $ Doc.optional >> Doc.description "payment status" instance ToSchema cfg => ToSchema (TeamFeatureStatusWithConfig cfg) where schema = diff --git a/services/galley/src/Galley/API/Internal.hs b/services/galley/src/Galley/API/Internal.hs index 54f4a6a7fa..f6ec5c3b99 100644 --- a/services/galley/src/Galley/API/Internal.hs +++ b/services/galley/src/Galley/API/Internal.hs @@ -317,7 +317,7 @@ servantSitemap = iTeamFeatureStatusConferenceCallingGet = iGetTeamFeature @'Public.TeamFeatureConferenceCalling Features.getConferenceCallingInternal, iTeamFeatureStatusSelfDeletingMessagesPut = iPutTeamFeature @'Public.TeamFeatureSelfDeletingMessages Features.setSelfDeletingMessagesInternal, iTeamFeatureStatusSelfDeletingMessagesGet = iGetTeamFeature @'Public.TeamFeatureSelfDeletingMessages Features.getSelfDeletingMessagesInternal, - iTeamFeaturePaymentStatusSelfDeletingMessagesPut = Features.setPaymentStatus @'Public.TeamFeatureSelfDeletingMessages (Features.setPaymentStatusInternal @'Public.TeamFeatureSelfDeletingMessages), + iTeamFeaturePaymentStatusSelfDeletingMessagesPut = Features.setPaymentStatus @'Public.TeamFeatureSelfDeletingMessages, iDeleteUser = rmUser, iConnect = Create.createConnectConversation, iUpsertOne2OneConversation = One2One.iUpsertOne2OneConversation diff --git a/services/galley/src/Galley/API/Teams/Features.hs b/services/galley/src/Galley/API/Teams/Features.hs index 9d6aa6777d..3401b4c6d0 100644 --- a/services/galley/src/Galley/API/Teams/Features.hs +++ b/services/galley/src/Galley/API/Teams/Features.hs @@ -39,7 +39,6 @@ module Galley.API.Teams.Features getConferenceCallingInternal, setConferenceCallingInternal, getSelfDeletingMessagesInternal, - setPaymentStatusInternal, setSelfDeletingMessagesInternal, setPaymentStatus, DoAuth (..), @@ -151,22 +150,22 @@ setFeatureStatus setter doauth tid status = do setPaymentStatus :: forall (a :: Public.TeamFeatureName) r. ( Public.KnownTeamFeatureName a, - HasPaymentStatusCol a, + MaybeHasPaymentStatusCol a, Members [ Error ActionError, Error TeamError, Error NotATeamMember, - TeamStore + TeamStore, + TeamFeatureStore ] r ) => - (TeamId -> Public.PaymentStatusValue -> Sem r Public.PaymentStatus) -> TeamId -> Public.PaymentStatusValue -> Sem r Public.PaymentStatus -setPaymentStatus setter tid paymentStatusUpdate = do +setPaymentStatus tid paymentStatusUpdate = do assertTeamExists tid - setter tid paymentStatusUpdate + TeamFeatures.setPaymentStatus @a tid (Public.PaymentStatus paymentStatusUpdate) -- | For individual users to get feature config for their account (personal or team). getFeatureConfig :: @@ -590,15 +589,6 @@ getSelfDeletingMessagesInternal = \case TeamFeatures.getSelfDeletingMessagesStatus tid <&> fromMaybe Public.defaultSelfDeletingMessagesStatus -setPaymentStatusInternal :: - forall (a :: Public.TeamFeatureName) r. - (MaybeHasPaymentStatusCol a, Member TeamFeatureStore r) => - TeamId -> - Public.PaymentStatusValue -> - Sem r Public.PaymentStatus -setPaymentStatusInternal tid paymentStatus = - TeamFeatures.setPaymentStatus @a tid (Public.PaymentStatus paymentStatus) - setSelfDeletingMessagesInternal :: Members '[GundeckAccess, TeamFeatureStore, TeamStore, P.TinyLog] r => TeamId ->