diff options
| author | soryu <soryu@soryu.co> | 2026-03-09 16:31:31 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-03-09 16:31:31 +0000 |
| commit | e11e7225861c3063f08461ac01005f3315d41be5 (patch) | |
| tree | 81c17946d8f0347c7cebf83ecd731d205983cfc7 /makima/frontend/src/lib | |
| parent | 76566d32a88aa88e5b22e5209f9beb025ab6c299 (diff) | |
| parent | ef643072234477685614ed281e34ef77e45caad4 (diff) | |
| download | soryu-e11e7225861c3063f08461ac01005f3315d41be5.tar.gz soryu-e11e7225861c3063f08461ac01005f3315d41be5.zip | |
fix: resolve merge conflicts with master (integrate DOG features into compact header)makima/soryu-co-soryu---makima--resolve-merge-conflicts-i-f750d00d
- Resolved conflict in OrderDetail.tsx: kept PR compact header layout
with inline badges while adding DOG badge from master
- DOG selector in Actions section preserved from master
- orders.tsx correctly passes dogs prop to OrderDetail (auto-merged correctly)
- directives.tsx auto-merged correctly with DOG props for DirectiveDetail
- Frontend builds successfully with no TypeScript errors
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'makima/frontend/src/lib')
| -rw-r--r-- | makima/frontend/src/lib/api.ts | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/makima/frontend/src/lib/api.ts b/makima/frontend/src/lib/api.ts index 4923c1d..7968583 100644 --- a/makima/frontend/src/lib/api.ts +++ b/makima/frontend/src/lib/api.ts @@ -3387,6 +3387,85 @@ export async function pickUpOrders(directiveId: string): Promise<PickUpOrdersRes } // ============================================================================= +// Directive Order Groups (DOGs) API +// ============================================================================= + +export type DOGStatus = "open" | "in_progress" | "done" | "archived"; + +export interface DirectiveOrderGroup { + id: string; + directiveId: string; + ownerId: string; + name: string; + description: string | null; + status: DOGStatus; + createdAt: string; + updatedAt: string; +} + +export interface DOGListResponse { + dogs: DirectiveOrderGroup[]; +} + +export interface CreateDOGRequest { + name: string; + description?: string | null; +} + +export interface UpdateDOGRequest { + name?: string; + description?: string | null; + status?: DOGStatus; +} + +export async function listDogs(directiveId: string): Promise<DOGListResponse> { + const res = await authFetch(`${API_BASE}/api/v1/directives/${directiveId}/dogs`); + if (!res.ok) throw new Error(`Failed to list DOGs: ${res.statusText}`); + return res.json(); +} + +export async function createDog(directiveId: string, req: CreateDOGRequest): Promise<DirectiveOrderGroup> { + const res = await authFetch(`${API_BASE}/api/v1/directives/${directiveId}/dogs`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(req), + }); + if (!res.ok) throw new Error(`Failed to create DOG: ${res.statusText}`); + return res.json(); +} + +export async function getDog(directiveId: string, dogId: string): Promise<DirectiveOrderGroup> { + const res = await authFetch(`${API_BASE}/api/v1/directives/${directiveId}/dogs/${dogId}`); + if (!res.ok) throw new Error(`Failed to get DOG: ${res.statusText}`); + return res.json(); +} + +export async function updateDog(directiveId: string, dogId: string, req: UpdateDOGRequest): Promise<DirectiveOrderGroup> { + const res = await authFetch(`${API_BASE}/api/v1/directives/${directiveId}/dogs/${dogId}`, { + method: "PATCH", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(req), + }); + if (!res.ok) throw new Error(`Failed to update DOG: ${res.statusText}`); + return res.json(); +} + +export async function deleteDog(directiveId: string, dogId: string): Promise<void> { + const res = await authFetch(`${API_BASE}/api/v1/directives/${directiveId}/dogs/${dogId}`, { + method: "DELETE", + }); + if (!res.ok) throw new Error(`Failed to delete DOG: ${res.statusText}`); +} + +export async function pickUpDogOrders(directiveId: string, dogId: string): Promise<PickUpOrdersResponse> { + const res = await authFetch(`${API_BASE}/api/v1/directives/${directiveId}/dogs/${dogId}/pick-up-orders`, { + method: "POST", + }); + if (!res.ok) throw new Error(`Failed to pick up DOG orders: ${res.statusText}`); + return res.json(); +} + +// ============================================================================= // Orders API // ============================================================================= @@ -3406,6 +3485,7 @@ export interface Order { directiveId: string | null; directiveStepId: string | null; directiveName: string | null; + dogId: string | null; repositoryUrl: string | null; createdAt: string; updatedAt: string; @@ -3424,6 +3504,7 @@ export interface CreateOrderRequest { orderType?: OrderType; labels?: string[]; directiveId: string; + dogId?: string | null; repositoryUrl?: string | null; } @@ -3436,6 +3517,7 @@ export interface UpdateOrderRequest { labels?: string[]; directiveId?: string | null; directiveStepId?: string | null; + dogId?: string | null; repositoryUrl?: string | null; } @@ -3445,6 +3527,7 @@ export async function listOrders( priority?: OrderPriority, directiveId?: string, search?: string, + dogId?: string, ): Promise<OrderListResponse> { const params = new URLSearchParams(); if (status) params.set("status", status); @@ -3452,6 +3535,7 @@ export async function listOrders( if (priority) params.set("priority", priority); if (directiveId) params.set("directiveId", directiveId); if (search) params.set("search", search); + if (dogId) params.set("dogId", dogId); const qs = params.toString(); const res = await authFetch(`${API_BASE}/api/v1/orders${qs ? `?${qs}` : ""}`); if (!res.ok) throw new Error(`Failed to list orders: ${res.statusText}`); |
