@rapidonz/accredo-types
v1.0.3
Published
TypeScript type definitions for Accredo ERP entities
Maintainers
Readme
@rapidonz/accredo-types
TypeScript type definitions for all Accredo ERP entities. Zero runtime dependencies.
Generated from the Accredo OpenAPI spec (v7.0.13.109) — 1,084 model files covering every module: AP, AR, GL, CB, IC, OE, PO, JC, FA, FX.
Install
npm install @rapidonz/accredo-typesUsage
import { APCreditor, ARDebtor, ICProduct, OData4Params } from "@rapidonz/accredo-types";
const params: OData4Params = {
$filter: "Name eq 'Acme'",
$top: 10,
$select: "CreditorCode,Name,Balance",
};
function processCreditor(creditor: APCreditor) {
console.log(creditor.CreditorCode, creditor.Name);
}Paged responses
Every list endpoint returns a paged wrapper:
import { PagedAPCreditor } from "@rapidonz/accredo-types";
const response: PagedAPCreditor = {
"@odata.context": "...",
value: [{ CreditorCode: "ACME", Name: "Acme Corp" }],
};Custom fields (Z_*)
All Accredo custom fields start with Z_. Every generated interface includes a [key: Z_${string}]: any index signature so custom fields just work while keeping type safety on standard fields:
import { APCreditor } from "@rapidonz/accredo-types";
const creditor: APCreditor = {
CreditorCode: "ACME",
Name: "Acme Corp",
Z_LoyaltyTier: "Gold",
Z_CreditScore: 850,
};Generic list response
import { ListResponse } from "@rapidonz/accredo-types";
const products: ListResponse<{ ProductCode: string; Description: string }> = {
value: [{ ProductCode: "WIDGET", Description: "Blue Widget" }],
};Modules covered
| Module | Prefix | Description |
|--------|--------|-------------|
| Accounts Payable | AP | Creditors, invoices, payments, shipments |
| Accounts Receivable | AR | Debtors, invoices, receipts, allocations |
| General Ledger | GL | Chart of accounts, journals, budgets |
| Cash Book | CB | Bank accounts, deposits, reconciliation |
| Inventory Control | IC | Products, stock, warehouses, bin locations |
| Order Entry | OE | Sales orders, quotes, dispatch |
| Purchase Orders | PO | Purchase orders, requisitions, receiving |
| Job Costing | JC | Jobs, cost transactions, WIP |
| Fixed Assets | FA | Asset register, depreciation |
| Foreign Exchange | FX | Currencies, exchange rates |
Regenerating types
To regenerate from a newer Accredo OpenAPI spec:
- Replace
openapi.jsonin the project root with the updated spec - Run the generator:
cd generate npm install node run.js - Build:
cd .. npm run build
License
See LICENSE.md — Sustainable Use License. Distribution requires written consent from Rapido.
