import type { Material, Post, Tag, Theatre, TheatreComment, TheatreInfo, TheatrePostSelectionWeights, TheatreProgramme, User, WikiPage } from '@/types' export const buildTag = (overrides: Partial = {}): Tag => ({ id: 1, name: 'テストタグ', category: 'general', aliases: [], parents: [], postCount: 12, createdAt: '2026-01-02T03:04:05.000Z', updatedAt: '2026-01-03T03:04:05.000Z', hasWiki: false, materialId: null, hasDeerjikists: false, matchedAlias: null, ...overrides, }) export const buildPost = (overrides: Partial = {}): Post => ({ id: 1, versionNo: 1, url: 'https://example.com/post/1', title: 'テスト投稿', thumbnail: 'https://example.com/thumb.jpg', thumbnailBase: null, tags: [buildTag ()], parentPosts: [], childPosts: [], siblingPosts: {}, viewed: false, related: [], originalCreatedFrom: null, originalCreatedBefore: null, createdAt: '2026-01-02T03:04:05.000Z', updatedAt: '2026-01-03T03:04:05.000Z', uploadedUser: { id: 1, name: 'tester' }, ...overrides, }) export const buildUser = (overrides: Partial = {}): User => ({ id: 1, name: 'tester', inheritanceCode: 'inherit-code', role: 'member', ...overrides, }) export const buildWikiPage = (overrides: Partial = {}): WikiPage => ({ id: 1, title: 'テストWiki', createdUserId: 1, updatedUserId: 1, createdAt: '2026-01-02T03:04:05.000Z', updatedAt: '2026-01-03T03:04:05.000Z', body: '# 本文', revisionId: 10, pred: null, succ: null, ...overrides, }) export const buildMaterial = (overrides: Partial = {}): Material => ({ id: 1, tag: buildTag (), file: null, url: null, wikiPageBody: null, contentType: null, createdAt: '2026-01-02T03:04:05.000Z', createdByUser: { id: 1, name: 'creator' }, updatedAt: '2026-01-03T03:04:05.000Z', updatedByUser: { id: 2, name: 'updater' }, ...overrides, }) export const buildTheatre = (overrides: Partial = {}): Theatre => ({ id: 1, name: 'テスト劇場', opensAt: '2026-01-02T03:04:05.000Z', closesAt: null, createdByUser: { id: 1, name: 'creator' }, createdAt: '2026-01-02T03:04:05.000Z', updatedAt: '2026-01-03T03:04:05.000Z', ...overrides, }) export const buildTheatreInfo = ( overrides: Partial = {}, ): TheatreInfo => ({ hostFlg: false, postId: null, postStartedAt: null, postElapsedMs: null, watchingUsers: [], skipVote: { votesCount: 0, requiredCount: 1, watchingUsersCount: 0, voted: false, }, ...overrides, }) export const buildTheatreComment = ( overrides: Partial = {}, ): TheatreComment => ({ theatreId: 1, no: 1, deleted: false, user: { id: 1, name: 'tester' }, content: 'テストコメント', createdAt: '2026-01-02T03:04:05.000Z', ...overrides, } as TheatreComment) export const buildTheatreProgramme = ( overrides: Partial = {}, ): TheatreProgramme => ({ theatreId: 1, position: 1, post: buildPost (), createdAt: '2026-01-02T03:04:05.000Z', ...overrides, }) export const buildTheatrePostSelectionWeights = ( overrides: Partial = {}, ): TheatrePostSelectionWeights => ({ tagPenalties: [], lightestPosts: [], heaviestPosts: [], ...overrides, })