feat(shipping-notice): 添加识别定义和规则集管理功能,支持客户和站点的可配置识别规则
This commit is contained in:
1 parent
88408490d7
commit
34d489a2d1
167 files changed
+10365
-7978
No files matched your search
@@ -8,7 +8,6 @@
|
||||
import { getAuthHeaders } from '@/shared/utils/auth';
|
||||
import { BusinessError, requestJson, resolveLocalizedErrorMessage } from '@/shared/api/client';
|
||||
import type {
|
||||
ShippingCustomerIdentifier,
|
||||
ShippingCustomerImportBatch,
|
||||
ShippingCustomerLifecycleImpact,
|
||||
ShippingCustomerLifecycleTimeline,
|
||||
@@ -21,7 +20,9 @@ import type {
|
||||
ShippingCustomerRow,
|
||||
ShippingCustomerShadowItem,
|
||||
ShippingCustomerShadowReport,
|
||||
ShippingIdentifierFormState,
|
||||
ShippingIdentityEvidence,
|
||||
ShippingIdentityEvidenceFormState,
|
||||
ShippingPublishedEvidenceDefinitions,
|
||||
} from '../types/customer-master.types';
|
||||
|
||||
const auth = () => ({ headers: getAuthHeaders() });
|
||||
@@ -89,13 +90,33 @@ export const deactivateShippingCustomer = (id: number, reason: string) =>
|
||||
method: 'POST', ...jsonAuth(), body: JSON.stringify({ reason }),
|
||||
});
|
||||
|
||||
export const createShippingCustomerIdentifier = (customerId: number, payload: ShippingIdentifierFormState) =>
|
||||
requestJson<ShippingCustomerIdentifier>(`/api/admin/shipping-customers/${customerId}/identifiers`, {
|
||||
method: 'POST', ...jsonAuth(), body: JSON.stringify(payload),
|
||||
});
|
||||
/** 读取当前已发布规则集中可由客户主数据维护的兼容证据定义。 */
|
||||
export const getShippingPublishedEvidenceDefinitions = (targetType: 'customer' | 'site') =>
|
||||
requestJson<ShippingPublishedEvidenceDefinitions>(
|
||||
`/api/admin/shipping-identity-rules/published-evidence-definitions?target_type=${targetType}`,
|
||||
auth(),
|
||||
);
|
||||
|
||||
export const updateShippingCustomerIdentifier = (identifierId: number, payload: Record<string, unknown>) =>
|
||||
requestJson<ShippingCustomerIdentifier>(`/api/admin/shipping-customer-identifiers/${identifierId}`, {
|
||||
/** 为客户主体或送货站点新建配置化识别证据。 */
|
||||
export const createShippingIdentityEvidence = (form: ShippingIdentityEvidenceFormState) => {
|
||||
const targetId = form.target_id;
|
||||
const path = form.target_type === 'customer'
|
||||
? `/api/admin/shipping-customers/${targetId}/identity-evidences`
|
||||
: `/api/admin/shipping-customer-sites/${targetId}/identity-evidences`;
|
||||
return requestJson<ShippingIdentityEvidence>(path, {
|
||||
method: 'POST', ...jsonAuth(), body: JSON.stringify({
|
||||
definition_id: form.definition_id,
|
||||
raw_value: form.raw_value,
|
||||
status: form.status,
|
||||
auto_match_allowed: form.auto_match_allowed,
|
||||
remark: form.remark,
|
||||
}),
|
||||
});
|
||||
};
|
||||
|
||||
/** 审核、停用或调整配置化证据授权;服务端要求高风险变更理由。 */
|
||||
export const updateShippingIdentityEvidence = (evidenceId: number, payload: Record<string, unknown>) =>
|
||||
requestJson<ShippingIdentityEvidence>(`/api/admin/shipping-identity-evidences/${evidenceId}`, {
|
||||
method: 'PUT', ...jsonAuth(), body: JSON.stringify(payload),
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user