|
| 1 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 2 | + |
| 3 | +## Common Development Commands |
| 4 | + |
| 5 | +### Build and Test |
| 6 | +- **Build the solution**: `./build.sh` (Mac/Linux) or use Cake directly: `dotnet cake` |
| 7 | +- **Run unit tests**: `dotnet test test/TrueLayer.Tests/TrueLayer.Tests.csproj` |
| 8 | +- **Run acceptance tests**: `dotnet test test/TrueLayer.AcceptanceTests/TrueLayer.AcceptanceTests.csproj` |
| 9 | +- **Run specific test**: `dotnet test --filter "TestMethodName"` |
| 10 | +- **Generate coverage reports**: Coverage is generated automatically during the build process |
| 11 | +### Package Management |
| 12 | +- **Pack NuGet packages**: `dotnet cake --target=Pack` |
| 13 | +- **Clean artifacts**: `dotnet cake --target=Clean` |
| 14 | +### Project Structure Commands |
| 15 | +- **Restore tools**: `dotnet tool restore` |
| 16 | +- **Build specific project**: `dotnet build src/TrueLayer/TrueLayer.csproj` |
| 17 | +## Architecture Overview |
| 18 | +### Core Client Architecture |
| 19 | +The TrueLayer .NET client follows a modular architecture with these main components: |
| 20 | +- **ITrueLayerClient**: Main interface providing access to all API modules |
| 21 | +- **TrueLayerClient**: Concrete implementation using lazy initialization for API modules |
| 22 | +- **ApiClient**: HTTP client wrapper handling authentication and request signing |
| 23 | +- **Authentication**: JWT token-based auth with optional caching (InMemory/Custom) |
| 24 | +### API Modules |
| 25 | +Each API area is encapsulated in its own module: |
| 26 | +- **Auth**: Token management (`IAuthApi`) |
| 27 | +- **Payments**: Payment creation and management (`IPaymentsApi`) |
| 28 | +- **Payouts**: Payout operations (`IPayoutsApi`) |
| 29 | +- **PaymentsProviders**: Provider discovery (`IPaymentsProvidersApi`) |
| 30 | +- **MerchantAccounts**: Account management (`IMerchantAccountsApi`) |
| 31 | +- **Mandates**: Mandate operations (`IMandatesApi`) |
| 32 | +### Key Architectural Patterns |
| 33 | +- **Dependency Injection**: Full DI support with `AddTrueLayer()` and `AddKeyedTrueLayer()` extensions |
| 34 | +- **Options Pattern**: Configuration via `TrueLayerOptions` with support for multiple clients |
| 35 | +- **Authentication Caching**: Configurable auth token caching strategies |
| 36 | +- **Request Signing**: Cryptographic signing using EC512 keys via TrueLayer.Signing package |
| 37 | +- **Polymorphic Serialization**: OneOf types for discriminated unions, custom JSON converters |
| 38 | +### Target Frameworks |
| 39 | +- .NET 9.0 |
| 40 | +- .NET 8.0 |
| 41 | +- .NET Standard 2.1 |
| 42 | +### Testing Structure |
| 43 | +- **Unit Tests**: `/test/TrueLayer.Tests/` - Fast, isolated tests with mocking |
| 44 | +- **Acceptance Tests**: `/test/TrueLayer.AcceptanceTests/` - Integration tests against real/mock APIs |
| 45 | +- **Benchmarks**: `/test/TrueLayer.Benchmarks/` - Performance testing |
| 46 | +### Key Dependencies |
| 47 | +- **OneOf**: Discriminated union types for polymorphic models |
| 48 | +- **TrueLayer.Signing**: Request signing functionality |
| 49 | +- **Microsoft.Extensions.*****: Standard .NET extensions for DI, HTTP, caching, configuration |
| 50 | +- **System.Text.Json**: Primary serialization with custom converters |
| 51 | +### Configuration Requirements |
| 52 | +- ClientId, ClientSecret for API authentication |
| 53 | +- SigningKey (KeyId + PrivateKey) for payment request signing |
| 54 | +- UseSandbox flag for environment selection |
| 55 | +- Optional auth token caching configuration |
| 56 | +### Build System |
| 57 | +Uses Cake build system (`build.cake`) with tasks for: |
| 58 | +- Clean, Build, Test, Pack, GenerateReports |
| 59 | +- Coverage reporting via Coverlet |
| 60 | +- NuGet package publishing |
| 61 | +- CI/CD integration with GitHub Actions |
| 62 | +### Code Style |
| 63 | +- C# 10.0 language features |
| 64 | +- Nullable reference types enabled |
| 65 | +- Code style enforcement via `EnforceCodeStyleInBuild` |
| 66 | +- EditorConfig and analyzer rules applied |
| 67 | + |
| 68 | +## Pull Request Guidelines |
| 69 | +When creating a PR, Claude will ask for a JIRA ticket reference if: |
| 70 | +- The GitHub user is part of the Api Client Libraries team at TrueLayer |
| 71 | +- The GitHub username has a `tl-` prefix |
| 72 | +- When in doubt, an optional ACL ticket reference will be requested |
| 73 | + |
| 74 | +Format: `[ACL-XXX]` in the PR title for JIRA ticket references. |
0 commit comments