mirror of
https://github.com/xCyanGrizzly/DragonsStash.git
synced 2026-05-10 22:01:16 +00:00
feat: add isPremium field to TelegramAccount
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "telegram_accounts" ADD COLUMN "isPremium" BOOLEAN NOT NULL DEFAULT false;
|
||||||
@@ -406,6 +406,7 @@ model TelegramAccount {
|
|||||||
isActive Boolean @default(true)
|
isActive Boolean @default(true)
|
||||||
authState AuthState @default(PENDING)
|
authState AuthState @default(PENDING)
|
||||||
authCode String?
|
authCode String?
|
||||||
|
isPremium Boolean @default(false)
|
||||||
lastSeenAt DateTime?
|
lastSeenAt DateTime?
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
|
|||||||
@@ -308,6 +308,16 @@ export async function updateAccountAuthState(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function updateAccountPremiumStatus(
|
||||||
|
accountId: string,
|
||||||
|
isPremium: boolean
|
||||||
|
): Promise<void> {
|
||||||
|
await db.telegramAccount.update({
|
||||||
|
where: { id: accountId },
|
||||||
|
data: { isPremium },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export async function getAccountAuthCode(accountId: string) {
|
export async function getAccountAuthCode(accountId: string) {
|
||||||
const account = await db.telegramAccount.findUnique({
|
const account = await db.telegramAccount.findUnique({
|
||||||
where: { id: accountId },
|
where: { id: accountId },
|
||||||
|
|||||||
Reference in New Issue
Block a user