Merge branch 'main' into dev_match
This commit is contained in:
@@ -24,6 +24,8 @@ import type {
|
||||
ManualSkuListResult,
|
||||
ManualSkuOverview,
|
||||
ManualSkuScanResult,
|
||||
OnAccountBill,
|
||||
OnAccountBillListResult,
|
||||
ProductCatalogItem,
|
||||
ProductCatalogListResult,
|
||||
TemplateProductBootstrapPreview,
|
||||
@@ -96,32 +98,6 @@ export function createAdminProductCatalog(payload: Record<string, unknown>) {
|
||||
return apiPost<{ product: ProductCatalogItem }>('/api/v1/admin/cost-center/products', payload)
|
||||
}
|
||||
|
||||
export function archiveAdminHistoricalManualProducts(payload: { execute?: boolean } = {}) {
|
||||
return apiPost<{
|
||||
dryRun: boolean
|
||||
candidateCount: number
|
||||
archivedCount: number
|
||||
sample: Array<{ id: number; canonical_sku: string; canonical_name: string }>
|
||||
}>('/api/v1/admin/cost-center/products/archive-historical-manual', payload)
|
||||
}
|
||||
|
||||
export function archiveAdminSupersededManualProducts(payload: { execute?: boolean } = {}) {
|
||||
return apiPost<{
|
||||
dryRun: boolean
|
||||
candidateCount: number
|
||||
archivedCount: number
|
||||
repointedChannelCount: number
|
||||
sample: Array<{
|
||||
id: number
|
||||
canonical_sku: string
|
||||
canonical_name: string
|
||||
primary_channel: string
|
||||
target_product_id: number
|
||||
target_product_sku: string
|
||||
}>
|
||||
}>('/api/v1/admin/cost-center/products/archive-superseded-manual', payload)
|
||||
}
|
||||
|
||||
export function syncAdminAffiliateDashProducts() {
|
||||
return apiPost<{ createdCount: number; updatedCount: number; productCount: number }>(
|
||||
'/api/v1/admin/cost-center/affiliate-products/sync',
|
||||
@@ -551,10 +527,21 @@ export function syncAdminProductPrice(productId: number) {
|
||||
}>(`/api/v1/admin/cost-center/products/${productId}/sync-price`, {})
|
||||
}
|
||||
|
||||
export function ensureVoucherChannelRules() {
|
||||
return apiPost<{ created: number; productCount: number }>(
|
||||
'/api/v1/admin/cost-center/voucher-products/ensure-rules',
|
||||
)
|
||||
export function saveAdminVoucherProduct(payload: {
|
||||
skuKey: string
|
||||
amountFen: number
|
||||
effectiveFrom?: string
|
||||
note?: string
|
||||
}) {
|
||||
return apiPost<{
|
||||
product: ProductCatalogItem
|
||||
costVersionId: number
|
||||
amountFen: number
|
||||
effectiveFrom: string
|
||||
linkedItemCount: number
|
||||
snapshotCreatedCount: number
|
||||
refreshedDays: number
|
||||
}>('/api/v1/admin/cost-center/voucher-products', payload)
|
||||
}
|
||||
|
||||
export function deleteAdminVoucherProduct(productId: number) {
|
||||
@@ -570,3 +557,26 @@ export function deleteAdminVoucherProduct(productId: number) {
|
||||
}
|
||||
}>(`/api/v1/admin/cost-center/voucher-products/${productId}`)
|
||||
}
|
||||
|
||||
export function fetchAdminOnAccountBills(
|
||||
params: {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
keyword?: string
|
||||
status?: string
|
||||
} = {},
|
||||
) {
|
||||
return apiGet<OnAccountBillListResult>('/api/v1/admin/finance/on-account-bills', params)
|
||||
}
|
||||
|
||||
export function reconcileAdminOnAccountBill(
|
||||
billId: number,
|
||||
payload: { amountFen: number; payeeName?: string; note?: string },
|
||||
) {
|
||||
return apiPost<{
|
||||
bill: OnAccountBill
|
||||
orderItemId: number
|
||||
snapshotId: number
|
||||
amountFen: number
|
||||
}>(`/api/v1/admin/finance/on-account-bills/${billId}/reconcile`, payload)
|
||||
}
|
||||
|
||||
@@ -209,6 +209,7 @@ export type VoucherConsumeJob = {
|
||||
attempt_count: number
|
||||
max_attempts: number
|
||||
last_error: string
|
||||
voucher_codes: string[]
|
||||
created_at: string
|
||||
updated_at: string
|
||||
finished_at: string | null
|
||||
|
||||
@@ -8,6 +8,8 @@ import type {
|
||||
AdminKuaishouIndustryVoucherConsumeResult,
|
||||
AdminKuaishouIndustryVoucherDestroyResult,
|
||||
AdminKuaishouIndustryVoucherListResult,
|
||||
AdminKuaishouIndustryVoucherReissueConsumePayload,
|
||||
AdminKuaishouIndustryVoucherReissueConsumeResult,
|
||||
AdminKuaishouIndustryVoucherResendResult,
|
||||
AdminKuaishouIndustryVoucherToolPayload,
|
||||
} from '@/types/admin'
|
||||
@@ -84,6 +86,15 @@ export function resendAdminKuaishouIndustryVoucherCode(
|
||||
)
|
||||
}
|
||||
|
||||
export function reissueAndConsumeAdminKuaishouIndustryVoucher(
|
||||
payload: AdminKuaishouIndustryVoucherReissueConsumePayload,
|
||||
) {
|
||||
return apiPost<AdminKuaishouIndustryVoucherReissueConsumeResult>(
|
||||
'/api/v1/admin/kuaishou-industry/vouchers/reissue-consume',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function destroyAdminKuaishouIndustryVoucher(
|
||||
payload: AdminKuaishouIndustryVoucherToolPayload,
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user