feat: 예약 오픈 일정을 빌드 전에 공개

초기화 예약의 공개 선택을 operation payload에 저장하고 로비에서 준비 단계별로 표시합니다. RESERVED 인계와 STOPPED 무요청 경계를 테스트합니다.
This commit is contained in:
2026-08-23 13:59:31 +00:00
parent 4b97088d69
commit 14ffa76c49
9 changed files with 645 additions and 26 deletions
@@ -158,7 +158,12 @@ export interface GatewayProfileRepository {
updateLastError(profileName: string, lastError: string | null): Promise<void>;
updateWorkspaceUsage(profileName: string, workspace: string, lastUsedAt: string): Promise<void>;
clearWorkspaceUsage(profileNames: string[]): Promise<void>;
listOperations(options?: { profileName?: string; limit?: number }): Promise<GatewayOperationRecord[]>;
listOperations(options?: {
profileName?: string;
statuses?: GatewayOperationStatus[];
types?: GatewayOperationType[];
limit?: number;
}): Promise<GatewayOperationRecord[]>;
listActiveOperationProfileNames?(now: Date): Promise<string[]>;
getOperation(id: string): Promise<GatewayOperationRecord | null>;
listOperationLogs(id: string, afterCursor?: string, limit?: number): Promise<GatewayOperationLogRecord[]>;
@@ -546,9 +551,21 @@ export const createGatewayProfileRepository = (prisma: GatewayPrismaClient): Gat
},
});
},
async listOperations(options?: { profileName?: string; limit?: number }): Promise<GatewayOperationRecord[]> {
async listOperations(options?: {
profileName?: string;
statuses?: GatewayOperationStatus[];
types?: GatewayOperationType[];
limit?: number;
}): Promise<GatewayOperationRecord[]> {
const rows = await prisma.gatewayOperation.findMany({
where: options?.profileName ? { profileName: options.profileName } : undefined,
where:
options?.profileName || options?.statuses?.length || options?.types?.length
? {
...(options.profileName ? { profileName: options.profileName } : {}),
...(options.statuses?.length ? { status: { in: options.statuses } } : {}),
...(options.types?.length ? { type: { in: options.types } } : {}),
}
: undefined,
orderBy: { createdAt: 'desc' },
take: Math.min(Math.max(options?.limit ?? 50, 1), 200),
});