RealEstate.Temporal.Contracts 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package RealEstate.Temporal.Contracts --version 1.0.3
                    
NuGet\Install-Package RealEstate.Temporal.Contracts -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RealEstate.Temporal.Contracts" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RealEstate.Temporal.Contracts" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="RealEstate.Temporal.Contracts" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RealEstate.Temporal.Contracts --version 1.0.3
                    
#r "nuget: RealEstate.Temporal.Contracts, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RealEstate.Temporal.Contracts@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RealEstate.Temporal.Contracts&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=RealEstate.Temporal.Contracts&version=1.0.3
                    
Install as a Cake Tool

RealEstate.Temporal.Contracts

A comprehensive .NET 8 library containing Temporal workflow and activity contracts for the RealEstate order processing system, following Clean Architecture principles with clear separation of concerns across service domains.

🏗️ Architecture Overview

This package implements Clean Architecture with clear separation by service domains:

  • REI (Real Estate Ingestor) - Event validation and blob operations
  • REP (Real Estate Processor) - Order processing and business logic
  • PT (Payload Transformer) - Data transformation for external services

✨ Features

  • Clean Architecture - Well-organized contracts following SOLID principles
  • Service Domain Separation - Clear boundaries between REI, REP, and PT services
  • Temporal Integration - Native support for Temporal.io workflows and activities
  • .NET 8 Compatible - Built with the latest .NET features
  • Nullable Reference Types - Full nullable annotations for better code safety
  • Data Annotations - Comprehensive validation attributes
  • XML Documentation - Complete API documentation
  • Immutable Records - Thread-safe, immutable data contracts
  • Extension Methods - Utility extensions for common operations

📦 Installation

dotnet add package RealEstate.Temporal.Contracts

🏛️ Project Structure

RealEstate.Temporal.Contracts/
├── Workflows/                    # Workflow interfaces and models
│   ├── IStartRealEstateWorkflow.cs
│   └── Models/
│       ├── WorkflowInput.cs
│       ├── WorkflowOutput.cs
│       ├── EventInfo.cs
│       ├── ClientInfo.cs
│       └── BlobInfo.cs
│
├── Activities/                   # Activity interfaces by service domain
│   ├── REI/                     # Real Estate Ingestor
│   │   ├── IValidateEventActivity.cs
│   │   ├── IDownloadBlobActivity.cs
│   │   └── IUpdateOrderStatusInBlobActivity.cs
│   │
│   ├── REP/                     # Real Estate Processor
│   │   ├── IValidateSchemaTemplateActivity.cs
│   │   ├── IDetermineActionTypeActivity.cs
│   │   ├── ICreateOrderActivity.cs
│   │   ├── IUpdateOrderActivity.cs
│   │   ├── IApproveOrderActivity.cs
│   │   ├── IRejectOrderActivity.cs
│   │   ├── INotifyClientActivity.cs
│   │   ├── IUpdateDbActivity.cs
│   │   └── ICallApiGatewayActivity.cs
│   │
│   └── PT/                      # Payload Transformer
│       └── ITransformPayloadActivity.cs
│
├── Models/                       # Data models organized by service domain
│   ├── Common/                   # Shared models across all services
│   ├── Workflows/                # Workflow-specific models
│   ├── REI/                      # Real Estate Ingestor models
│   ├── REP/                      # Real Estate Processor models
│   └── PT/                       # Payload Transformer models
│
├── Enums/                        # Enumerations and constants
├── Extensions/                   # Utility extension methods
└── Constants/                    # Configuration and naming constants

🚀 Usage Examples

Workflow Implementation

using RealEstate.Temporal.Contracts.Workflows;
using RealEstate.Temporal.Contracts.Workflows.Models;

public class StartRealEstateWorkflow : IStartRealEstateWorkflow
{
    public async Task<WorkflowOutput> ExecuteAsync(WorkflowInput input)
    {
        // Workflow implementation...
        return new WorkflowOutput
        {
            WorkflowId = Guid.NewGuid(),
            Status = "Completed",
            ClientId = input.Client.Id,
            OrderId = Guid.NewGuid(),
            ActionType = ActionType.Create,
            Audit = new AuditInfo
            {
                CompletedAt = DateTime.UtcNow,
                Errors = Array.Empty<ErrorInfo>()
            }
        };
    }
}

