Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
3156ff5
refactor(requests): enforce strict type declaration for constants and…
yannelli Mar 13, 2026
31b9eff
docs: add CLAUDE.md with project overview and usage guidelines
yannelli Mar 13, 2026
1a7858b
refactor(dto): update namespace for ClaimAppealDTO
yannelli Mar 13, 2026
a6cb140
refactor(requests): update namespaces to remove "Wrapper" suffix
yannelli Mar 13, 2026
b99f781
refactor(client): update namespaces to remove "Wrapper" suffix
yannelli Mar 13, 2026
48ff4a6
refactor(config): update namespace to remove "Wrapper" suffix
yannelli Mar 13, 2026
ec280fc
refactor(dto): update namespace for EligibilityDTO
yannelli Mar 13, 2026
832f993
refactor(requests): update namespaces to remove "Wrapper" suffix
yannelli Mar 13, 2026
25b1cb9
refactor(dto): update namespace for ERADTO
yannelli Mar 13, 2026
965af04
refactor(requests): update namespaces to remove "Wrapper" suffix
yannelli Mar 13, 2026
b5e4681
refactor(requests): update namespaces to remove "Wrapper" suffix
yannelli Mar 13, 2026
58bb870
refactor(requests): update namespaces to remove "Wrapper" suffix
yannelli Mar 13, 2026
6e83af8
refactor(dto): update namespace for ProviderEnrollmentDTO
yannelli Mar 13, 2026
d706e8a
refactor(requests): update namespaces to remove "Wrapper" suffix
yannelli Mar 13, 2026
d8a534b
refactor(requests): update namespaces to remove "Wrapper" suffix
yannelli Mar 13, 2026
c85a35b
refactor(docs): update namespaces and examples to remove "Wrapper" su…
yannelli Mar 13, 2026
c1a100a
refactor(tests): update namespace to remove "Wrapper" suffix
yannelli Mar 13, 2026
bf12378
refactor(tests): update namespace in Pest config
yannelli Mar 13, 2026
5b0943e
refactor(deps): bump PHP requirement to 8.3 and update namespaces
yannelli Mar 13, 2026
3976e37
feat(exceptions): add custom exceptions for Claim.MD SDK error handling
yannelli Mar 13, 2026
e92e76e
feat(requests): add ClaimMDException handling to ResponseRequest
yannelli Mar 13, 2026
11d47c8
feat(requests): add ClaimMDException handling to ProviderRequest
yannelli Mar 13, 2026
d3261e8
feat(requests): add ClaimMDException handling to PayerRequest
yannelli Mar 13, 2026
f53e960
feat(requests): add ClaimMDException handling to FileRequest
yannelli Mar 13, 2026
fdd5929
feat(requests): add ClaimMDException handling to ERARequest
yannelli Mar 13, 2026
2c3e274
feat(requests): add ClaimMDException handling to EligibilityRequest
yannelli Mar 13, 2026
2a9840b
feat(requests): add custom exception handling to Client requests
yannelli Mar 13, 2026
b4b60e4
feat(requests): add ClaimMDException handling to ClaimRequest
yannelli Mar 13, 2026
c5f15f7
fix(dto): adjust date validation error message for flexibility
yannelli Mar 13, 2026
a99f4ce
fix(requests): correct empty array check in getList method
yannelli Mar 13, 2026
0b71c5f
fix(requests): improve upload date validation in FileRequest
yannelli Mar 13, 2026
11813d4
fix(dto): improve validation and error handling in DTO classes
yannelli Mar 13, 2026
c778272
feat(dto): add WebhookEventDTO with validation and serialization
yannelli Mar 13, 2026
209d182
feat(dto): add WebhookPayloadDTO with validation and serialization
yannelli Mar 13, 2026
7bfbce8
feat(dto): add WebhookEnrollEventDTO with validation and tests
yannelli Mar 13, 2026
aff4989
feat(dto): add WebhookAppealEventDTO with validation and tests
yannelli Mar 13, 2026
ab47e25
feat(readme): add webhook integration and usage examples
yannelli Mar 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

Unofficial PHP SDK for the Claim.MD API — a healthcare/insurance claims processing platform. The library wraps Claim.MD's REST API with typed DTOs, validation, and a thin Guzzle-based HTTP client.

**Namespace:** `Nextvisit\ClaimMD` (PSR-4 autoloaded from `src/`)

## Commands

```bash
# Install dependencies
composer install

# Run all tests (Pest)
composer test

# Run tests with coverage
composer test:coverage

# Run a single test file
./vendor/bin/pest tests/Unit/Requests/ERARequestTest.php

# Run a specific test by name
./vendor/bin/pest --filter="test name here"
```

## Architecture

**Client + Config** — `Client` wraps Guzzle, auto-injects `AccountKey` into every request, and returns decoded JSON arrays. `Config` holds the base URI (`https://svc.claim.md/`).

**DTOs** (`src/DTO/`) — Readonly classes with constructor validation. Each DTO:
- Validates required fields and formats in the constructor (throws `InvalidArgumentException`)
- Has `toArray()` that maps camelCase properties to the API's expected field names (varies per endpoint: snake_case, PascalCase, or mixed)
- Has static `fromArray()` factory
- Filters out null values in `toArray()`

**Request classes** (`src/Requests/`) — One per API domain (ERA, Claim, File, Provider, Eligibility, Response, Payer). Each:
- Accepts `Client` via constructor injection
- Defines endpoint URIs as private constants
- Methods accept either a DTO or a raw array
- Returns raw API response arrays

**Key patterns:**
- `ResponseRequest::fetchAllResponses()` uses a Generator for auto-paginated iteration via `last_responseid`
- `FileRequest::upload()` and `EligibilityRequest::checkEligibility270271()` use multipart form uploads (accept PHP `resource` handles)
- DTOs handle field name transformation — the Request classes send whatever `toArray()` returns

## Testing

- **Framework:** Pest 3.0 with Mockery
- **Structure:** `tests/Unit/DTO/` for DTO validation tests, `tests/Unit/Requests/` for request tests with mocked Client
- **Client tests** use Guzzle's `MockHandler` for HTTP-level mocking; Request tests mock the `Client` class directly with Mockery
- **PHP version:** 8.3+ required
Loading
Loading