This commit is contained in:
2026-08-14 14:27:03 +08:00
parent 724848feb6
commit a81af4a664
64 changed files with 961 additions and 176 deletions
+27
View File
@@ -1,7 +1,34 @@
import type { PlatformTenantResource } from '@/modules/iam'
import type { InboundListQuery } from './core/types'
export type InboundTaskMode = 'measurement' | 'review'
export interface ActiveCustomerPage {
records: PlatformTenantResource[]
pages: number
}
export interface ActiveCustomerQuery {
page: number
size: number
status: 'ACTIVE'
}
export async function loadAllActiveCustomers(
fetchPage: (query: ActiveCustomerQuery) => Promise<ActiveCustomerPage>,
) {
const records: PlatformTenantResource[] = []
let page = 1
let pages = 1
do {
const response = await fetchPage({ page, size: 200, status: 'ACTIVE' })
records.push(...response.records)
pages = Math.max(1, response.pages)
page += 1
} while (page <= pages)
return records
}
export function buildInboundTaskQuery(
mode: InboundTaskMode,
query: Omit<InboundListQuery, 'tab' | 'processStatus' | 'measureReviewStatus'>,