Skip to content

Commit

Permalink
refactor: remove notifications settings and sport ID
Browse files Browse the repository at this point in the history
  • Loading branch information
evermake committed Mar 31, 2024
1 parent 81bc03b commit 4cddf44
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 39 deletions.
1 change: 0 additions & 1 deletion backend/src/bot/plugins/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const install: InstallFn<DomainFlavor, DomainOptions> = (bot, { domain })
username: ctx.from.username,
firstName: ctx.from.first_name,
lastName: ctx.from.last_name,
notificationPreferences: { classes: [] },
})
}
return next()
Expand Down
3 changes: 2 additions & 1 deletion backend/src/domain/schemas/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './notifications'
export * from './common'
export * from './user'
28 changes: 0 additions & 28 deletions backend/src/domain/schemas/notifications.ts

This file was deleted.

2 changes: 0 additions & 2 deletions backend/src/domain/schemas/user.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { z } from 'zod'
import { Language } from './common'
import { NotificationPreferences } from './notifications'

export const User = z.object({
telegramId: z.coerce.number().int(),
Expand All @@ -9,6 +8,5 @@ export const User = z.object({
firstName: z.string(),
lastName: z.string().nullable(),
language: Language.nullable(),
notificationPreferences: NotificationPreferences,
})
export type User = z.infer<typeof User>
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ CREATE TABLE "User" (
"firstName" TEXT NOT NULL,
"lastName" TEXT,
"language" TEXT,
"sportId" INTEGER,
"notificationPreferences" JSONB NOT NULL,

CONSTRAINT "User_pkey" PRIMARY KEY ("telegramId")
);
5 changes: 0 additions & 5 deletions backend/src/services/database/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,4 @@ model User {
// Interface language user prefers as ISO 639-1 language code
// or null if user did not specify it.
language String?
// User's ID in the InnoSport API.
sportId Int?
notificationPreferences Json
}

0 comments on commit 4cddf44

Please sign in to comment.