@dokhna-tech/zatca-storage-memory
v4.0.0
Published
In-memory storage adapter for @dokhna-tech/zatca (testing/dev).
Readme
@dokhna-tech/zatca-storage-memory
In-memory StorageAdapter for @dokhna-tech/zatca. For testing and development only — data is lost on process restart and is not shared across processes.
Install
npm install @dokhna-tech/zatca @dokhna-tech/zatca-storage-memory@dokhna-tech/zatca is a peer dependency.
Usage
import { createMemoryStorageAdapter } from "@dokhna-tech/zatca-storage-memory";
import { issueSimplifiedTaxInvoice, asVATNumber, asEGSUuid } from "@dokhna-tech/zatca";
const storage = createMemoryStorageAdapter();
const result = await issueSimplifiedTaxInvoice({
storage,
vatNumber: asVATNumber("310123456700003"),
egsUuid: asEGSUuid("11111111-2222-3333-4444-555555555555"),
// ...rest of the invoice payload
});The factory accepts an optional options object for clock injection and custom invoice-number formatting — see the TypeScript signature for details.
When to use
- Yes: unit and integration tests, local development without a database, spike / proof-of-concept work.
- No: production. Data is lost on restart and never shared between processes — use
@dokhna-tech/zatca-storage-mongoor@dokhna-tech/zatca-storage-postgresinstead.
License
BUSL-1.1 — see LICENSE. The license converts to Apache 2.0 on 2030-05-13. SaaS / multi-tenant production use requires a commercial license; see the main repo for terms.
