/* * Copyright (C) 2026 Fluxer Contributors * * This file is part of Fluxer. * * Fluxer is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Fluxer is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Fluxer. If not, see . */ import type {ChannelID, MessageID, UserID} from '~/BrandedTypes'; import type { BetaCodeRow, GiftCodeRow, PaymentBySubscriptionRow, PaymentRow, PushSubscriptionRow, RecentMentionRow, } from '~/database/CassandraTypes'; import type {BetaCode, GiftCode, Payment, PushSubscription, RecentMention, SavedMessage, VisionarySlot} from '~/Models'; export interface IUserContentRepository { getRecentMention(userId: UserID, messageId: MessageID): Promise; listRecentMentions( userId: UserID, includeEveryone: boolean, includeRole: boolean, includeGuilds: boolean, limit: number, before?: MessageID, ): Promise>; createRecentMention(mention: RecentMentionRow): Promise; createRecentMentions(mentions: Array): Promise; deleteRecentMention(mention: RecentMention): Promise; deleteAllRecentMentions(userId: UserID): Promise; listSavedMessages(userId: UserID, limit?: number, before?: MessageID): Promise>; createSavedMessage(userId: UserID, channelId: ChannelID, messageId: MessageID): Promise; deleteSavedMessage(userId: UserID, messageId: MessageID): Promise; deleteAllSavedMessages(userId: UserID): Promise; listBetaCodes(creatorId: UserID): Promise>; getBetaCode(code: string): Promise; upsertBetaCode(betaCode: BetaCodeRow): Promise; updateBetaCodeRedeemed(code: string, redeemerId: UserID, redeemedAt: Date): Promise; deleteBetaCode(code: string, creatorId: UserID): Promise; deleteAllBetaCodes(userId: UserID): Promise; createGiftCode(data: GiftCodeRow): Promise; findGiftCode(code: string): Promise; findGiftCodeByPaymentIntent(paymentIntentId: string): Promise; findGiftCodesByCreator(userId: UserID): Promise>; redeemGiftCode(code: string, userId: UserID): Promise<{applied: boolean}>; updateGiftCode(code: string, data: Partial): Promise; linkGiftCodeToCheckoutSession(code: string, checkoutSessionId: string): Promise; listPushSubscriptions(userId: UserID): Promise>; createPushSubscription(data: PushSubscriptionRow): Promise; deletePushSubscription(userId: UserID, subscriptionId: string): Promise; getBulkPushSubscriptions(userIds: Array): Promise>>; deleteAllPushSubscriptions(userId: UserID): Promise; createPayment(data: { checkout_session_id: string; user_id: UserID; price_id: string; product_type: string; status: string; is_gift: boolean; created_at: Date; }): Promise; updatePayment(data: Partial & {checkout_session_id: string}): Promise<{applied: boolean}>; getPaymentByCheckoutSession(checkoutSessionId: string): Promise; getPaymentByPaymentIntent(paymentIntentId: string): Promise; getSubscriptionInfo(subscriptionId: string): Promise; listVisionarySlots(): Promise>; expandVisionarySlots(byCount: number): Promise; shrinkVisionarySlots(toCount: number): Promise; reserveVisionarySlot(slotIndex: number, userId: UserID): Promise; unreserveVisionarySlot(slotIndex: number, userId: UserID): Promise; }