dsh-warranty-calc 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.3
4
+
5
+ - Rework the README first screen. The H1 now names what the plugin checks rather
6
+ than repeating the package name, and a question-and-answer table and a standards
7
+ table come before the boundary paragraph.
8
+
9
+ The substance is unchanged and the boundary paragraph is verbatim: in a
10
+ compliance tool that paragraph is what stops a wrong "pass" being read as
11
+ approval, so it moved rather than shrank. What changed is the order - a reader
12
+ or an extractor previously met eleven badges, an install command and a
13
+ disclaimer before learning what the plugin does. The Q&A rows are derived from
14
+ each plugin's own rules and the standards table from the rule pack's
15
+ `document`/`number` fields, so no answer and no standard is hand-typed.
16
+
17
+ All five languages were restructured together; `check:readmes` holds them to the
18
+ same section count, install command and configuration keys.
19
+
3
20
  ## 0.2.2
4
21
 
5
22
  - Ship `CHANGELOG.md` and `SECURITY.md` inside the package. `files` is an
package/README-es.md CHANGED
@@ -1,4 +1,25 @@
1
- # dsh-warranty-calc
1
+ # dsh-warranty-calc — Verificación de la coherencia entre el período de garantía y el importe de la reclamación
2
+
3
+ `dsh-warranty-calc` lee un registro de reclamaciones de garantía —la cabecera del concesionario más una fila por reclamación— y comprueba la aritmética y la coherencia de plazos de ese mismo registro: que cada reclamación anote su número de reclamación o el nombre de la pieza, que la fecha de la reclamación caiga dentro de la fecha de fin de garantía que el registro declara, que el kilometraje en la reclamación se pueda analizar como número y no supere el límite de kilometraje que el registro declara, que el importe reclamado sea igual a cantidad × precio unitario, que la fecha de venta no sea posterior a la fecha de la reclamación y que no se repitan los números de reclamación.
4
+
5
+ ## Qué responde
6
+
7
+ | Usted pregunta | Qué responde |
8
+ |---|---|
9
+ | El registro no tiene fecha de fin de garantía. ¿La comprobación de la fecha de la reclamación pasa sin más? | No. `WC-002` aparece en `skipped` cuando la columna del fin de garantía está vacía: no supone ningún plazo ni lo calcula a partir de la fecha de venta. Con la columna rellena solo comprueba que la fecha de la reclamación quede entre la fecha de venta y la fecha de fin que usted escribió, y una diferencia significa que no concuerda con el plazo de su propio registro, no que la reclamación esté fuera de garantía. |
10
+ | El importe reclamado no es igual a cantidad × precio unitario, ¿se detecta? | Sí. `WC-005` señala la fila cuando `claimAmount` se aparta de `quantity` × `unitPrice` más de la tolerancia de 0.01. Cubre solo el importe de las piezas: si su registro liquida como piezas + mano de obra − franquicia (`laborHours`, `laborRate` y `deductible` son columnas aparte), la regla informará de una diferencia; apunte `resultField` a una columna de importe de piezas o desactive la regla. No juzga si el precio unitario es razonable ni si la pieza debía sustituirse. |
11
+ | El kilometraje figura como `48,600 公里`, ¿se lee igual? ¿Y si supera el límite? | Sí. `WC-003` toma la parte numérica, así que `48600` y `48,600 公里` se analizan; solo informa del kilometraje que no puede analizar y no juzga si supera el límite. De esa comparación se ocupa `WC-004`, que solo contrasta con el límite `warrantyMiles` que declara el registro —ninguna cifra está incorporada— y cuyo hallazgo significa «por encima del límite que usted registró», nunca «fuera de garantía»: tiempo y kilometraje son límites independientes, el que se cumpla primero. |
12
+ | El mismo número de reclamación aparece en dos filas. | `WC-007` informa de un `claimNo` repetido, ignorando los espacios, porque la repetición duplica el total reclamado e impide que el fabricante case la línea. Registrar una misma reclamación en varias filas por piezas distintas es normal: distíngalas en la columna del nombre de la pieza. |
13
+ | Una fila no tiene número de reclamación ni nombre de pieza. | `WC-001` señala la fila solo cuando no está relleno ni `claimNo` ni `partName`: basta con uno de los dos. Comprueba que esté la información mínima de trazabilidad, no si la reclamación está dentro de garantía o debe aceptarse. |
14
+ | La fecha de venta es posterior a la fecha de la reclamación. | `WC-006` compara las dos fechas del registro y señala la fila cuando `saleDate` es posterior a `claimDate`. La fecha de inicio se toma de su columna de fecha de venta: la cláusula que cita la regla nombra la fecha de factura y la fecha de entrega como puntos de inicio, la regla no elige por usted y el inicio real sigue el compromiso del fabricante. Una fecha que no puede analizar se informa aparte, no se omite en silencio. |
15
+
16
+ ## Normas que sigue
17
+
18
+ | Documento | Número | Reglas que lo citan |
19
+ |---|---|---|
20
+ | 《家用汽车产品修理更换退货责任规定》 | 市场监管总局令第43号(2021 年 7 月 22 日公布,自 2022 年 1 月 1 日起施行) | WC-001, WC-003, WC-005, WC-006, WC-007 |
21
+ | 各厂商质保政策与三包规定(本机构配置) | 无统一标准(本条依据为台账写明的质保期) | WC-002 |
22
+ | 各厂商质保政策(本机构配置) | 无统一标准(本条依据为台账写明的里程上限) | WC-004 |
2
23
 
