fix: wait for customer dimension initialization
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
deletePlatformPermission,
|
||||
deletePlatformRole,
|
||||
downloadTenantQualification,
|
||||
getPlatformTenantDimensionInitializationStatus,
|
||||
listPlatformTenants,
|
||||
listPlatformTenantOrderCounts,
|
||||
listTenantQualifications,
|
||||
@@ -400,6 +401,20 @@ describe('platform IAM roles', () => {
|
||||
expect(form.get('replaceLegalPersonId')).toBe('true')
|
||||
})
|
||||
|
||||
it('loads the customer dimension initialization status before querying dimension rules', async () => {
|
||||
const status = {
|
||||
tenantId: '2098016473058967554', status: 'PENDING', attemptCount: 3,
|
||||
nextRetryAt: '2026-09-10T20:04:00', lastErrorCode: 'S0503',
|
||||
lastErrorMessage: 'Firstleg 服务暂时不可用', updatedAt: '2026-09-10T19:54:00',
|
||||
}
|
||||
vi.mocked(http.get).mockResolvedValue({ code: '200', message: 'success', data: status })
|
||||
|
||||
await expect(getPlatformTenantDimensionInitializationStatus(status.tenantId)).resolves.toEqual(status)
|
||||
expect(http.get).toHaveBeenCalledWith(
|
||||
'/platform/v1/iam/tenants/2098016473058967554/dimension-initialization',
|
||||
)
|
||||
})
|
||||
|
||||
it('omits the optional legal-person ID parts when only the business license is uploaded', async () => {
|
||||
const result = {
|
||||
businessLicenseQualificationId: '91', legalPersonIdQualificationId: null,
|
||||
|
||||
@@ -148,6 +148,16 @@ export interface PlatformTenantCreationResponse {
|
||||
temporaryPassword: string
|
||||
}
|
||||
|
||||
export interface CustomerDimensionInitializationStatus {
|
||||
tenantId: number | string
|
||||
status: 'PENDING' | 'SENDING' | 'READY' | 'FAILED' | string
|
||||
attemptCount: number
|
||||
nextRetryAt: string | null
|
||||
lastErrorCode: string | null
|
||||
lastErrorMessage: string | null
|
||||
updatedAt: string | null
|
||||
}
|
||||
|
||||
export interface ResetPlatformTenantOwnerPasswordRequest {
|
||||
newPassword: string
|
||||
forceChangePassword: boolean
|
||||
@@ -364,6 +374,12 @@ export function getPlatformTenant(tenantId: number | string) {
|
||||
return getData<PlatformTenantResource>(`/platform/v1/iam/tenants/${tenantId}`)
|
||||
}
|
||||
|
||||
export function getPlatformTenantDimensionInitializationStatus(tenantId: number | string) {
|
||||
return getData<CustomerDimensionInitializationStatus>(
|
||||
`/platform/v1/iam/tenants/${tenantId}/dimension-initialization`,
|
||||
)
|
||||
}
|
||||
|
||||
export async function checkPlatformTenantContactPhone(contactPhone: string, excludeTenantId?: number | string) {
|
||||
const response = await http.get<ApiEnvelope<boolean>, ApiEnvelope<boolean>>(
|
||||
'/platform/v1/iam/tenants/contact-phone-availability',
|
||||
|
||||
Reference in New Issue
Block a user