# wallet_shared_kernel

**OTP app:** `:wallet_shared_kernel`
**Module namespace:** `WalletSharedKernel.*`
**Owner:** Architecture Group

## Responsibilities
Minimal shared primitives used across all wallet OTP apps.

This app must remain **lean and dependency-free** (ADR 0001).
It is reviewed quarterly to prevent scope creep beyond utility primitives.

## Public API

### `WalletSharedKernel.TypedId`
Typed, prefixed ID generation and validation.
```elixir
id = WalletSharedKernel.TypedId.generate("trf")  # => "trf_<hex>"
WalletSharedKernel.TypedId.valid?(id, "trf")      # => true
```

### `WalletSharedKernel.Money`
Immutable money value type using integer minor-unit amounts (no floats).
```elixir
m = WalletSharedKernel.Money.new(10000, "INR")    # => 100.00 INR in paise
{:ok, sum} = WalletSharedKernel.Money.add(m, m)  # => 200.00 INR
```

### `WalletSharedKernel.Correlation`
Correlation ID and request ID generation and ISO 8601 timestamp helpers.
```elixir
cid = WalletSharedKernel.Correlation.new_correlation_id()  # => "corr_<hex>"
rid = WalletSharedKernel.Correlation.new_request_id()      # => "req_<hex>"
```

## Allowed Content
- Typed IDs
- Money primitives
- Time/correlation helpers
- Behavior definitions (interfaces only)

## Forbidden Content (ADR 0001)
- Domain workflows
- DB-specific logic
- Cross-domain command handlers
- Any external library dependencies

## Dependency Rules
This app has **no dependencies** on other wallet apps.
All other apps may depend on this app.

## Change Process
Changes to this app require Architecture Group review.
Any addition must justify that it cannot live in a domain app.