3
24
  **Boundary:** this plugin checks a **质保索赔台账** for arithmetic and period self-consistency — that a claim
4
25
  records its number or part name, that the claim date falls inside the warranty end date the register states,
package/README-hi.md CHANGED
@@ -1,4 +1,25 @@
1
- # dsh-warranty-calc
1
+ # dsh-warranty-calc — वारंटी अवधि और दावा राशि की संगति की जाँच
2
+
3
+ `dsh-warranty-calc` वारंटी दावों का एक रजिस्टर पढ़ता है — डीलर हेडर और प्रत्येक दावे की एक पंक्ति — और उसी रजिस्टर के अंकगणित तथा अवधि की आंतरिक संगति की जाँच करता है: क्या प्रत्येक दावे में दावा क्रमांक या पुर्ज़े का नाम दर्ज है, क्या दावे की तारीख रजिस्टर में लिखी वारंटी समाप्ति तिथि के भीतर पड़ती है, क्या दावे के समय की माइलेज संख्या के रूप में पढ़ी जा सकती है और रजिस्टर में लिखी माइलेज सीमा से अधिक नहीं है, क्या दावा राशि मात्रा × इकाई मूल्य के बराबर है, क्या बिक्री तिथि दावे की तारीख के बाद नहीं है, और क्या दावा क्रमांक दोहराए नहीं गए हैं।
4
+
5
+ ## यह किन सवालों का जवाब देता है
6
+
7
+ | आपका सवाल | इसका जवाब |
8
+ |---|---|
9
+ | रजिस्टर में वारंटी समाप्ति तिथि दर्ज नहीं है। क्या दावे की तारीख की जाँच चुपचाप पास हो जाती है? | नहीं। वारंटी समाप्ति का कॉलम खाली होने पर `WC-002` स्वयं `skipped` में दर्ज होता है: यह कोई अवधि न मान लेता है न बिक्री तिथि से निकालता है। कॉलम भरा होने पर यह केवल देखता है कि दावे की तारीख आपकी लिखी बिक्री तिथि और समाप्ति तिथि के बीच पड़ती है, और अंतर मिलने का अर्थ यह है कि यह आपके ही रजिस्टर की अवधि से मेल नहीं खाता — यह नहीं कि दावा वारंटी से बाहर है। |
10
+ | दावा राशि मात्रा × इकाई मूल्य के बराबर नहीं है — क्या यह पकड़ में आता है? | हाँ। `WC-005` उस पंक्ति को दर्ज करता है जहाँ `claimAmount`, `quantity` × `unitPrice` से 0.01 की सहनशीलता से अधिक हट जाता है। यह केवल पुर्ज़ों की राशि पर लागू होता है: यदि आपका रजिस्टर पुर्ज़े + श्रम − कटौती के हिसाब से निपटान करता है (`laborHours`, `laborRate`, `deductible` अलग कॉलम हैं), तो यह नियम अंतर दर्ज करेगा — `resultField` को पुर्ज़ा-राशि कॉलम पर लगाएँ या नियम बंद कर दें। यह नहीं आँकता कि इकाई मूल्य उचित है या पुर्ज़ा बदला जाना ही चाहिए था। |
11
+ | दावे के समय की माइलेज `48,600 公里` लिखी है — क्या यह पढ़ी जाएगी? और सीमा से अधिक हो तो? | हाँ। `WC-003` उसमें से संख्यात्मक भाग लेता है, इसलिए `48600` और `48,600 公里` दोनों पढ़े जाते हैं; केवल वह माइलेज दर्ज होती है जिसे पढ़ा न जा सके, और यह नहीं आँकता कि सीमा से अधिक है या नहीं। वह तुलना `WC-004` करता है, जो केवल रजिस्टर में लिखी `warrantyMiles` सीमा से मिलाता है — कोई संख्या भीतर से थोपी नहीं गई — और उसका निष्कर्ष «आपकी दर्ज सीमा से अधिक» है, «वारंटी से बाहर» नहीं: समय और माइलेज दो स्वतंत्र सीमाएँ हैं, जो पहले पूरी हो वही। |
12
+ | एक ही दावा क्रमांक दो पंक्तियों में आया है। | `WC-007` दोहराए गए `claimNo` को दर्ज करता है और तुलना में रिक्त स्थान छोड़ देता है, क्योंकि दोहराव से दावा राशि का जोड़ दो बार गिना जाता है और निर्माता पंक्ति का मिलान नहीं कर पाता। एक ही दावा अलग-अलग पुर्ज़ों के लिए कई पंक्तियों में दर्ज करना सामान्य है: पुर्ज़े के नाम कॉलम में उन्हें अलग दिखाएँ। |
13
+ | किसी पंक्ति में न दावा क्रमांक है न पुर्ज़े का नाम। | `WC-001` उस पंक्ति को केवल तब दर्ज करता है जब `claimNo` और `partName` दोनों में से कोई भी न भरा हो: दोनों में एक होना ही पर्याप्त है। यह देखता है कि न्यूनतम पता-लगाने योग्य सूचना दर्ज है, यह नहीं कि दावा वारंटी के दायरे में है या स्वीकार किया जाना चाहिए। |
14
+ | बिक्री तिथि दावे की तारीख से बाद की है। | `WC-006` रजिस्टर की दोनों तारीखों की तुलना करता है और जहाँ `saleDate`, `claimDate` के बाद है वह पंक्ति दर्ज करता है। आरंभ तिथि आपके बिक्री-तिथि कॉलम से ली जाती है: नियम जिस धारा का हवाला देता है वह केवल बीजक तिथि और सुपुर्दगी तिथि को आरंभ बिंदु बताती है, यह नियम आपके लिए कोई चुनाव नहीं करता और वास्तविक आरंभ निर्माता की प्रतिबद्धता के अनुसार होता है। जो तारीख पढ़ी न जा सके वह अलग से दर्ज होती है, चुपचाप छोड़ी नहीं जाती। |
15
+
16
+ ## यह किन मानकों पर आधारित है
17
+
18
+ | दस्तावेज़ | संख्यांक | इन्हें उद्धृत करने वाले नियम |
19
+ |---|---|---|
20
+ | 《家用汽车产品修理更换退货责任规定》 | 市场监管总局令第43号(2021 年 7 月 22 日公布,自 2022 年 1 月 1 日起施行) | WC-001, WC-003, WC-005, WC-006, WC-007 |
21
+ | 各厂商质保政策与三包规定(本机构配置) | 无统一标准(本条依据为台账写明的质保期) | WC-002 |
22
+ | 各厂商质保政策(本机构配置) | 无统一标准(本条依据为台账写明的里程上限) | WC-004 |
2
23
 
