cpSpatial.Contracts
1.0.25
dotnet add package cpSpatial.Contracts --version 1.0.25
NuGet\Install-Package cpSpatial.Contracts -Version 1.0.25
<PackageReference Include="cpSpatial.Contracts" Version="1.0.25" />
<PackageVersion Include="cpSpatial.Contracts" Version="1.0.25" />
<PackageReference Include="cpSpatial.Contracts" />
paket add cpSpatial.Contracts --version 1.0.25
#r "nuget: cpSpatial.Contracts, 1.0.25"
#:package cpSpatial.Contracts@1.0.25
#addin nuget:?package=cpSpatial.Contracts&version=1.0.25
#tool nuget:?package=cpSpatial.Contracts&version=1.0.25
CivilPro.Spatial.Contracts
Shared schema contracts for Spatial job payloads used by CivilPro services.
This package defines the canonical DTOs, enums, and schema versions used to exchange spatial model jobs between the producer (CivilPro application / APIs) and the consumer (Spatial Service).
It exists to guarantee that both sides agree on structure, semantics, and evolution rules of spatial job payloads.
Why This Package Exists
Distributed systems fail most often at contract boundaries.
This library provides:
- A single source of truth for spatial job schemas
- Strong typing across services
- Explicit schema versioning
- Clear compatibility rules
It allows CivilPro services to evolve independently but safely.
What This Package Is (and Is Not)
✔ Included
- Job payload DTOs (e.g.
SpatialModelJobPayload) - Element, preset, shape, style, geometry payloads
- Shared enums (e.g.
SurfaceModelTypeEnum,ZSourceSettingEnum) - JSON-serialisable, transport-safe models
- Schema version constants and documentation
❌ Explicitly Not Included
- Entity Framework models or DbContexts
- Validation or resolution logic
- Geometry processing algorithms
- Azure, storage, or job orchestration concerns
- Any runtime spatial computation
Those responsibilities belong in service-specific libraries, not in the contract.
Architectural Role
+----------------------+ +----------------------+
| CivilPro API / UI | JSON | Spatial Service |
|----------------------|-------->|----------------------|
| EF Models | | Geometry processing |
| Payload assembly | | Validation + meshing |
| Client-side checks | | IFC generation |
+----------------------+ +----------------------+
^
|
| Shared Contract
|
+----------------------------------------------+
| CivilPro.Spatial.Contracts |
|----------------------------------------------|
| Payload DTOs |
| Enums |
| Schema version |
+----------------------------------------------+
Schema Versioning & Compatibility
Each payload includes an explicit schema version:
public sealed class SpatialModelJobPayload
{
public int SchemaVersion { get; set; } = 3;
}
Versioning Rules
This package follows semantic versioning aligned to schema compatibility:
| Change type | Package version | Schema impact |
|---|---|---|
| Bugfix / docs only | Patch (1.0.x) |
None |
| Backward-compatible schema extension | Minor (1.1.0) |
Optional fields only |
| Breaking schema change | Major (2.0.0) |
Consumer update required |
Service Expectations
- Producers must emit the correct
SchemaVersion - Consumers must validate the version before processing
- Older schema versions may be supported for migration windows
- Unknown schema versions must be rejected explicitly
Payload Resolution Model
Payloads represent raw configuration, not resolved values.
Resolution is intentionally deferred to the spatial service.
Resolution order:
- Element override
- Preset defaults
- Model defaults
- Validation failure if unresolved
Benefits:
- Smaller payloads
- Clear responsibility boundaries
- Easier long-term evolution
Geometry Handling Contract
- Payload geometries reference native coordinate systems
- Geometry is serialized as arrays of
[x, y, z] - Coordinate system metadata (SRID + WKT) is embedded
- WGS geometry is intentionally excluded
The spatial service is responsible for:
- Interpreting geometry
- Applying Z sourcing rules
- Querying surfaces when required
Stability Guarantees
This contract makes the following guarantees:
- DTO property names are stable once released
- Enums are append-only
- Existing fields are never repurposed
- Breaking changes require a major version bump
- Schema validation failures are explicit and deterministic
Usage
Add the package to producer and consumer projects:
dotnet add package CivilPro.Spatial.Contracts
For strict compatibility:
<PackageReference Include="CivilPro.Spatial.Contracts" Version="[1.0.0]" />
Changelog
All notable schema changes are documented here.
[1.0.0]
- Initial public release
- Spatial model job payload v3
- Element, preset, shape, style, geometry contracts
[1.1.0]
- (example) Added optional mesh override fields
- No breaking changes
[2.0.0]
- (example) Breaking schema restructure
- Requires consumer update
Design Philosophy
This library is intentionally:
- Boring
- Explicit
- Stable
- Minimal
If a change feels convenient but couples services together, it probably doesn’t belong here.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Microsoft.Extensions.Configuration.UserSecrets (>= 6.0.1)
- Microsoft.Extensions.DependencyInjection (>= 10.0.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Http (>= 10.0.2)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on cpSpatial.Contracts:
| Package | Downloads |
|---|---|
|
cpSpatial.Client
.NET client library for cpSpatial API (auth + typed endpoints). |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.25 | 149 | 2/25/2026 |
| 1.0.24 | 146 | 2/13/2026 |
| 1.0.23 | 123 | 2/13/2026 |
| 1.0.22 | 122 | 2/13/2026 |
| 1.0.21 | 133 | 2/11/2026 |
| 1.0.20 | 118 | 2/11/2026 |
| 1.0.19 | 135 | 2/11/2026 |
| 1.0.18 | 142 | 2/10/2026 |
| 1.0.17 | 132 | 2/10/2026 |
| 1.0.16 | 141 | 2/10/2026 |
| 1.0.15 | 129 | 2/10/2026 |
| 1.0.14 | 126 | 2/10/2026 |
| 1.0.13 | 121 | 2/10/2026 |
| 1.0.12 | 141 | 2/10/2026 |
| 1.0.11 | 126 | 2/9/2026 |
| 1.0.10 | 127 | 2/9/2026 |
| 1.0.9 | 130 | 2/9/2026 |
| 1.0.8 | 136 | 2/6/2026 |
| 1.0.7 | 161 | 2/6/2026 |
| 1.0.6 | 131 | 2/6/2026 |