Unify db type files
Some checks failed
Tests and checks on push / run-checks-and-tests (push) Has been cancelled
Updates translation progress / update-translation-progress-issue (push) Has been cancelled

This commit is contained in:
Kalle
2025-03-21 21:47:08 +02:00
parent 3d5de9e44a
commit c0ec15b7de
115 changed files with 602 additions and 1145 deletions

View File

@@ -1,7 +1,7 @@
import "dotenv/config";
import { sql } from "~/db/sql";
import type { XRankPlacement } from "~/db/types";
import type { Tables } from "~/db/tables";
import { syncXPBadges } from "~/features/badges/queries/syncXPBadges.server";
import { type MainWeaponId, mainWeaponIds } from "~/modules/in-game-lists";
import invariant from "~/utils/invariant";
@@ -17,7 +17,7 @@ invariant(
);
type Placements = Array<
Omit<XRankPlacement, "playerId" | "id"> & { playerSplId: string }
Omit<Tables["XRankPlacement"], "playerId" | "id"> & { playerSplId: string }
>;
const modes = ["splatzones", "towercontrol", "rainmaker", "clamblitz"] as const;

View File

@@ -1,7 +1,7 @@
import "dotenv/config";
import { ordinal } from "openskill";
import { db, sql } from "~/db/sql";
import type { Skill } from "~/db/types";
import type { Tables } from "~/db/tables";
import { TIERS, type TierName } from "~/features/mmr/mmr-constants";
import { freshUserSkills } from "~/features/mmr/tiered.server";
import { addInitialSkill } from "~/features/sendouq/queries/addInitialSkill.server";
@@ -151,13 +151,13 @@ const midPoints = Object.entries(groupedSkills).reduce(
const midPointSkill = skillStm.get({
userId: midPoint.userId,
ordinal: midPoint.ordinal,
}) as Skill;
}) as Tables["Skill"];
invariant(midPointSkill, "midPointSkill not found");
acc[tier as TierName] = midPointSkill;
return acc;
},
{} as Record<TierName, Skill>,
{} as Record<TierName, Tables["Skill"]>,
);
const newSkills = allSkills.map((s) => {