@adatechnology/purchase-contracts 0.0.0-stage → 0.1.0
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/README.md +16 -2
- package/dist/index.cjs +1548 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2005 -0
- package/dist/index.d.ts +2005 -0
- package/dist/index.js +1420 -0
- package/dist/index.js.map +1 -0
- package/package.json +34 -3
package/README.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @adatechnology/purchase-contracts
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Contratos do módulo de Compras: tipos (`Supplier`, `SupplierItem`, `PurchaseOrder`, `Receipt`, `PurchaseSuggestion`,
|
|
4
|
+
`NfePreview`…), schemas zod das rotas, erros com código estável (`PURCHASE_*`), as portas opcionais
|
|
5
|
+
(`ItemCatalogPort`, `StockReceiptPort`, `PayablesPort`, `DemandSourcePort`, `OrderDispatchPort`) e os hooks.
|
|
6
|
+
|
|
7
|
+
Regras puras, sem banco, usadas pelo módulo e pela tela:
|
|
8
|
+
|
|
9
|
+
- `allowedActions(status)`, `canPerform`, `requiresApproval`, `isOrderLate`: o que o pedido permite agora;
|
|
10
|
+
- `computeTotals`, `allocateExtras` (frete e desconto rateados centavo a centavo), `landedUnitCost`,
|
|
11
|
+
`weightedAverageCost`, `divergenceOf`, `statusAfterReceipt`;
|
|
12
|
+
- `buildSuggestion` (falta − a caminho, arredondado para a embalagem, agrupado pelo fornecedor preferido);
|
|
13
|
+
- `buildInstallments`, `parsePaymentTerms('30/60/90')`, `formatPaymentTerms`;
|
|
14
|
+
- `buildOrderMessage` (texto do pedido para WhatsApp/e-mail);
|
|
15
|
+
- `parseNfeXml` (NF-e 4.00: itens, rastro de lote/validade, totais e duplicatas; recusa DTD).
|
|
16
|
+
|
|
17
|
+
Dinheiro e quantidade trafegam como texto decimal (`"12.5000"`) com a aritmética exata do `recipe-contracts`.
|