feat: 정지·종료 기수의 장수 참여를 허용하고 확정 기록 보호
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import type { DatabaseClient } from '@sammo-ts/infra';
|
||||
|
||||
/** 통일 대기/이민족전으로 시계가 재개되어도 확정된 기수의 기록은 다시 열지 않는다. */
|
||||
export const areSeasonRecordsFinalized = async (
|
||||
db: Pick<DatabaseClient, 'gameHistory'>,
|
||||
serverId: unknown
|
||||
): Promise<boolean> => {
|
||||
if (typeof serverId !== 'string' || !serverId.trim()) return false;
|
||||
const history = await db.gameHistory.findUnique({
|
||||
where: { serverId: serverId.trim() },
|
||||
select: { status: true },
|
||||
});
|
||||
return history?.status === 'COMPLETED';
|
||||
};
|
||||
Reference in New Issue
Block a user