test: preserve fee item identifiers

This commit is contained in:
2026-08-15 18:07:23 +08:00
parent f2a49d032a
commit 20d836ab3d
2 changed files with 8 additions and 2 deletions
@@ -52,6 +52,12 @@ test('Finance PAYABLE fixture creates an isolated ACTIVE supplier through the fo
assert.match(source, /detail\?\.status === 'ACTIVE' && detail\?\.category === category/)
})
test('fee detail writes preserve 19-digit fee item IDs as strings', () => {
assert.doesNotMatch(source, /feeItemId: Number\(/)
assert.match(source, /feeItemId: String\(feeItem\.id\)/)
assert.match(source, /feeItemId: String\(feeItems\.PAYABLE\.id\)/)
})
test('automatic fee fixture completes the reviewed pricing workflow without recalculating', () => {
assert.match(source, /latest\?\.feeId/)
assert.doesNotMatch(source, /latest\?\.id/)
@@ -153,7 +153,7 @@ async function createManualFee(context, resource, feeItem, direction, amount, ba
if (context.financeFixtureHooks?.createManualFee) return context.financeFixtureHooks.createManualFee(context, resource, feeItem, direction, amount, basis, businessDate)
const basePath = `/api/platform/v1/inbounds/${encodeURIComponent(resource.inboundId)}/fee-details`
const listPath = `${basePath}?accountId=${encodeURIComponent(resource.tenantId)}`
const body = { feeItemId: Number(feeItem.id), direction, businessDate,
const body = { feeItemId: String(feeItem.id), direction, businessDate,
unitPrice: amount, currency: 'CNY', amount, settlementIncluded: true,
partnerId: partner?.id ? String(partner.id) : null, partnerName: partner?.name || null,
remark: `${context.marker}-${basis}` }
@@ -448,7 +448,7 @@ export async function run(context) {
if (containerOwned && feeItems.PAYABLE && supplier?.id) {
const basePath = `/api/platform/v1/loading-plans/${encodeURIComponent(container.loadingPlanId)}/fee-details`
const path = `${basePath}?accountId=${encodeURIComponent(container.tenantId)}`
const body = { feeItemId: Number(feeItems.PAYABLE.id), direction: 'PAYABLE', businessDate: dateOffset(-2),
const body = { feeItemId: String(feeItems.PAYABLE.id), direction: 'PAYABLE', businessDate: dateOffset(-2),
amount: 300, currency: 'CNY', settlementIncluded: true, partnerId: id(supplier.id),
partnerName: supplier.name || null, remark: `${context.marker}-CONTAINER_SHARED` }
const response = await request(context, 'POST', path, body)