修复bug
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { http } from '@/shared/api/http'
|
||||
import {
|
||||
approveEnterpriseReview,
|
||||
assignPlatformInternalUserRoles,
|
||||
changePlatformManagedUserStatus,
|
||||
changePlatformInternalUserStatus,
|
||||
@@ -311,6 +312,20 @@ describe('platform IAM roles', () => {
|
||||
expect(http.post).toHaveBeenNthCalledWith(2, '/platform/v1/iam/tenants/8/submit-review', {})
|
||||
})
|
||||
|
||||
it('preserves long review identifiers and returns one-time administrator credentials', async () => {
|
||||
const reviewId = '190000000000000001'
|
||||
const approval = {
|
||||
tenantId: '190000000000000099',
|
||||
administratorCreated: true,
|
||||
administratorUsername: 'merchant_owner',
|
||||
temporaryPassword: 'Temporary#2026',
|
||||
}
|
||||
vi.mocked(http.post).mockResolvedValue({ code: '200', message: 'success', data: approval })
|
||||
|
||||
await expect(approveEnterpriseReview(reviewId, '资料完整')).resolves.toEqual(approval)
|
||||
expect(http.post).toHaveBeenCalledWith(`/platform/v1/iam/reviews/${reviewId}/approve`, { comment: '资料完整' })
|
||||
})
|
||||
|
||||
it('downloads a qualification with the platform file endpoint and a safe filename', async () => {
|
||||
const blob = new Blob(['image'], { type: 'image/png' })
|
||||
vi.mocked(http.get).mockResolvedValue(blob)
|
||||
|
||||
@@ -4,12 +4,12 @@ import type { PlatformPermissionResource } from '@/shared/types/platformPermissi
|
||||
export type { PlatformPermissionResource } from '@/shared/types/platformPermission'
|
||||
|
||||
export interface EnterpriseReview {
|
||||
id: number
|
||||
tenantId: number
|
||||
id: number | string
|
||||
tenantId: number | string
|
||||
status: 'PENDING' | 'APPROVED' | 'REJECTED'
|
||||
tenantName?: string | null
|
||||
tenantCode?: string | null
|
||||
qualificationId?: number | null
|
||||
qualificationId?: number | string | null
|
||||
qualificationType?: string | null
|
||||
certificateNo?: string | null
|
||||
documentUrl?: string | null
|
||||
@@ -95,7 +95,7 @@ export interface PlatformTenantQualification {
|
||||
qualificationType: 'BUSINESS_LICENSE' | string
|
||||
certificateNo: string | null
|
||||
documentUrl: string
|
||||
status: 'PENDING' | 'APPROVED' | 'REJECTED'
|
||||
status: 'PENDING' | 'APPROVED' | 'REJECTED' | 'SUPERSEDED'
|
||||
reviewComment: string | null
|
||||
validTo?: string | null
|
||||
}
|
||||
@@ -110,6 +110,13 @@ export interface PlatformQualificationUploadResponse {
|
||||
replacedDocumentUrl?: string | null
|
||||
}
|
||||
|
||||
export interface EnterpriseApprovalResponse {
|
||||
tenantId: number | string
|
||||
administratorCreated: boolean
|
||||
administratorUsername: string | null
|
||||
temporaryPassword: string | null
|
||||
}
|
||||
|
||||
export interface PlatformRoleResource {
|
||||
id: number | string
|
||||
tenantId: number | string
|
||||
@@ -437,10 +444,10 @@ export function resetPlatformManagedUserPassword(membershipId: number | string,
|
||||
return putData<void>(`/platform/v1/iam/users/${membershipId}/password`, { newPassword })
|
||||
}
|
||||
|
||||
export function approveEnterpriseReview(reviewId: number, comment: string) {
|
||||
return postData<unknown>(`/platform/v1/iam/reviews/${reviewId}/approve`, { comment })
|
||||
export function approveEnterpriseReview(reviewId: number | string, comment: string) {
|
||||
return postData<EnterpriseApprovalResponse>(`/platform/v1/iam/reviews/${reviewId}/approve`, { comment })
|
||||
}
|
||||
|
||||
export function rejectEnterpriseReview(reviewId: number, comment: string) {
|
||||
return postData<unknown>(`/platform/v1/iam/reviews/${reviewId}/reject`, { comment })
|
||||
export function rejectEnterpriseReview(reviewId: number | string, comment: string) {
|
||||
return postData<void>(`/platform/v1/iam/reviews/${reviewId}/reject`, { comment })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user