fix: close competition cutover integrity gaps

This commit is contained in:
dahyeon committed 2026-07-12 21:22:22 +00:00
1 parent 7ea2002975
commit 683d602d63
57 files changed
+4805 -1582

No files matched your search

@@ -8,6 +8,7 @@ import {
CompetitionFact,
CompetitionOutbox,
TournamentCodeAssignment,
applyCompetitionDomainInvariantIndexes,
competitionModelDefinitions,
} from '../../competition/competition.schema';
import { ModelDefinition } from './types';
@@ -465,6 +466,7 @@ export interface TournamentCode extends MongooseTimestamps {
reservedAt?: Date;
usedAt?: Date;
releasedAt?: Date;
voidedAt?: Date;
riotMatchId?: string;
uploadedBy: mongoose.Types.ObjectId;
uploadedAt: Date;
@@ -1501,6 +1503,7 @@ export const TournamentCodeSchema = new Schema<TournamentCode>(
reservedAt: { type: Date },
usedAt: { type: Date },
releasedAt: { type: Date },
voidedAt: { type: Date },
riotMatchId: { type: String },
uploadedBy: { type: Schema.Types.ObjectId, ref: 'user', required: true },
uploadedAt: { type: Date, required: true, default: Date.now },
@@ -1952,13 +1955,7 @@ export const MatchSchema = new Schema<Match>(
);
MatchSchema.index({ communityId: 1, scheduledAt: -1 });
MatchSchema.index(
{ competitionId: 1 },
{
unique: true,
partialFilterExpression: { competitionId: { $type: 'objectId' } },
},
);
applyCompetitionDomainInvariantIndexes(MatchSchema, 'match');
MatchSchema.index({ communityId: 1, status: 1, scheduledAt: -1 });
MatchSchema.index(
{ communityId: 1, shortCode: 1 },