3
24
  **Boundary:** this plugin checks a **质保索赔台账** for arithmetic and period self-consistency — that a claim
4
25
  records its number or part name, that the claim date falls inside the warranty end date the register states,
package/README-pt.md CHANGED
@@ -1,4 +1,25 @@
1
- # dsh-warranty-calc
1
+ # dsh-warranty-calc — Verificação da coerência entre o período de garantia e o valor da reclamação
2
+
3
+ `dsh-warranty-calc` lê um registo de reclamações de garantia —o cabeçalho do concessionário mais uma linha por reclamação— e verifica a aritmética e a coerência de prazos desse mesmo registo: se cada reclamação anota o seu número de reclamação ou o nome da peça, se a data da reclamação cai dentro da data de fim de garantia que o registo declara, se a quilometragem na reclamação é analisável como número e não excede o limite de quilometragem que o registo declara, se o valor reclamado é igual a quantidade × preço unitário, se a data de venda não é posterior à data da reclamação e se não há números de reclamação repetidos.
4
+
5
+ ## O que ele responde
6
+
7
+ | Você pergunta | O que ele responde |
8
+ |---|---|
9
+ | O registo não tem data de fim de garantia. A verificação da data da reclamação passa sem mais? | Não. `WC-002` aparece em `skipped` quando a coluna do fim de garantia está vazia: não presume nenhum prazo nem o calcula a partir da data de venda. Com a coluna preenchida verifica apenas que a data da reclamação fique entre a data de venda e a data de fim que você escreveu, e uma diferença significa que não concorda com o prazo do seu próprio registo, não que a reclamação esteja fora de garantia. |
10
+ | O valor reclamado não é igual a quantidade × preço unitário — isso é detetado? | Sim. `WC-005` assinala a linha quando `claimAmount` se afasta de `quantity` × `unitPrice` mais do que a tolerância de 0.01. Cobre apenas o valor das peças: se o seu registo liquida como peças + mão de obra − franquia (`laborHours`, `laborRate` e `deductible` são colunas à parte), a regra reporta uma diferença; aponte `resultField` para uma coluna de valor de peças ou desative a regra. Não julga se o preço unitário é razoável nem se a peça devia ter sido substituída. |
11
+ | A quilometragem está escrita como `48,600 公里` — ainda é lida? E se exceder o limite? | Sim. `WC-003` toma a parte numérica, pelo que `48600` e `48,600 公里` são analisados; só reporta a quilometragem que não consegue analisar e não julga se excede o limite. Dessa comparação trata `WC-004`, que apenas confronta com o limite `warrantyMiles` declarado pelo registo —nenhum valor está incorporado— e cujo achado significa «acima do limite que você registou», nunca «fora de garantia»: tempo e quilometragem são limites independentes, o que ocorrer primeiro. |
12
+ | O mesmo número de reclamação aparece em duas linhas. | `WC-007` reporta um `claimNo` repetido, ignorando espaços, porque a repetição duplica o total reclamado e impede o fabricante de casar a linha. Registar a mesma reclamação em várias linhas por peças diferentes é normal: distinga-as na coluna do nome da peça. |
13
+ | Uma linha não tem número de reclamação nem nome da peça. | `WC-001` assinala a linha apenas quando nem `claimNo` nem `partName` estão preenchidos: basta um dos dois. Verifica que esteja a informação mínima de rastreabilidade, não se a reclamação está dentro da garantia ou deve ser aceite. |
14
+ | A data de venda é posterior à data da reclamação. | `WC-006` compara as duas datas do registo e assinala a linha quando `saleDate` é posterior a `claimDate`. A data de início é tomada da sua coluna de data de venda: a cláusula citada pela regra nomeia a data da fatura e a data da entrega como pontos de início, a regra não escolhe por você e o início real segue o compromisso do fabricante. Uma data que não consegue analisar é reportada à parte, não é omitida em silêncio. |
15
+
16
+ ## Normas que segue
17
+
18
+ | Documento | Número | Regras que o citam |
19
+ |---|---|---|
20
+ | 《家用汽车产品修理更换退货责任规定》 | 市场监管总局令第43号(2021 年 7 月 22 日公布,自 2022 年 1 月 1 日起施行) | WC-001, WC-003, WC-005, WC-006, WC-007 |
21
+ | 各厂商质保政策与三包规定(本机构配置) | 无统一标准(本条依据为台账写明的质保期) | WC-002 |
22
+ | 各厂商质保政策(本机构配置) | 无统一标准(本条依据为台账写明的里程上限) | WC-004 |
2
23
 
