fix(customs): add broker submission and receipt action history
This commit is contained in:
@@ -69,6 +69,7 @@ test('HTTP scenario contains file, state, idempotency, concurrency and zero-drif
|
||||
for (const token of ['EXACT_50_MB + 1', '.customblob', 'application/octet-stream',
|
||||
'缺退税资料禁止开始且零漂移', '开始后资料范围锁定A0409零漂移',
|
||||
"['上传'", "['覆盖'", "['改关联'", "['删除'", '开始后${label}锁定A0409零漂移',
|
||||
'首次发送报关行并生成独立批次', '混合柜冻结资料首次发送报关行并生成独立批次',
|
||||
'回执未确认且未发送执行时禁止上传完税文件', '客户确认整份回执后仍处于报关中', '真实报关完税文件齐全后纯退税柜完成', '客户确认回执后仍未完成整柜',
|
||||
'混合柜平台详情精确包含BUY与TAX长ID票', 'Client只见本客户TAX票且完全隐藏BUY票',
|
||||
'买单导出只处理实际装柜BUY行', '混合柜最后一份完成文件后整柜COMPLETED',
|
||||
|
||||
@@ -17,6 +17,7 @@ export const REQUIRED_ROUTE_OPERATIONS = Object.freeze([
|
||||
'merchantDeleteDocument',
|
||||
'merchantConfirmReceipt',
|
||||
'platformStart',
|
||||
'platformSendInitialToBroker',
|
||||
'platformUploadReceipt',
|
||||
'platformSubmitToBroker',
|
||||
'platformUploadFinal',
|
||||
|
||||
@@ -88,6 +88,9 @@ function routes(context, merchantToken) {
|
||||
platformStart: (ctx, fixture, request, idempotencyKey) => ctx.request('POST',
|
||||
`${PLATFORM}/${encodeURIComponent(id(fixture.loadingPlanId))}/start`, request, ctx.token,
|
||||
{ 'Idempotency-Key': idempotencyKey }),
|
||||
platformSendInitialToBroker: (ctx, fixture, request, idempotencyKey) => ctx.request('POST',
|
||||
`${PLATFORM}/${encodeURIComponent(id(fixture.loadingPlanId))}/send-to-broker`, request, ctx.token,
|
||||
{ 'Idempotency-Key': idempotencyKey }),
|
||||
platformUploadReceipt: (ctx, fixture, request, idempotencyKey) => multipart(
|
||||
`${PLATFORM}/documents/${encodeURIComponent(id(request.documentId))}/receipt/upload?expectedVersion=${Number(request.expectedVersion)}`,
|
||||
{}, request, ctx.token, idempotencyKey),
|
||||
|
||||
@@ -160,7 +160,17 @@ async function runRefund(context, routes, fixture) {
|
||||
&& started.body?.data?.documents?.every?.((item) => item.frozen === true),
|
||||
evidence(started), OPTIONS)
|
||||
|
||||
const frozenSnapshot = started.body?.data
|
||||
const initialSent = await routes.platformSendInitialToBroker(context, fixture, {
|
||||
expectedVersion: Number(started.body?.data?.version), confirm: true, remark: context.marker,
|
||||
}, key(context, 'refund-send-initial-to-broker'))
|
||||
context.assert(MODULE, '冻结资料首次发送报关行并生成独立批次', initialSent,
|
||||
success(initialSent) && initialSent.body?.data?.status === 'DECLARING'
|
||||
&& initialSent.body?.data?.brokerSubmission?.status === 'SENT'
|
||||
&& typeof initialSent.body?.data?.brokerSubmission?.batchNo === 'string'
|
||||
&& initialSent.body?.data?.brokerSubmission?.batchNo.length > 0,
|
||||
evidence(initialSent), OPTIONS)
|
||||
|
||||
const frozenSnapshot = initialSent.body?.data
|
||||
const lockedOperations = [
|
||||
['上传', () => routes.merchantUploadDocument(context, fixture, mutable, {
|
||||
...mutable.document, fileName: `${context.marker}-locked.customblob`, content: Uint8Array.from([1]),
|
||||
@@ -335,6 +345,16 @@ async function runMixedConcurrency(context, routes, fixture) {
|
||||
}, key(context, 'locked-scope'))
|
||||
await assertZeroDrift(context, '开始后资料范围锁定A0409零漂移', routes, fixture, { body: { data: frozen } }, locked)
|
||||
|
||||
const initialSent = await routes.platformSendInitialToBroker(context, fixture, {
|
||||
expectedVersion: Number(frozen?.version), confirm: true, remark: context.marker,
|
||||
}, key(context, 'mixed-send-initial-to-broker'))
|
||||
context.assert(MODULE, '混合柜冻结资料首次发送报关行并生成独立批次', initialSent,
|
||||
success(initialSent) && initialSent.body?.data?.status === 'DECLARING'
|
||||
&& initialSent.body?.data?.brokerSubmission?.status === 'SENT'
|
||||
&& typeof initialSent.body?.data?.brokerSubmission?.batchNo === 'string'
|
||||
&& initialSent.body?.data?.brokerSubmission?.batchNo.length > 0,
|
||||
evidence(initialSent), OPTIONS)
|
||||
|
||||
const receiptRequest = {
|
||||
documentId: customer.documentId, expectedVersion: 0,
|
||||
fileName: `${context.marker}-mixed-broker-receipt.pdf`,
|
||||
|
||||
Reference in New Issue
Block a user