This commit is contained in:
2026-09-02 10:34:02 +08:00
44 changed files with 1003 additions and 172 deletions
@@ -70,6 +70,39 @@ paths:
requireInboundCodePrefix: {type: boolean}
responses:
'200': {description: 成功时 data 返回 channelCode;requireInboundCodePrefix=true 时同时返回 inboundCodePrefix}
/internal/firstleg/v1/pricing/order-channel-changes/validate:
post:
summary: Order 提交渠道变更前校验 Firstleg 计价资格与费用可逆性
description: >-
按客户、订单、国内收货仓、目的仓类型/标识、报价包税方式和新渠道校验当前生效价格。
若已有 CONFIRMED/SENT 费用或 PUBLISHED 运费明细,返回冲突并明确要求先走费用作废流程;
CALCULATED 仅在响应中标记将失效,本接口不写数据。
security:
- internalServiceToken: []
requestBody:
required: true
content:
application/json:
schema: {$ref: '#/components/schemas/OrderChannelChangePricingRequest'}
responses:
'200': {description: 成功时 data 返回价格版本、费用状态及是否需失效未确认预估}
/internal/firstleg/v1/pricing/order-channel-changes/apply:
post:
summary: 按订单版本幂等应用渠道变更并失效未确认价格预估
description: >-
仅供 Order 在渠道变更成功后调用。tenantId + orderId + orderVersion 构成幂等边界;
旧版本重放不会覆盖新版本。只将 CALCULATED 费用及草稿运费标记为 SUPERSEDED,
入库单恢复 UNPRICED 并可重新计价;实际净重、实际体积和测量审核事实保持不变。
已确认、已发送或已发布费用一律拒绝,不能由本命令覆盖;费用正式作废为 VOIDED 后可重新计价。
security:
- internalServiceToken: []
requestBody:
required: true
content:
application/json:
schema: {$ref: '#/components/schemas/OrderChannelChangePricingRequest'}
responses:
'200': {description: 成功或同版本同请求幂等重放,data 返回应用版本和失效费用 ID}
/internal/firstleg/v1/inbounds/{inboundId}/fees/{feeId}/source-snapshot:
get:
summary: Finance 按入库费用来源版本精确回查不可变快照
@@ -1009,6 +1042,33 @@ components:
required: true
schema: {type: string, pattern: '^[1-9][0-9]*$'}
schemas:
OrderChannelChangePricingRequest:
type: object
additionalProperties: false
required: [tenantId, orderId, orderVersion, originWarehouseId, channelCode, channelName, destinationType, pricingTaxMode]
properties:
tenantId: {type: integer, format: int64, minimum: 1}
orderId: {type: integer, format: int64, minimum: 1}
orderVersion: {type: integer, format: int64, minimum: 0, description: Order 渠道变更完成后的聚合版本;用于幂等与拒绝旧事件}
originWarehouseId: {type: integer, format: int64, minimum: 1}
channelCode: {type: string, minLength: 1, maxLength: 64}
channelName: {type: string, minLength: 1, maxLength: 128}
destinationType: {type: string, enum: [FBA, OVERSEAS]}
destinationWarehouseId: {type: integer, format: int64, minimum: 1, nullable: true}
destinationCode: {type: string, maxLength: 64, nullable: true}
pricingTaxMode: {type: string, enum: [TAX_INCLUDED, TAX_EXCLUDED]}
OrderChannelChangePricingResponse:
type: object
required: [inboundId, orderId, orderVersion, channelCode, feeStatus, calculatedFeeWillBeInvalidated]
properties:
inboundId: {type: integer, format: int64}
orderId: {type: integer, format: int64}
orderVersion: {type: integer, format: int64}
channelCode: {type: string}
priceBookVersionId: {type: integer, format: int64, nullable: true}
feeStatus: {type: string, enum: [UNPRICED, CALCULATED, VOIDED]}
calculatedFeeWillBeInvalidated: {type: boolean}
invalidatedFeeId: {type: integer, format: int64, nullable: true}
UnifiedMainStatus:
type: string
enum: [PENDING_REVIEW, WAIT_MEASURE, WAIT_SPLIT, LOADING, LOADED, DELIVERED]