3
24
  **Boundary:** this plugin checks a **质保索赔台账** for arithmetic and period self-consistency — that a claim
4
25
  records its number or part name, that the claim date falls inside the warranty end date the register states,
package/README-zh.md CHANGED
@@ -1,4 +1,25 @@
1
- # dsh-warranty-calc
1
+ # dsh-warranty-calc — 质保期与索赔金额核对
2
+
3
+ `dsh-warranty-calc` 读取一份质保索赔台账——经销商表头加每笔索赔一行——核对这份台账自身的算术与期限自洽:每笔索赔是否记录了索赔单号或配件名称、索赔日期是否落在台账写明的质保期截止日之内、索赔时里程是否可解析为数值且不超过台账写明的质保里程、索赔金额是否等于数量乘单价、销售日期是否不晚于索赔日期、索赔单号是否重复。
4
+
5
+ ## 它回答什么问题
6
+
7
+ | 你会问 | 它怎么答 |
8
+ |---|---|
9
+ | 台账没有填质保期截止日,索赔日期的核对就直接通过了? | 不会。质保期截止日栏为空时,`WC-002` 报告自己进入 `skipped`:它不假定任何期限,也不用销售日期推算一个。该栏填了以后,它只核对索赔日期是否落在你写的销售日期与截止日之间;报了差异只表示与你写在台账里的期限不一致,不表示索赔已超保。 |
10
+ | 索赔金额与数量乘单价对不上,能查出来吗? | 能。`WC-005` 核对 `claimAmount` 是否等于 `quantity` × `unitPrice`,超出 0.01 的容差即报出该行。它只覆盖配件金额:若本机构按「配件 + 工时 − 免赔额」结算(台账另有 `laborHours`、`laborRate`、`deductible` 三栏),本条会报差异——请把 `resultField` 指向配件金额栏,或停用本条。它不判断单价是否合理,也不判断该配件是否应当更换。 |
11
+ | 索赔时里程写的是 `48,600 公里`,还读得出来吗?超过上限又会怎样? | 读得出来。`WC-003` 取其中的数字部分,`48600` 与 `48,600 公里` 都能解析;只有解析不了的里程才报出,它不判断里程是否超过上限。做这个比较的是 `WC-004`:它只拿台账写明的 `warrantyMiles` 上限相比,不内置任何里程数,命中只表示「超过你写在台账里的上限」,不表示索赔已超保——时间与里程是两个独立维度,以先到者为准。 |
12
+ | 同一个索赔单号在两行各出现一次。 | `WC-007` 会报出重复的 `claimNo`,比较时忽略空白字符,因为重复会让索赔金额合计被重复计算,也让厂商核销时对不上行。同一笔索赔分多行登记不同配件是正常的:请在配件名称栏加以区分。 |
13
+ | 某行的索赔单号和配件名称都没有填。 | `WC-001` 只在 `claimNo` 与 `partName` 一个都没填时报出该行,填了其中一个即可。它只核对最低可追溯信息是否填写,不判断该索赔是否在质保范围内、是否应当受理。 |
14
+ | 销售日期比索赔日期还晚。 | `WC-006` 拿台账里这两个日期相比,`saleDate` 晚于 `claimDate` 时报出该行。起算日取自你填的销售日期栏:本条所引条款写的是发票日与交付日两个起算点,本条不替你选定,实际起算以厂商承诺为准。日期解析不了会单独报出,不会静默跳过。 |
15
+
16
+ ## 依据的标准
17
+
18
+ | 文件 | 文号 | 引用它的规则 |
19
+ |---|---|---|
20
+ | 《家用汽车产品修理更换退货责任规定》 | 市场监管总局令第43号(2021 年 7 月 22 日公布,自 2022 年 1 月 1 日起施行) | WC-001, WC-003, WC-005, WC-006, WC-007 |
21
+ | 各厂商质保政策与三包规定(本机构配置) | 无统一标准(本条依据为台账写明的质保期) | WC-002 |
22
+ | 各厂商质保政策(本机构配置) | 无统一标准(本条依据为台账写明的里程上限) | WC-004 |
2
23
 
