dsh-customs-doc-check

toolstested: passnpmApache-2.0

Customs declaration document consistency check: field-level findings with rule IDs.

下载量 / Downloads
2,002
依赖体积 / node_modules
8.99 MB
测试时间 / Tested
2026-11-06
DSH 版本 / Version
0.2.2-rc.1

Install

dsh plugin --profile web add dsh-customs-doc-check

Sandbox test results

StageResult
1 install✓
2 list✓
3 mount✓
4 boot—

Four stages run in an isolated sandbox: install (network on) → list → mount → boot (last three with no network).

README

dsh-customs-doc-check — Customs declaration document register consistency check

[English](README.md) · [简体中文](README-zh.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)

<!-- topblock:v1 -->

What it is — Customs declaration document register consistency check. It returns a list of what is inconsistent, where, and what to fix.
Who it is for — customs declarants and trade document clerks; no command line required.
What you give it — the source material the check works on (a table, register or document); the original is never modified. Excel can be converted to JSON/YAML first, in chat if the platform supports it.
What it does not do — no compliance verdict, no liability finding, no replacement for the reviewer; differences only.
How to start — search "Customs Compliance Suite" in WorkBuddy / Coze (this check is one part of it; availability as listed); or:
dsh plugin --profile <name> add dsh-customs-doc-check

<!-- /topblock:v1 -->

![DSH Market](https://dsh.market/)

![dshfind](https://dshfind.com/en/plugins/PerryLink/dsh-customs-doc-check?ref=badge)

dsh-customs-doc-check reads one declaration supporting-document register — a 报关单证台账 whose own column names may be Chinese or English — and checks that register itself rather than the declaration behind it: that each row carries at least one of the goods name and the amount, that the commodity code is ten digits and the currency a three-letter code, that no document number is repeated, that gross weight is not below net weight, that a declaration date, where one is recorded, parses and is not later than the check date, and that no unreplaced template placeholder survives in the goods-name column.

Install

dsh plugin --profile <name> add dsh-customs-doc-check
dsh --profile <name> --dump-config | grep 'dsh-customs-doc-check'

What it looks like

Workflow overview: document → rule pack → findings. The examples below use the real command surface.

What it answers

Examples

The table below is the example set: the first row is the detailed walkthrough, the remaining rows are short cases.

Detailed output

Tool customs_doc_check

Input

~~~json

{"rows":[{"单证种类":"发票","商品名称":"","总价":"", ...}]}

~~~

Output

~~~json

{

"id": "dsh-customs-doc-check.CD-001.de09b5a6",

"ruleId": "CD-001",

"severity": "warn",

"locator": {

"row": 1,

"field": "goodsName"

},

"found": "第 1 行 goodsName、amount 都为空",

"expected": "goodsName、amount 至少应填写一项",

"fix": "补填品名与总价;本条只核对是否填写,不判断申报内容是否真实"

}

~~~

Observed from dsh-customs-doc-check/tests/fixtures/CD-001/CD-001-unsafe.json; dsh-customs-doc-check/tests/fixtures/CD-001/cases.json; dsh-customs-doc-check/rules/customs-doc-check.yaml; dsh-customs-doc-check/tests/index.test.ts

You ask · What it answers

One row's goods name still reads 待填 and its amount cell is empty — is anything reported? · Not by CD-001: it only asks that at least one of the goods name and the amount be filled, and 待填 is not blank. What reports the row is CD-007, which looks in the goods-name column for the placeholder terms the pack lists (【, {{, XXX, 待填, TBD and the like). CD-001 never judges whether the declared content is truthful; CD-007 only looks for those terms in that one column, and its term list can be adjusted to your own template.

The commodity code is written 84713000 — eight digits. Is that reported? · Yes. CD-002 matches the cell against ten digits and reports anything else. It checks the digit count and the legality of the characters only, never whether the code is the right one: the same goods may legitimately carry different codes under different classification decisions. The digit count is the rule's pattern parameter, so it can be changed when the tariff changes its digit count.

The currency column reads RMB in one row and usd in another — which row is reported? · usd: CD-003 accepts three upper-case letters. RMB fits that shape and passes, because the rule is a shape check and not the wording of the clause — the code table the clause points to was not obtained, and the rule deliberately takes no position on the CNY versus RMB spelling that customs practice also uses; tighten the pattern if your house style fixes one. It does not judge whether the currency chosen is the right one for the settlement.

The same document number appears in two rows — what does the check say? · CD-004 reports the repeated number; whitespace is ignored when comparing. Uniqueness is all the rule establishes: a hit usually means the same document was registered twice or a number was copied from another document, and which of the two is wrong is for a person to confirm. It does not decide which registration is the valid one.

Gross weight reads 1,180 and net weight 1,250 — is that caught? And what if a row has no net weight? · The first is reported: CD-005 compares the two values and reports a row where gross weight is below net weight. Only the numbers are compared and units are allowed (12.5KGS), and the rule never judges whether the declared weight is truthful. A row missing either field is not compared at all; where that leaves nothing to compare, the rule lands in skipped with its reason instead of reporting a difference.

The register carries no declaration date at all, and one row's date is 2026-13-40. What is reported? · The impossible date is reported: CD-006 requires the date to parse and not to be later than the check date. A missing declaration date is not reported as a defect — at declaration time that column is 免予填报, bei

…(truncated)

Rendered from the README published on npm. Formatted only, not edited.

Versions

Published on npm::9,最后更新 2026-11-04

Links

GitHub · Homepage · npm

Same category