2026-09-22 12:39:44 -04:00
|
|
|
export type ErrorEnvelope = {
|
|
|
|
|
error: {
|
|
|
|
|
code: string;
|
|
|
|
|
message: string;
|
|
|
|
|
correlationId: string;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type HealthResponse = {
|
|
|
|
|
stage: string;
|
|
|
|
|
sha: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type MeResponse = {
|
|
|
|
|
id: string;
|
|
|
|
|
email: string;
|
|
|
|
|
name: string;
|
|
|
|
|
role: "admin" | "ap_processor" | "approver" | "viewer";
|
|
|
|
|
};
|
|
|
|
|
|
2026-09-22 12:44:51 -04:00
|
|
|
export type Vendor = {
|
|
|
|
|
id: string;
|
|
|
|
|
name: string;
|
|
|
|
|
email: string | null;
|
|
|
|
|
defaultPaymentMethod: "check" | "ach";
|
|
|
|
|
createdAt: string;
|
|
|
|
|
updatedAt: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type GlAccount = {
|
|
|
|
|
id: string;
|
|
|
|
|
code: string;
|
|
|
|
|
name: string;
|
|
|
|
|
createdAt: string;
|
|
|
|
|
updatedAt: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type Department = {
|
|
|
|
|
id: string;
|
|
|
|
|
code: string;
|
|
|
|
|
name: string;
|
|
|
|
|
createdAt: string;
|
|
|
|
|
updatedAt: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type User = {
|
|
|
|
|
id: string;
|
|
|
|
|
email: string;
|
|
|
|
|
name: string;
|
|
|
|
|
role: MeResponse["role"];
|
|
|
|
|
createdAt: string;
|
|
|
|
|
updatedAt: string;
|
|
|
|
|
};
|
|
|
|
|
|
2026-09-22 12:39:44 -04:00
|
|
|
export type ApiPaths = {
|
|
|
|
|
"/api/health": {
|
|
|
|
|
get: { response: HealthResponse };
|
|
|
|
|
};
|
|
|
|
|
"/api/me": {
|
|
|
|
|
get: { response: MeResponse };
|
|
|
|
|
};
|
2026-09-22 12:44:51 -04:00
|
|
|
"/api/vendors": {
|
|
|
|
|
get: { response: { items: Vendor[] } };
|
|
|
|
|
};
|
|
|
|
|
"/api/gl-accounts": {
|
|
|
|
|
get: { response: { items: GlAccount[] } };
|
|
|
|
|
};
|
|
|
|
|
"/api/departments": {
|
|
|
|
|
get: { response: { items: Department[] } };
|
|
|
|
|
};
|
|
|
|
|
"/api/users": {
|
|
|
|
|
get: { response: { items: User[] } };
|
|
|
|
|
};
|
2026-09-22 12:39:44 -04:00
|
|
|
};
|