![]() |
VOOZH | about |
dotnet add package BR.Workflow.Contracts --version 2.2.40
NuGet\Install-Package BR.Workflow.Contracts -Version 2.2.40
<PackageReference Include="BR.Workflow.Contracts" Version="2.2.40" />
<PackageVersion Include="BR.Workflow.Contracts" Version="2.2.40" />Directory.Packages.props
<PackageReference Include="BR.Workflow.Contracts" />Project file
paket add BR.Workflow.Contracts --version 2.2.40
#r "nuget: BR.Workflow.Contracts, 2.2.40"
#:package BR.Workflow.Contracts@2.2.40
#addin nuget:?package=BR.Workflow.Contracts&version=2.2.40Install as a Cake Addin
#tool nuget:?package=BR.Workflow.Contracts&version=2.2.40Install as a Cake Tool
๐ NuGet
๐ .NET
๐ Build Status
A comprehensive .NET 8 library containing Temporal workflow and activity contracts for distributed workflow processing systems. Built with Clean Architecture principles and clear separation of concerns across service domains.
BR.Workflow.Contracts is the foundation for building distributed, scalable workflow systems using Temporal.io and .NET 8. It provides:
This package implements Clean Architecture with clear separation by service domains:
| Domain | Purpose | Key Responsibilities |
|---|---|---|
| REI (Real Estate Ingestor) | Event validation and blob operations | Event validation, blob downloads, status updates |
| REP (Real Estate Processor) | Order processing and business logic | Order management, schema validation, client communication |
| PT (Payload Transformer) | Data transformation for external services | Data mapping, format conversion, schema validation |
dotnet add package BR.Workflow.Contracts
Install-Package BR.Workflow.Contracts
<PackageReference Include="BR.Workflow.Contracts" Version="1.0.17" />
BR.Workflow.Contracts/
โโโ ๐ Workflows/ # Workflow orchestration contracts
โ โโโ IStartRealEstateWorkflow.cs # Main workflow interface
โ โโโ Models/
โ โโโ RealEstateWorkflowOutput.cs
โ
โโโ ๐ Activities/ # Activity contracts by service domain
โ โโโ ๐ REI/ # Real Estate Ingestor (3 activities)
โ โ โโโ IValidateEventActivity.cs
โ โ โโโ IDownloadBlobActivity.cs
โ โ โโโ IUpdateOrderStatusInBlobActivity.cs
โ โ
โ โโโ โ๏ธ REP/ # Real Estate Processor (9 activities)
โ โ โโโ IValidateSchemaTemplateActivity.cs
โ โ โโโ IDetermineActionTypeActivity.cs
โ โ โโโ ICreateOrderActivity.cs
โ โ โโโ IUpdateOrderActivity.cs
โ โ โโโ IApproveOrderActivity.cs
โ โ โโโ IRejectOrderActivity.cs
โ โ โโโ INotifyClientActivity.cs
โ โ โโโ IUpdateDbActivity.cs
โ โ โโโ ICallApiGatewayActivity.cs
โ โ
โ โโโ ๐ PT/ # Payload Transformer (1 activity)
โ โโโ ITransformPayloadActivity.cs
โ
โโโ ๐ Models/ # Data models organized by domain
โ โโโ ๐ Common/ # Shared models across all services
โ โ โโโ AuditInfo.cs # Workflow execution audit
โ โ โโโ ErrorInfo.cs # Error details and tracking
โ โ โโโ ValidationError.cs # Validation failure details
โ โ โโโ ValidationResult.cs # Validation operation results
โ โ โโโ StatusUpdate.cs # Status change notifications
โ โ โโโ ApiGatewayResponse.cs # External API responses
โ โ โโโ BlobMetadata.cs # Blob storage metadata
โ โ โโโ DownloadInfo.cs # Download operation details
โ โ โโโ DuplicateCheck.cs # Duplicate detection results
โ โ
โ โโโ ๐จ Kafka/ # Kafka payload and workflow input
โ โ โโโ RealEstateWorkflowInput.cs # Main workflow input
โ โ โโโ EventInfo.cs # Event metadata and correlation
โ โ โโโ ClientInfo.cs # Client identification
โ โ โโโ BlobInfo.cs # Blob storage information
โ โ โโโ DeadLetterEvent.cs # DLQ event handling
โ โ โโโ DlqDetails.cs # DLQ failure details
โ โ
โ โโโ ๐ REI/ # Real Estate Ingestor models
โ โ โโโ ValidateEventInput.cs # Event validation input
โ โ โโโ ValidateEventOutput.cs # Event validation results
โ โ โโโ DownloadBlobInput.cs # Blob download parameters
โ โ โโโ DownloadBlobOutput.cs # Blob download results
โ โ โโโ UpdateOrderStatusInput.cs # Status update input
โ โ โโโ UpdateOrderStatusOutput.cs # Status update results
โ โ
โ โโโ โ๏ธ REP/ # Real Estate Processor models
โ โ โโโ ValidateSchemaInput.cs # Schema validation input
โ โ โโโ ValidateSchemaOutput.cs # Schema validation results
โ โ โโโ DetermineActionInput.cs # Action determination input
โ โ โโโ DetermineActionOutput.cs # Action determination results
โ โ โโโ CreateOrderInput.cs # Order creation input
โ โ โโโ CreateOrderOutput.cs # Order creation results
โ โ โโโ UpdateOrderInput.cs # Order update input
โ โ โโโ UpdateOrderOutput.cs # Order update results
โ โ โโโ ApproveOrderInput.cs # Order approval input
โ โ โโโ ApproveOrderOutput.cs # Order approval results
โ โ โโโ RejectOrderInput.cs # Order rejection input
โ โ โโโ RejectOrderOutput.cs # Order rejection results
โ โ โโโ NotifyClientInput.cs # Client notification input
โ โ โโโ NotifyClientOutput.cs # Client notification results
โ โ โโโ UpdateDbInput.cs # Database update input
โ โ โโโ UpdateDbOutput.cs # Database update results
โ โ โโโ CallApiGatewayInput.cs # API Gateway call input
โ โ โโโ CallApiGatewayOutput.cs # API Gateway call results
โ โ
โ โโโ ๐ PT/ # Payload Transformer models
โ โโโ TransformPayloadInput.cs # Transformation input
โ โโโ TransformPayloadOutput.cs # Transformation results
โ โโโ TransformationRules.cs # Transformation configuration
โ
โโโ ๐ Enums/ # Type-safe enumerations
โ โโโ ActionType.cs # Order processing actions
โ โโโ BrightRiverStatus.cs # Bright River specific statuses
โ โโโ DeliveryStatus.cs # Delivery operation statuses
โ โโโ HttpMethod.cs # HTTP method constants
โ โโโ NotificationType.cs # Notification type definitions
โ โโโ OrderStatus.cs # Order lifecycle statuses
โ โโโ ValidationSeverity.cs # Validation error severity levels
โ
โโโ ๐ Extensions/ # Utility extension methods
โ โโโ TemporalExtensions.cs # Workflow result helpers
โ โโโ ContractExtensions.cs # Contract utility methods
โ โโโ ValidationExtensions.cs # Validation helper methods
โ
โโโ ๐ Constants/ # Configuration constants
โ โโโ ActivityNames.cs # Activity naming constants
โ โโโ ConfigurationKeys.cs # Configuration key constants
โ โโโ TaskQueues.cs # Task queue names
โ โโโ WorkflowNames.cs # Workflow naming constants
โ โโโ WorkflowTypes.cs # Workflow type definitions
โ
โโโ ๐ Scripts/ # Build and deployment automation
โโโ build-and-publish.ps1 # PowerShell build & publish script
โโโ build-and-publish.cmd # Windows batch build & publish script
โโโ build.ps1 # Comprehensive build script
โโโ build.cmd # Windows build script
โโโ publish.ps1 # NuGet publishing script
using BR.Workflow.Contracts.Workflows;
using BR.Workflow.Contracts.Models.Kafka;
using BR.Workflow.Contracts.Workflows.Models;
public class StartRealEstateWorkflow : IStartRealEstateWorkflow
{
public async Task<RealEstateWorkflowOutput> ExecuteAsync(RealEstateWorkflowInput input)
{
try
{
// Your workflow logic here
return new RealEstateWorkflowOutput
{
WorkflowId = Guid.NewGuid(),
Status = "Completed",
ClientId = input.ClientInfo.Id,
OrderId = Guid.NewGuid(),
ActionType = ActionType.Create,
ApiGatewayResponse = new ApiGatewayResponse
{
Success = true,
StatusCode = 200,
Message = "Order created successfully"
},
AuditInfo = new AuditInfo
{
CompletedAt = DateTime.UtcNow,
ErrorInfo = Array.Empty<ErrorInfo>()
}
};
}
catch (Exception ex)
{
return new RealEstateWorkflowOutput
{
WorkflowId = Guid.NewGuid(),
Status = "Failed",
ClientId = input.ClientInfo.Id,
OrderId = Guid.Empty,
ActionType = ActionType.Create,
ApiGatewayResponse = new ApiGatewayResponse
{
Success = false,
StatusCode = 500,
Message = ex.Message
},
AuditInfo = new AuditInfo
{
CompletedAt = DateTime.UtcNow,
ErrorInfo = new[] { new ErrorInfo { Message = ex.Message, Severity = ValidationSeverity.Error } }
}
};
}
}
}
using BR.Workflow.Contracts.Activities.REI;
using BR.Workflow.Contracts.Models.REI;
using BR.Workflow.Contracts.Models.Common;
public class ValidateEventActivity : IValidateEventActivity
{
public async Task<ValidateEventOutput> ValidateAsync(ValidateEventInput input)
{
var validationErrors = new List<ValidationError>();
// Validate correlation ID
if (string.IsNullOrEmpty(input.CorrelationId))
{
validationErrors.Add(new ValidationError
{
Field = nameof(input.CorrelationId),
Message = "Correlation ID is required",
Severity = ValidationSeverity.Error
});
}
// Validate client ID
if (input.ClientId == Guid.Empty)
{
validationErrors.Add(new ValidationError
{
Field = nameof(input.ClientId),
Message = "Valid Client ID is required",
Severity = ValidationSeverity.Error
});
}
// Check for duplicates
var duplicateCheck = await CheckForDuplicatesAsync(input.CorrelationId, input.ClientId);
return new ValidateEventOutput
{
CanProceed = validationErrors.Count == 0,
DuplicateCheck = duplicateCheck,
ValidationErrors = validationErrors.ToArray()
};
}
private async Task<DuplicateCheck> CheckForDuplicatesAsync(string correlationId, Guid clientId)
{
// Your duplicate checking logic here
return new DuplicateCheck
{
RecentlyDownloaded = false,
DownloadCount = 0
};
}
}
using BR.Workflow.Contracts.Extensions;
// Create workflow results easily
var successResult = TemporalExtensions.CreateSuccessResult(
workflowId: Guid.NewGuid(),
status: "Completed",
clientId: clientId,
orderId: orderId,
actionType: ActionType.Create
);
// Validate contract inputs
if (!input.IsValid())
{
var errors = input.GetValidationErrors();
foreach (var error in errors)
{
Console.WriteLine($"Validation Error: {error.Field} - {error.Message}");
}
}
// Create error results
var errorResult = TemporalExtensions.CreateErrorResult(
workflowId: Guid.NewGuid(),
status: "Failed",
clientId: clientId,
orderId: orderId,
actionType: ActionType.Create,
errorMessage: "Processing failed"
);
Purpose: Handle incoming events and manage blob storage operations
Key Activities:
IValidateEventActivity - Validate incoming events and check for duplicatesIDownloadBlobActivity - Download blob content from Azure StorageIUpdateOrderStatusInBlobActivity - Update order status in blob storageUse Cases:
Purpose: Core business logic for order processing and client communication
Key Activities:
IValidateSchemaTemplateActivity - Validate data against business schemasIDetermineActionTypeActivity - Determine processing action typeICreateOrderActivity - Create new ordersIUpdateOrderActivity - Update existing ordersIApproveOrderActivity - Approve ordersIRejectOrderActivity - Reject ordersINotifyClientActivity - Notify clients of status changesIUpdateDbActivity - Update processing status in databaseICallApiGatewayActivity - Communicate with external servicesUse Cases:
Purpose: Transform data between different service formats
Key Activities:
ITransformPayloadActivity - Transform data between formatsUse Cases:
The library provides dual-purpose models that serve both Kafka messaging and workflow processing:
| Model | Purpose | Key Properties |
|---|---|---|
RealEstateWorkflowInput |
Main workflow input from Kafka | EventInfo, ClientInfo, BlobInfo |
EventInfo |
Event metadata and correlation | Name, CorrelationId, Timestamp |
ClientInfo |
Client identification | Id, Name, Reference |
BlobInfo |
Azure Blob Storage information | Url, Container, BlobName |
JsonPropertyName attributes for camelCase JSON// Kafka message processing
var kafkaPayload = JsonSerializer.Deserialize<RealEstateWorkflowInput>(kafkaMessage);
// Validate the payload
if (!kafkaPayload.IsValid())
{
var errors = kafkaPayload.GetValidationErrors();
// Handle validation errors...
}
// Workflow execution
var result = await workflow.ExecuteAsync(kafkaPayload);
| Interface | Purpose | Output |
|---|---|---|
IStartRealEstateWorkflow |
Main workflow orchestration | RealEstateWorkflowOutput |
| Activity | Purpose | Input | Output |
|---|---|---|---|
IValidateEventActivity |
Validate incoming events | ValidateEventInput |
ValidateEventOutput |
IDownloadBlobActivity |
Download blob content | DownloadBlobInput |
DownloadBlobOutput |
IUpdateOrderStatusInBlobActivity |
Update blob status | UpdateOrderStatusInput |
UpdateOrderStatusOutput |
| Activity | Purpose | Input | Output |
|---|---|---|---|
IValidateSchemaTemplateActivity |
Validate business schemas | ValidateSchemaInput |
ValidateSchemaOutput |
IDetermineActionTypeActivity |
Determine processing action | DetermineActionInput |
DetermineActionOutput |
ICreateOrderActivity |
Create new orders | CreateOrderInput |
CreateOrderOutput |
IUpdateOrderActivity |
Update existing orders | UpdateOrderInput |
UpdateOrderOutput |
IApproveOrderActivity |
Approve orders | ApproveOrderInput |
ApproveOrderOutput |
IRejectOrderActivity |
Reject orders | RejectOrderInput |
RejectOrderOutput |
INotifyClientActivity |
Notify clients | NotifyClientInput |
NotifyClientOutput |
IUpdateDbActivity |
Update database | UpdateDbInput |
UpdateDbOutput |
ICallApiGatewayActivity |
Call external APIs | CallApiGatewayInput |
CallApiGatewayOutput |
| Activity | Purpose | Input | Output |
|---|---|---|---|
ITransformPayloadActivity |
Transform data formats | TransformPayloadInput |
TransformPayloadOutput |
| Enum | Values | Purpose |
|---|---|---|
ActionType |
Create, Update, Approve, Reject | Order processing actions |
BrightRiverStatus |
Pending, Processing, Completed, Failed | Bright River specific statuses |
OrderStatus |
Draft, Submitted, Approved, Rejected | Order lifecycle statuses |
ValidationSeverity |
Info, Warning, Error, Critical | Validation error severity |
DeliveryStatus |
Pending, Delivered, Failed | Delivery operation statuses |
HttpMethod |
GET, POST, PUT, DELETE | HTTP method constants |
NotificationType |
Email, SMS, Push | Notification type definitions |
The project follows all specified C# .NET development guidelines:
# PowerShell (Recommended)
.\scripts\build-and-publish.ps1 -ApiKey "your-nuget-api-key"
# Windows Batch
.\scripts\build-and-publish.cmd "your-nuget-api-key"
# Dry run (test without publishing)
.\scripts\build-and-publish.ps1 -ApiKey "your-nuget-api-key" -DryRun
# Restore packages
dotnet restore
# Build project
dotnet build --configuration Release
# Create NuGet package
dotnet pack --configuration Release --output nupkg
# Publish to NuGet
dotnet nuget push "nupkg\BR.Workflow.Contracts.1.0.17.nupkg" --source "https://api.nuget.org/v3/index.json" --api-key "your-api-key"
The package includes scripts for:
When extending these contracts:
This project is licensed under the MIT License - see the file for details.
Built with โค๏ธ by the Bright River RealEstate Platform Team
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.2.40 | 323 | 12/4/2025 |
| 2.2.39 | 253 | 12/4/2025 |
| 2.2.38 | 414 | 11/13/2025 |
| 2.2.37 | 316 | 11/13/2025 |
| 2.2.36 | 314 | 11/10/2025 |
| 2.2.35 | 341 | 11/10/2025 |
| 2.2.30 | 211 | 11/9/2025 |
| 2.2.29 | 351 | 11/8/2025 |
| 2.2.28 | 211 | 11/7/2025 |
| 2.2.27 | 193 | 11/7/2025 |
| 2.2.26 | 265 | 11/4/2025 |
| 2.2.25 | 238 | 11/4/2025 |
| 2.2.24 | 195 | 10/31/2025 |
| 2.2.23 | 209 | 10/31/2025 |
| 2.2.21 | 238 | 10/30/2025 |
| 2.2.3 | 212 | 10/31/2025 |
| 2.2.2 | 321 | 10/30/2025 |
| 2.2.1 | 247 | 10/30/2025 |
| 2.1.35 | 242 | 10/29/2025 |
| 2.1.34 | 220 | 10/29/2025 |