mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 02:58:11 +00:00
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import recordAxiosInstance from "./recordAxiosInstance";
|
|
import { AxiosResponse } from "axios";
|
|
|
|
export interface FileInfo {
|
|
fileName: string;
|
|
contentType: string;
|
|
size: number;
|
|
originalname: string;
|
|
}
|
|
|
|
export interface ComplaintPayload {
|
|
fullName: string;
|
|
phoneNumber: string;
|
|
subCity: string;
|
|
woreda: string;
|
|
houseNumber: string;
|
|
institution: string;
|
|
complaintPlace: string;
|
|
complaintDetail: string;
|
|
desiredResolution: string;
|
|
fileInfo?: FileInfo;
|
|
}
|
|
|
|
export interface ComplaintResponse {
|
|
id: string;
|
|
complaintNumber: string;
|
|
status: string;
|
|
createdAt: string;
|
|
message?: string;
|
|
}
|
|
|
|
// Submit customer complaint
|
|
export const submitComplaint = async (
|
|
payload: ComplaintPayload
|
|
): Promise<AxiosResponse<ComplaintResponse>> => {
|
|
return recordAxiosInstance.post("/customer-complaints", payload);
|
|
};
|
|
|
|
// Get complaint by ID (for tracking)
|
|
export const getComplaintById = async (
|
|
id: string
|
|
): Promise<AxiosResponse<ComplaintResponse>> => {
|
|
return recordAxiosInstance.get(`/customer-complaints/${id}`);
|
|
};
|