remove customer package

This commit is contained in:
Timi
2026-09-06 17:09:19 +08:00
parent 4c6920be85
commit 0b01a54eac
15 changed files with 133 additions and 567 deletions
+2 -11
View File
@@ -1,6 +1,6 @@
import { axios } from "timi-web-api";
import { getCurrentStoreId, withCurrentStoreId } from "@/utils/store";
import type { CustomerPackagePage, GaoCustomerPackage, GaoPackageConfig, PackageConfigPage, PackagePageResult, PackagePurchaseRequest } from "@/types/Package";
import type { GaoCustomerPackage, GaoPackageConfig, PackageConfigPage, PackagePageResult, PackagePurchaseRequest } from "@/types/Package";
const CONFIG_URI = "/gao/package/config";
const CUSTOMER_PACKAGE_URI = "/gao/customer/package";
@@ -23,17 +23,8 @@ async function configUpdate(config: GaoPackageConfig): Promise<void> {
async function configRemove(id: string): Promise<void> {
await axios.post(`${CONFIG_URI}/delete`, undefined, { params: { id } });
}
async function customerPackageList(page: CustomerPackagePage): Promise<PackagePageResult<GaoCustomerPackage>> {
return await axios.post(`${CUSTOMER_PACKAGE_URI}/list`, withCurrentStoreId(page));
}
async function customerPackageDetail(id: string): Promise<GaoCustomerPackage> {
return await axios.post(`${CUSTOMER_PACKAGE_URI}/detail`, undefined, { params: { id } });
}
async function purchase(request: PackagePurchaseRequest): Promise<GaoCustomerPackage> {
return await axios.post(`${CUSTOMER_PACKAGE_URI}/purchase`, request);
}
async function cancel(customerPackageId: string, reason: string): Promise<GaoCustomerPackage> {
return await axios.post(`${CUSTOMER_PACKAGE_URI}/cancel`, { customerPackageId, reason });
}
export default { configList, configListValid, configDetail, configCreate, configUpdate, configRemove, customerPackageList, customerPackageDetail, purchase, cancel };
export default { configList, configListValid, configDetail, configCreate, configUpdate, configRemove, purchase };