完成Salon SIT整改并清理旧接口
This commit is contained in:
@@ -15,14 +15,12 @@ import adminApi, {
|
||||
adminAfterSaleApi,
|
||||
adminArtistScheduleApi,
|
||||
adminAuthApi,
|
||||
adminCampaignApi,
|
||||
adminDashboardApi,
|
||||
adminInventoryApi,
|
||||
adminPaymentApi,
|
||||
adminWorkbenchRegistrationApi
|
||||
} from '../../src/api/admin'
|
||||
import api from '../../src/api'
|
||||
import { afterSaleApi, growthApi } from '../../src/api/order'
|
||||
import { afterSaleApi } from '../../src/api/order'
|
||||
|
||||
type CapturedRequest = {
|
||||
method?: string
|
||||
@@ -85,12 +83,10 @@ describe('vNext API contracts', () => {
|
||||
|
||||
await adminArtistScheduleApi.listSchedules({ artistId: 9, startDate: '2026-06-01', endDate: '2026-06-07' })
|
||||
await adminArtistScheduleApi.saveSchedule({ artistId: 9, workDate: '2026-06-01', startTime: '09:00', endTime: '18:00' })
|
||||
await adminPaymentApi.manualConfirmOrder(42, 'cash verified')
|
||||
await adminAfterSaleApi.listAfterSales({ status: 'APPLIED', page: 1, size: 20 })
|
||||
await adminAfterSaleApi.approveAfterSale(5, { auditReason: 'approved' })
|
||||
await adminInventoryApi.saveItem({ itemName: 'Base Gel', category: 'gel', unit: 'bottle', stockQuantity: 12 })
|
||||
await adminInventoryApi.adjustStock(7, { changeType: 'IN', changeQuantity: 3, remark: 'restock' })
|
||||
await adminCampaignApi.saveCampaign({ title: 'Summer Set', scene: 'HOME', status: 1 })
|
||||
await adminDashboardApi.getOverview({ date: '2026-10-25', days: 7 })
|
||||
await adminAuthApi.changePassword({ currentPassword: 'OldPass1!', newPassword: 'FreshPass2!' })
|
||||
await adminWorkbenchRegistrationApi.list()
|
||||
@@ -100,12 +96,10 @@ describe('vNext API contracts', () => {
|
||||
expect(requests).toEqual([
|
||||
{ method: 'get', url: '/artist-schedule/list', params: { artistId: 9, startDate: '2026-06-01', endDate: '2026-06-07' }, data: undefined },
|
||||
{ method: 'post', url: '/artist-schedule/save', params: undefined, data: { artistId: 9, workDate: '2026-06-01', startTime: '09:00', endTime: '18:00' } },
|
||||
{ method: 'post', url: '/payment/order/42/manual-confirm', params: { remark: 'cash verified' }, data: undefined },
|
||||
{ method: 'get', url: '/after-sale/list', params: { status: 'APPLIED', page: 1, size: 20 }, data: undefined },
|
||||
{ method: 'put', url: '/after-sale/5/approve', params: undefined, data: { auditReason: 'approved' } },
|
||||
{ method: 'post', url: '/inventory/save', params: undefined, data: { itemName: 'Base Gel', category: 'gel', unit: 'bottle', stockQuantity: 12 } },
|
||||
{ method: 'post', url: '/inventory/7/adjust', params: undefined, data: { changeType: 'IN', changeQuantity: 3, remark: 'restock' } },
|
||||
{ method: 'post', url: '/campaign/save', params: undefined, data: { title: 'Summer Set', scene: 'HOME', status: 1 } },
|
||||
{ method: 'get', url: '/dashboard/overview', params: { date: '2026-10-25', days: 7 }, data: undefined },
|
||||
{ method: 'post', url: '/auth/password', params: undefined, data: { currentPassword: 'OldPass1!', newPassword: 'FreshPass2!' } },
|
||||
{ method: 'get', url: '/user/workbench/registration/list', params: undefined, data: undefined },
|
||||
@@ -120,12 +114,10 @@ describe('vNext API contracts', () => {
|
||||
|
||||
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: '/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 }
|
||||
{ method: 'get', url: '/after-sale/my', params: { page: 1, size: 5 }, data: undefined }
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user