完成Salon小程序合规整改

This commit is contained in:
2026-10-22 00:27:12 +08:00
parent 1120f9d5a9
commit da1f2d2cba
99 changed files with 2815 additions and 702 deletions
@@ -21,7 +21,7 @@ import adminApi, {
adminWorkbenchRegistrationApi
} from '../../src/api/admin'
import api from '../../src/api'
import { afterSaleApi, growthApi, paymentApi } from '../../src/api/order'
import { afterSaleApi, growthApi } from '../../src/api/order'
type CapturedRequest = {
method?: string
@@ -115,15 +115,11 @@ describe('vNext API contracts', () => {
const requests: CapturedRequest[] = []
api.defaults.adapter = captureAdapter(requests)
await paymentApi.prepareOrderPayment(42)
await paymentApi.mockSuccess(42)
await afterSaleApi.apply({ orderId: 42, type: 'REFUND', reason: 'schedule changed', refundAmount: 88 })
await afterSaleApi.listMy({ page: 1, size: 5 })
await growthApi.getSummary()
expect(requests).toEqual([
{ method: 'post', url: '/payment/order/42/prepare', params: undefined, data: undefined },
{ method: 'post', url: '/payment/order/42/mock-success', params: undefined, data: undefined },
{ method: 'post', url: '/after-sale/apply', params: undefined, data: { orderId: 42, type: 'REFUND', reason: 'schedule changed', refundAmount: 88 } },
{ method: 'get', url: '/after-sale/my', params: { page: 1, size: 5 }, data: undefined },
{ method: 'get', url: '/growth/summary', params: undefined, data: undefined }