How ivvycode/ivvy-sdk-net works
1. Repository purpose
- This is a .NET SDK library, not an application.
- Its job is to wrap the iVvy API v1+ and provide typed models, request/response handling, and platform-extension helpers.
2. Top-level structure
- The main production code lives under src/.
- Unit tests live under tests/.
- Ivvy.API.csproj is the single library project; Ivvy.API.sln ties the library and tests together.
3. Core client layer
- src/ApiClient.cs is the central shared client implementation.
- Module-specific clients in folders like Account, Venue, Crm, Event, Invoice, Contact, Batch, and Test likely build on that shared client.
- The public surface is partitioned by API domain, so callers can work with a focused client per subsystem rather than a single monolith.
4. Domain modules as bounded contexts
- Each folder maps to a major iVvy API area:
- Account: users, subscription groups, custom fields, email/error logs
- Venue: venue, rooms, bookings, packages, rates, taxes, and ARI-related room/rate planning
- Crm: leads, opportunities, tasks, activities, allocation rules
- Event: events, registrations, attendees, invited contacts
- Invoice: invoices, payments, refunds, line items
- Contact: contacts, companies, agents
- Batch: asynchronous batch jobs and progress/result payloads
- Test: a simple ping-style health check
- These are the main architectural boundaries for the SDK.
5. Shared contracts and base abstractions
- IApiClient.cs, IApiClientSerializer.cs, IApiClientDeserializer.cs, and IApiClientEvents.cs define the common seams.
- ApiCallDetails.cs, ApiClientEvents.cs, and the Result* types provide shared infrastructure for API execution, eventing, and response wrapping.
- This keeps module clients thin and consistent.
6. Serialization and JSON handling
- src/Json/ApiClientSerializer.cs and src/Json/ApiClientDeserializer.cs are the main translation layer between .NET objects and API payloads.
- Custom converters handle API-specific formats such as:
- arrays-or-object representations
- ISO date-only values
- ISO time-only values
- response envelope conversion
- This layer is important because it isolates API quirks from the domain models.
7. Response and result model pattern
- The library uses reusable wrappers such as ResultList, ResultObject, ResultSuccess, and ResultOrError.
- Domain-specific response objects exist where the API needs specialized output, such as batch job results or booking operation results.
- This suggests a consistent “API envelope + typed payload” architecture across endpoints.
8. Venue subsystem is the most elaborate
- src/Venue/ is the deepest and most complex area.
- It includes core venue entities plus nested booking models under Venue/Bookings/.
- Booking-related types are split further into:
- booking composition and line items
- room reservations
- taxes, fees, notes, resources, sessions, packages
- operation-specific result objects for add/update/cancel/confirm/remove flows
- This is the main place where the SDK models a rich transactional domain.
9. Platform extensions subsystem
- src/PlatformExtensions/ supports iVvy platform extension workflows rather than normal API consumption.
- It contains installation setup/configure/unsetup request/response models and service abstractions.
- The Installation/Setup area includes verification services, indicating a workflow where the SDK helps validate and coordinate installation state across venue/event extension contexts.
10. Shared primitives and common models
- src/Common/ and top-level utility files provide cross-domain value objects like addresses and simple ID/name/type references.
- Utils.cs likely contains reusable helpers used across clients and models.
- These types reduce duplication and act as shared building blocks for the richer domain objects.
11. Data flow through the SDK
- A consumer calls a module-specific API client.
- That client delegates to the shared client infrastructure.
- Requests are serialized to JSON using the custom serializer and converters.
- Responses are deserialized into typed result wrappers and domain models.
- Error and event details are surfaced through shared response/error types rather than leaking raw transport concerns.
12. Testing boundaries
- tests/ contains unit tests for serialization/deserialization and some domain behaviors, especially booking and platform-extension setup verification.
- The tests focus on the contract boundary of the SDK: converting API payloads correctly and preserving expected model behavior.
- This reinforces that the critical architectural risk here is compatibility with API wire formats.
13. Overall architectural shape
- The repository is a layered SDK:
- transport/client core
- JSON translation layer
- domain-specific API modules
- platform-extension workflow support
- shared result/error primitives
- The main architectural diagram should show one shared client/serialization backbone feeding multiple domain modules, with Venue and Platform Extensions as the most specialized branches.
Main entry points: ApiClient.cs Api client · ApiClientSerializer.cs JSON layer · PlatformExtension.cs Platform ext · ApiClientDeserializer.cs JSON decode
Components 26
src
Production library code
- iVvy SDK · Single SDK project for typed iVvy API access
src/Ivvy.API.csproj - Api client · Shared API client implementation used by module-specific clients
src/ApiClient.cs - Client seams · Common client and event contracts for serialization, events, and transport
src/IApiClient.cs - Api events · Shared API call/event plumbing and call details
src/ApiClientEvents.cs - JSON layer · Typed request/response translation layer for API payloads
src/Json/ApiClientSerializer.cs - JSON decode · Response deserialization and envelope handling
src/Json/ApiClientDeserializer.cs - Converters · API-specific format handling such as arrays-or-object and ISO date/time values
src/Json/Converters/ResponseConverter.cs - Result wrappers · Reusable list/object/success/error wrappers shared across endpoints
src/ResultObject.cs - Common types · Cross-domain value objects and simple reference models
src/Common/Address.cs - Account · Users, subscriptions, fields, and account logs
src/Account/ApiClient.cs - Contact · Contacts, companies, and agents
src/Contact/ApiClient.cs - CRM · Leads, opportunities, tasks, and allocation rules
src/Crm/ApiClient.cs - Event · Events, registrations, attendees, and invited contacts
src/Event/ApiClient.cs - Invoice · Invoices, payments, refunds, and line items
src/Invoice/ApiClient.cs - Batch · Asynchronous batch jobs and progress/result payloads
src/Batch/ApiClient.cs - Test · Simple ping-style health check client
src/Test/ApiClient.cs - Venue · Most complex domain: venues, rooms, bookings, rates, taxes, and ARI
src/Venue/ApiClient.cs - Booking models · Booking composition, reservations, operations, and related transactional types
src/Venue/Bookings/RoomReservation.cs - Platform ext · Platform extension installation, configure, setup, and unsetup workflows
src/PlatformExtensions/PlatformExtension.cs - Setup flow · Setup verification services and request/response models
src/PlatformExtensions/Installation/Setup/VerifySetupService.cs - Configure flow · Configure request and verification response models
src/PlatformExtensions/Installation/Configure/ConfigureRequest.cs - Unsetup flow · Unsetup request and response models
src/PlatformExtensions/Installation/Unsetup/UnsetupRequest.cs
tests
Unit tests
- Serializer tests · Serialization contract coverage
tests/ApiClientSerializerTests.cs - Deserializer tests · Deserialization and payload conversion coverage
tests/DeserializerTests.cs - Booking tests · Venue booking behavior and model coverage
tests/Venue/BookingTests.cs - Platform tests · Setup verification workflow coverage
tests/PlatformExtensions/Installation/Setup/VerifySetupServiceTests.cs
Connections 25
- iVvy SDK → Api client: contains · Library project exposes shared client core
- iVvy SDK → JSON layer: contains · Library includes JSON translation layer
- Api client → Client seams: implements · Core client is shaped by shared interfaces
- Api client → Api events: emits · Client execution surfaces shared API call events
- Api client → JSON layer: uses · Client serializes requests through JSON layer
- JSON layer → JSON decode: pairs with · Serialization and deserialization are complementary
- JSON layer → Converters: uses · JSON layer relies on API-specific converters
- JSON decode → Result wrappers: produces · Deserialization yields typed result wrappers
- Result wrappers → Common types: wraps · Shared result wrappers carry common value objects
- Api client → Account: feeds · Shared client underpins Account module client
- Api client → Contact: feeds · Shared client underpins Contact module client
- Api client → CRM: feeds · Shared client underpins CRM module client
- Api client → Event: feeds · Shared client underpins Event module client
- Api client → Invoice: feeds · Shared client underpins Invoice module client
- Api client → Batch: feeds · Shared client underpins Batch module client
- Api client → Test: feeds · Shared client underpins Test module client
- Api client → Venue: feeds · Shared client underpins Venue module client
- Venue → Booking models: contains · Venue module expands into booking-specific models and operations
- Platform ext → Setup flow: contains · Platform extension workflows include setup verification services
- Platform ext → Configure flow: contains · Platform extension workflows include configure models
- Platform ext → Unsetup flow: contains · Platform extension workflows include unsetup models
- Serializer tests → JSON layer: verifies · Tests cover request serialization behavior
- Deserializer tests → JSON decode: verifies · Tests cover payload deserialization behavior
- Booking tests → Booking models: verifies · Tests cover booking model behavior and contracts
- Platform tests → Setup flow: verifies · Tests cover setup verification workflow