/* * 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 '@fluxer/api/src/BrandedTypes'; import type {ExactRow} from '@fluxer/api/src/database/types/DatabaseRowTypes'; import type {GiftCodeRow, PaymentBySubscriptionRow, PaymentRow} from '@fluxer/api/src/database/types/PaymentTypes'; import type {PushSubscriptionRow, RecentMentionRow} from '@fluxer/api/src/database/types/UserTypes'; import type {GiftCode} from '@fluxer/api/src/models/GiftCode'; import type {Payment} from '@fluxer/api/src/models/Payment'; import type {PushSubscription} from '@fluxer/api/src/models/PushSubscription'; import type {RecentMention} from '@fluxer/api/src/models/RecentMention'; import type {SavedMessage} from '@fluxer/api/src/models/SavedMessage'; import type {VisionarySlot} from '@fluxer/api/src/models/VisionarySlot'; 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: ExactRow): 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; createGiftCode(data: ExactRow): 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: ExactRow): 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; }