- Restructure: move backend from new_project/ to backend/ - Add full React/TypeScript frontend (37 pages, 17 services, 16 type defs, 11 query hooks) - Add docs/ with SRS specs, user stories, and workflow documentation - Update .gitignore for new directory layout Workflows implemented: WF1 User Signup, WF2 Placement Test, WF3 Exam Configuration, WF4 General English Exam, WF5 Course Generation, WF6 Entity Student Onboarding, AI Course Generation, Adaptive Learning Engine UI, White-Label Branding, Score Release Made-with: Cursor
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import { api } from "@/lib/api-client";
|
|
import type { PaginatedResponse, PaginationParams, ApiSuccessResponse } from "@/types";
|
|
|
|
export interface ApprovalWorkflow {
|
|
id: number;
|
|
name: string;
|
|
entity_id: number;
|
|
entity_name: string;
|
|
steps: { order: number; approver_id: number; approver_name: string }[];
|
|
status: "active" | "draft";
|
|
created_at: string;
|
|
}
|
|
|
|
export const approvalsService = {
|
|
async list(params?: PaginationParams): Promise<PaginatedResponse<ApprovalWorkflow>> {
|
|
return api.get<PaginatedResponse<ApprovalWorkflow>>("/approval-workflows", params as Record<string, string | number | boolean | undefined>);
|
|
},
|
|
|
|
async create(data: Partial<ApprovalWorkflow>): Promise<ApprovalWorkflow> {
|
|
return api.post<ApprovalWorkflow>("/approval-workflows", data);
|
|
},
|
|
|
|
async update(id: number, data: Partial<ApprovalWorkflow>): Promise<ApprovalWorkflow> {
|
|
return api.patch<ApprovalWorkflow>(`/approval-workflows/${id}`, data);
|
|
},
|
|
|
|
async delete(id: number): Promise<ApiSuccessResponse> {
|
|
return api.delete<ApiSuccessResponse>(`/approval-workflows/${id}`);
|
|
},
|
|
};
|