3
24
  **Boundary:** this plugin checks a **质保索赔台账** for arithmetic and period self-consistency — that a claim
4
25
  records its number or part name, that the claim date falls inside the warranty end date the register states,
package/README.md CHANGED
@@ -1,4 +1,25 @@
1
- # dsh-warranty-calc
1
+ # dsh-warranty-calc — Warranty period and claim amount consistency check
2
+
3
+ `dsh-warranty-calc` reads one warranty claim register — the dealer header plus one row per claim — and checks that register's own arithmetic and period self-consistency: that each claim records its claim number or part name, that the claim date falls inside the warranty end date the register states, that the mileage at claim parses as a number and does not exceed the mileage cap the register states, that the claim amount equals quantity × unit price, that the sale date does not follow the claim date, and that claim numbers do not repeat.
4
+
5
+ ## What it answers
6
+
7
+ | You ask | What it answers |
8
+ |---|---|
9
+ | The register records no warranty end date. Does the claim-date check just pass? | No. `WC-002` reports itself in `skipped` when the warranty end column is empty: it assumes no period and never works one out from the sale date. With the column filled it only checks that the claim date lies between the sale date and the end date you wrote, and a finding means the date disagrees with the period in your own register, not that the claim is out of warranty. |
10
+ | The claim amount does not equal quantity × unit price. Is that caught? | Yes. `WC-005` reports the row when `claimAmount` differs from `quantity` × `unitPrice` by more than the 0.01 tolerance. It covers the parts amount only: if your register settles as parts + labour − deductible (`laborHours`, `laborRate` and `deductible` are separate columns), the rule will report a difference — repoint `resultField` at a parts-only column or disable it. It does not judge whether the unit price is reasonable or whether the part should have been replaced. |
11
+ | The mileage column reads `48,600 公里`. Is it still read, and what if it is above the cap? | Yes. `WC-003` takes the numeric part, so `48600` and `48,600 公里` both parse; only mileage it cannot parse is reported, and it does not judge whether the mileage is over the limit. `WC-004` does that comparison, against the `warrantyMiles` cap your register states — no figure is built in — and its finding means “above the cap you recorded”, never “out of warranty” — time and mileage are independent limits, whichever comes first. |
12
+ | The same claim number appears on two rows. | `WC-007` reports a repeated `claimNo`, ignoring whitespace, because a repeat double-counts the claim total and stops the manufacturer matching the line. Registering one claim on several lines for different parts is normal: distinguish them in the part name column. |
13
+ | A row has neither a claim number nor a part name. | `WC-001` reports the row only when neither `claimNo` nor `partName` is filled: one of the two is enough. It checks that the minimum tracing information is present, not whether the claim falls inside warranty or should be accepted. |
14
+ | The sale date is later than the claim date. | `WC-006` compares the two dates in the register and reports the row when `saleDate` follows `claimDate`. The start date is taken from your sale date column: the rule's clause names the invoice date and the delivery date as starting points and this rule does not pick one for you, and the actual start follows the manufacturer's commitment. A date it cannot parse is reported separately, not silently skipped. |
15
+
16
+ ## Standards it follows
17
+
18
+ | Document | Number | Cited by rules |
19
+ |---|---|---|
20
+ | 《家用汽车产品修理更换退货责任规定》 | 市场监管总局令第43号(2021 年 7 月 22 日公布,自 2022 年 1 月 1 日起施行) | WC-001, WC-003, WC-005, WC-006, WC-007 |
21
+ | 各厂商质保政策与三包规定(本机构配置) | 无统一标准(本条依据为台账写明的质保期) | WC-002 |
22
+ | 各厂商质保政策(本机构配置) | 无统一标准(本条依据为台账写明的里程上限) | WC-004 |
2
23
 
3
24
  **Boundary:** this plugin checks a **质保索赔台账** for arithmetic and period self-consistency — that a claim
4
25
  records its number or part name, that the claim date falls inside the warranty end date the register states,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-warranty-calc",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "质保期与索赔金额核对(按质保期月数与里程、索赔金额算式核对自洽,仅提示差异,不作出定性结论)",
5
5
  "type": "module",
6
6
  "main": "lib/index.mjs",