refactor(media): unify use-case I/O schemas + presenter + feature error map
Per Plan 9 (spec R1-R28): - Use cases: input + output schemas (getMedia, listMedia); deleteMedia has input schema only (void output, R12 — no presenter). - Controllers: unknown input + identity presenter on getMedia/listMedia; Promise<void> on deleteMedia. - New integrations/api/procedures.ts with mediaProcedure ([InputParseError → BAD_REQUEST], [MediaNotFoundError → NOT_FOUND]). - Router uses mediaProcedure + .input(xInputSchema). - src/index.ts exports schemas + types; src/ui/index.ts placeholder (media has no queries today); package.json adds ./ui subpath. - R25 + R26 tests added. Refactor log: §1, §2, §3.1, §3.2, §3.3, §5.1, §5.2, §6.1, §6.2 Spec: R1–R6, R8–R15, R18–R20, R22–R26 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,3 +2,29 @@ export type { Media } from "./entities/models/media";
|
||||
export { MediaNotFoundError } from "./entities/errors/media";
|
||||
export { InputParseError } from "./entities/errors/common";
|
||||
export type { MediaRouter } from "./integrations/api/router";
|
||||
|
||||
// Use case schemas + types (Plan 9 R18)
|
||||
export {
|
||||
getMediaInputSchema,
|
||||
getMediaOutputSchema,
|
||||
type GetMediaInput,
|
||||
type GetMediaOutput,
|
||||
type IGetMediaUseCase,
|
||||
} from "./application/use-cases/get-media.use-case";
|
||||
export {
|
||||
listMediaInputSchema,
|
||||
listMediaOutputSchema,
|
||||
type ListMediaInput,
|
||||
type ListMediaOutput,
|
||||
type IListMediaUseCase,
|
||||
} from "./application/use-cases/list-media.use-case";
|
||||
export {
|
||||
deleteMediaInputSchema,
|
||||
type DeleteMediaInput,
|
||||
type IDeleteMediaUseCase,
|
||||
} from "./application/use-cases/delete-media.use-case";
|
||||
|
||||
// Controller type aliases
|
||||
export type { IGetMediaController } from "./interface-adapters/controllers/get-media.controller";
|
||||
export type { IListMediaController } from "./interface-adapters/controllers/list-media.controller";
|
||||
export type { IDeleteMediaController } from "./interface-adapters/controllers/delete-media.controller";
|
||||
|
||||
Reference in New Issue
Block a user