feat(fulfillment): 新增直播账号履约工作台
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
import api from './client';
|
||||
import type {
|
||||
PlatformFulfillmentDetail,
|
||||
PlatformFulfillmentListResponse,
|
||||
PlatformFulfillmentMapping,
|
||||
} from './types';
|
||||
|
||||
export const platformFulfillmentApi = {
|
||||
listTasks: (params: {
|
||||
status?: string;
|
||||
keyword?: string;
|
||||
page?: number;
|
||||
page_size?: number;
|
||||
}) =>
|
||||
api.get<PlatformFulfillmentListResponse, PlatformFulfillmentListResponse>(
|
||||
'/platform-fulfillment/tasks',
|
||||
{ params },
|
||||
),
|
||||
sync: (limit = 100) =>
|
||||
api.post<{ fetched: number; created: number; updated: number }, { fetched: number; created: number; updated: number }>(
|
||||
'/platform-fulfillment/sync',
|
||||
null,
|
||||
{ params: { limit } },
|
||||
),
|
||||
getTask: (taskId: number) =>
|
||||
api.get<PlatformFulfillmentDetail, PlatformFulfillmentDetail>(
|
||||
`/platform-fulfillment/tasks/${taskId}`,
|
||||
),
|
||||
listMappings: (keyword = '') =>
|
||||
api.get<PlatformFulfillmentMapping[], PlatformFulfillmentMapping[]>(
|
||||
'/platform-fulfillment/mappings',
|
||||
{ params: { keyword } },
|
||||
),
|
||||
upsertMapping: (data: {
|
||||
internal_sku_key: string;
|
||||
commodity_id: string;
|
||||
goods_name?: string;
|
||||
required_points?: number | null;
|
||||
enabled: boolean;
|
||||
}) =>
|
||||
api.put<PlatformFulfillmentMapping, PlatformFulfillmentMapping>(
|
||||
'/platform-fulfillment/mappings',
|
||||
data,
|
||||
),
|
||||
allocate: (taskId: number) =>
|
||||
api.post<PlatformFulfillmentDetail, PlatformFulfillmentDetail>(
|
||||
`/platform-fulfillment/tasks/${taskId}/allocate`,
|
||||
),
|
||||
startBinding: (taskId: number) =>
|
||||
api.post<PlatformFulfillmentDetail, PlatformFulfillmentDetail>(
|
||||
`/platform-fulfillment/tasks/${taskId}/bind/start`,
|
||||
),
|
||||
refreshBinding: (taskId: number) =>
|
||||
api.post<PlatformFulfillmentDetail, PlatformFulfillmentDetail>(
|
||||
`/platform-fulfillment/tasks/${taskId}/bind/refresh`,
|
||||
),
|
||||
confirmBinding: (taskId: number) =>
|
||||
api.post<PlatformFulfillmentDetail, PlatformFulfillmentDetail>(
|
||||
`/platform-fulfillment/tasks/${taskId}/bind/confirm`,
|
||||
),
|
||||
refreshEligibility: (taskId: number) =>
|
||||
api.post<PlatformFulfillmentDetail, PlatformFulfillmentDetail>(
|
||||
`/platform-fulfillment/tasks/${taskId}/eligibility/refresh`,
|
||||
),
|
||||
complete: (taskId: number, note = '') =>
|
||||
api.post<PlatformFulfillmentDetail, PlatformFulfillmentDetail>(
|
||||
`/platform-fulfillment/tasks/${taskId}/complete`,
|
||||
{ note },
|
||||
),
|
||||
release: (taskId: number) =>
|
||||
api.post<PlatformFulfillmentDetail, PlatformFulfillmentDetail>(
|
||||
`/platform-fulfillment/tasks/${taskId}/release`,
|
||||
),
|
||||
markManual: (taskId: number, reason = '') =>
|
||||
api.post<PlatformFulfillmentDetail, PlatformFulfillmentDetail>(
|
||||
`/platform-fulfillment/tasks/${taskId}/manual`,
|
||||
{ reason },
|
||||
),
|
||||
cancel: (taskId: number, reason = '') =>
|
||||
api.post<PlatformFulfillmentDetail, PlatformFulfillmentDetail>(
|
||||
`/platform-fulfillment/tasks/${taskId}/cancel`,
|
||||
{ reason },
|
||||
),
|
||||
};
|
||||
Reference in New Issue
Block a user