Extract admin dashboard from ghabilee-frontend2 into a dedicated Next.js app for backoffice.ghabilee.ir (no SEO indexing / Clarity).
28 lines
884 B
TypeScript
28 lines
884 B
TypeScript
import axiosInstance from '@/config/axios'
|
|
import { unwrapApiPayload } from '@/helpers/listResponse'
|
|
|
|
export interface SettlementRequest {
|
|
id: string
|
|
settlementCode: string
|
|
organizerId: string
|
|
bankAccountId: string
|
|
totalAmount: number
|
|
status: 'pending' | 'processing' | 'completed' | 'failed'
|
|
processedAt?: string | null
|
|
failureReason?: string | null
|
|
manualTrackingCode?: string | null
|
|
manualReceiptUrl?: string | null
|
|
manualNote?: string | null
|
|
createdAt: string
|
|
updatedAt: string
|
|
}
|
|
|
|
export const LIST_MY_SETTLEMENTS = async (): Promise<{ items: SettlementRequest[] }> => {
|
|
const response = await axiosInstance.get('settlements/me', {
|
|
params: { page: 1, pageSize: 30, sort: '-createdAt' },
|
|
})
|
|
const payload = unwrapApiPayload<{ items?: SettlementRequest[] }>(response.data)
|
|
|
|
return { items: Array.isArray(payload.items) ? payload.items : [] }
|
|
}
|