diff --git a/src/features/tech-log/adapters/http/http-management-gateway.ts b/src/features/tech-log/adapters/http/http-management-gateway.ts index 520cbe4..43313bb 100644 --- a/src/features/tech-log/adapters/http/http-management-gateway.ts +++ b/src/features/tech-log/adapters/http/http-management-gateway.ts @@ -15,6 +15,7 @@ import type { ReleaseIndexPage, ReleaseUpdateRequest, TopicEdit, + TopicVariantEdit, } from "../../contracts/management/contract.ts"; import type { DeletableDocumentKind, @@ -77,6 +78,15 @@ export function createHttpManagementGateway( listTopics: () => run("listStudioTopics", {}), createTopic: (input: TopicEdit) => run("createTopic", input), updateTopic: (id: string, body: TopicEdit) => run("updateTopic", { id, body }), + listTopicVariants: (topicId: string) => + run("listTopicVariants", { id: topicId }), + createTopicVariant: (topicId: string, body: TopicVariantEdit) => + run("createTopicVariant", { id: topicId, body }), + updateTopicVariant: (topicId: string, variantId: string, body: TopicVariantEdit) => + run("updateTopicVariant", { id: topicId, variantId, body }), + deleteTopicVariant: async (topicId: string, variantId: string, expectedVersion: number) => { + await run("deleteTopicVariant", { id: topicId, variantId, expectedVersion }); + }, deleteTopic: async (id: string, expectedVersion: number) => { await run("deleteTopic", { id, expectedVersion }); }, diff --git a/src/features/tech-log/application/ports/management-gateway.ts b/src/features/tech-log/application/ports/management-gateway.ts index 6f411ab..0196fcf 100644 --- a/src/features/tech-log/application/ports/management-gateway.ts +++ b/src/features/tech-log/application/ports/management-gateway.ts @@ -15,6 +15,7 @@ import type { ReleaseIndexPage, ReleaseUpdateRequest, TopicEdit, + TopicVariantEdit, } from "../../contracts/management/contract.ts"; /** @@ -32,6 +33,18 @@ export type ManagementGateway = Readonly<{ createTopic(input: TopicEdit): Promise; updateTopic(id: string, body: TopicEdit): Promise; deleteTopic(id: string, expectedVersion: number): Promise; + /* + 주제 안의 축. 「구조」「조회 전략」처럼 주제마다 이름이 다른 축 하나가 접근 하나고, 기록은 + 거기에 걸린다. 아무 축에도 걸리지 않은 기록은 그 주제의 공통 기록이다. + */ + listTopicVariants(topicId: string): Promise; + createTopicVariant(topicId: string, body: TopicVariantEdit): Promise; + updateTopicVariant( + topicId: string, + variantId: string, + body: TopicVariantEdit, + ): Promise; + deleteTopicVariant(topicId: string, variantId: string, expectedVersion: number): Promise; listProjects(page?: number, size?: number): Promise; /* 홈 「지금 집중하는 것」 편집기가 쓰는 둘. 질문 항목은 `primaryProject` 를 들고 오므로 그것으로 diff --git a/src/features/tech-log/contracts/management/contract.ts b/src/features/tech-log/contracts/management/contract.ts index 7743689..5f916bc 100644 --- a/src/features/tech-log/contracts/management/contract.ts +++ b/src/features/tech-log/contracts/management/contract.ts @@ -3,6 +3,7 @@ import type { components } from "./generated.ts"; type Schemas = components["schemas"]; export type TopicEdit = Schemas["TopicEdit"]; +export type TopicVariantEdit = Schemas["TopicVariantEdit"]; export type ProjectEditResponse = Schemas["ProjectEditResponse"]; export type ProjectIndexItem = Schemas["ProjectIndexItem"]; export type ProjectIndexPage = Schemas["ProjectIndexPage"]; diff --git a/src/features/tech-log/contracts/tech-log-route-contract.ts b/src/features/tech-log/contracts/tech-log-route-contract.ts index 2512be6..08c510b 100644 --- a/src/features/tech-log/contracts/tech-log-route-contract.ts +++ b/src/features/tech-log/contracts/tech-log-route-contract.ts @@ -56,6 +56,7 @@ const TECH_LOG_ROUTE_SPECS = [ defineSpec({ routeId: "TECH_LOG_STUDIO_ASSETS", path: "/studio/assets", layoutGroup: "STUDIO", paramsSchema: null, searchSchema: null, title: "Asset", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_STUDIO_TAXONOMY", path: "/studio/taxonomy", layoutGroup: "STUDIO", paramsSchema: null, searchSchema: null, title: "주제와 프로젝트", navigationLabel: "주제·프로젝트", navigationOrder: 40 }), defineSpec({ routeId: "TECH_LOG_STUDIO_PROJECT_EDIT", path: "/studio/projects/:id", layoutGroup: "STUDIO", paramsSchema: "TechLogDocumentIdParams", searchSchema: null, title: "프로젝트 편집", navigationLabel: null, navigationOrder: null }), + defineSpec({ routeId: "TECH_LOG_STUDIO_TOPIC_EDIT", path: "/studio/topics/:id", layoutGroup: "STUDIO", paramsSchema: "TechLogDocumentIdParams", searchSchema: null, title: "주제 편집", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_STUDIO_RELEASES", path: "/studio/releases", layoutGroup: "STUDIO", paramsSchema: null, searchSchema: null, title: "릴리즈", navigationLabel: "릴리즈", navigationOrder: 50 }), defineSpec({ routeId: "TECH_LOG_STUDIO_RELEASE_EDIT", path: "/studio/releases/:id", layoutGroup: "STUDIO", paramsSchema: "TechLogDocumentIdParams", searchSchema: null, title: "릴리즈 편집", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_STUDIO_NOT_FOUND", path: "/studio/*", layoutGroup: "STUDIO", paramsSchema: "TechLogStudioSplat", searchSchema: null, title: "Studio 화면을 찾을 수 없습니다", navigationLabel: null, navigationOrder: null }), diff --git a/src/features/tech-log/presentation/studio/components/project-editor.tsx b/src/features/tech-log/presentation/studio/components/project-editor.tsx index d4489aa..b87c561 100644 --- a/src/features/tech-log/presentation/studio/components/project-editor.tsx +++ b/src/features/tech-log/presentation/studio/components/project-editor.tsx @@ -66,6 +66,7 @@ type Draft = { name: string; slug: string; oneLinePurpose: string; + thesis: string; purposeMarkdown: string; boundaryMarkdown: string; systemOverviewMarkdown: string; @@ -81,6 +82,7 @@ function toDraft(project: ProjectEditResponse): Draft { name: project.name, slug: project.slug ?? "", oneLinePurpose: project.oneLinePurpose ?? "", + thesis: project.thesis ?? "", purposeMarkdown: project.purposeMarkdown ?? "", boundaryMarkdown: project.boundaryMarkdown ?? "", systemOverviewMarkdown: project.systemOverviewMarkdown ?? "", @@ -175,6 +177,7 @@ export function ProjectEditor() { name: draft.name.trim(), slug: draft.slug.trim() || slugFromName(draft.name), oneLinePurpose: draft.oneLinePurpose, + thesis: draft.thesis, purposeMarkdown: draft.purposeMarkdown, boundaryMarkdown: draft.boundaryMarkdown, systemOverviewMarkdown: draft.systemOverviewMarkdown, @@ -300,6 +303,21 @@ export function ProjectEditor() { onChange={(event) => update({ oneLinePurpose: event.currentTarget.value })} /> + {/* + 목적은 시작할 때 쓰는 글이고 논지는 끝나고 쓰는 글이다. 담을 칸이 없어 공개 + 화면은 목적을 대신 보여 줬고, 그래서 프로젝트 화면에는 늘 시작할 때의 말만 + 남았다. + */} +