feat(recycle): add customer recycle list
This commit is contained in:
@@ -3,6 +3,7 @@ import type {
|
||||
OrderTransaction,
|
||||
RecycleAccount,
|
||||
RecycleAccountAdjustRequest,
|
||||
RecycleCustomerAccountPage,
|
||||
RecycleExchange,
|
||||
RecycleExchangeCreateRequest,
|
||||
RecycleExchangeDetail,
|
||||
@@ -117,6 +118,18 @@ async function accountList(customerId: string): Promise<RecycleAccount[]> {
|
||||
});
|
||||
}
|
||||
|
||||
/** 按客户分页查询有余额的回收物及全门店汇总。 */
|
||||
async function accountCustomers(offset: number, limit: number, recycleItemId?: string, keyword?: string, customerIds?: string[]): Promise<RecycleCustomerAccountPage> {
|
||||
return await axios.post(`${ACCOUNT_URI}/customers`, undefined, {
|
||||
params: { storeId: getCurrentStoreId() || undefined, offset, limit, recycleItemId: recycleItemId || undefined, keyword: keyword || undefined, customerIds: customerIds?.length ? customerIds.join(",") : undefined }
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取额度查询可用的回收物选项。 */
|
||||
async function accountItems(): Promise<RecycleItem[]> {
|
||||
return await axios.post(`${ACCOUNT_URI}/items`, undefined, { params: { storeId: getCurrentStoreId() || undefined } });
|
||||
}
|
||||
|
||||
/** 额度流水,服务端当前最多返回 100 条。 */
|
||||
async function accountLedger(customerId: string): Promise<RecycleLedger[]> {
|
||||
return await axios.post(`${ACCOUNT_URI}/ledger`, undefined, {
|
||||
@@ -244,6 +257,8 @@ export default {
|
||||
create,
|
||||
detail,
|
||||
accountList,
|
||||
accountCustomers,
|
||||
accountItems,
|
||||
accountLedger,
|
||||
accountAdjust,
|
||||
yieldList,
|
||||
|
||||
Reference in New Issue
Block a user