Activity Implementation

using RealEstate.Temporal.Contracts.Activities.REI;
using RealEstate.Temporal.Contracts.Models.REI;

public class ValidateEventActivity : IValidateEventActivity
{
    public async Task<ValidateEventOutput> ValidateAsync(ValidateEventInput input)
    {
        // Activity implementation...
        return new ValidateEventOutput
        {
            CanProceed = true,
            DuplicateCheck = new DuplicateCheck
            {
                RecentlyDownloaded = false,
                DownloadCount = 0
            },
            ValidationErrors = Array.Empty<ErrorInfo>()
        };
    }
}

Using Extensions

using RealEstate.Temporal.Contracts.Extensions;

// Create workflow results easily
var successResult = TemporalExtensions.CreateSuccessResult(
    workflowId, "Completed", clientId, orderId, ActionType.Create);

// Validate contract inputs
if (!input.IsValid())
{
    var errors = input.GetValidationErrors();
    // Handle validation errors...
}

🔧 Service Domain Responsibilities

REI (Real Estate Ingestion)

  • Event Validation - Validate incoming events and check for duplicates
  • Blob Operations - Download and manage blob content from Azure Storage
  • Status Updates - Update order status in blob storage

REP (Real Estate Processing)

  • Schema Validation - Validate data against business schemas
  • Action Determination - Determine processing action type
  • Order Management - Create, update, approve, and reject orders
  • Client Communication - Notify clients of order status changes
  • Database Operations - Update processing status in database
  • API Integration - Communicate with external services via API Gateway

PT (Property Transformation)

  • Data Transformation - Transform data between different service formats
  • Schema Mapping - Map data from REPS format to external service format
  • Validation - Validate transformed data against target schemas

📋 Contracts Included

Workflows

  • IStartRealEstateWorkflow - Main workflow orchestration interface

Activities (13 Total)

  • REI (3): ValidateEvent, DownloadBlob, UpdateOrderStatusInBlob
  • REP (9): ValidateSchema, DetermineAction, CreateOrder, UpdateOrder, ApproveOrder, RejectOrder, NotifyClient, UpdateDb, CallApiGateway
  • PT (1): TransformPayload

Models

  • Workflow Models: Input/Output contracts for workflow orchestration
  • Activity Models: Input/Output contracts for all activities
  • Common Models: Shared data structures and validation models

Enums

  • ActionType, BrightRiverStatus, OrderStatus
  • ValidationSeverity, DeliveryStatus, HttpMethod, NotificationType

🎯 Clean Architecture Benefits

  • Separation of Concerns - Clear boundaries between service domains
  • Dependency Inversion - Interfaces depend on abstractions, not concretions
  • Single Responsibility - Each contract has a single, well-defined purpose
  • Open/Closed Principle - Easy to extend without modifying existing contracts
  • Interface Segregation - Clients only depend on interfaces they use

🚀 Ready for Production

The project follows all specified C# .NET development guidelines:

  • ✅ PascalCase naming conventions
  • ✅ Async/await patterns for I/O operations
  • ✅ Comprehensive error handling with custom exceptions
  • ✅ Dependency injection principles
  • ✅ Modern C# features (records, pattern matching, nullable references)
  • ✅ Comprehensive XML documentation
  • ✅ Thread-safe immutable data contracts

📖 Documentation

  • XML Documentation - Complete API documentation for all public members
  • Clean Architecture - Well-organized structure following SOLID principles
  • Service Domain Separation - Clear boundaries between REI, REP, and PT services

🤝 Contributing

When extending these contracts:

  1. Follow the existing naming conventions (PascalCase)
  2. Add comprehensive XML documentation
  3. Use nullable reference types appropriately
  4. Include data validation attributes where needed
  5. Ensure immutability using records
  6. Maintain service domain separation
  7. Add unit tests for complex validation logic

📄 License

This project is licensed under the MIT License.

🆘 Support

For questions and support, please refer to the project documentation or contact the RealEstate Platform team.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.5 178 8/27/2025
1.0.4 172 8/27/2025
1.0.3 171 8/27/2025
1.0.2 241 8/25/2025
1.0.1 92 8/22/2025
1.0.0 88 8/22/2025