Compare commits
10 Commits
f58b431adf
...
5fc02886cf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5fc02886cf | ||
|
|
e663c39cb7 | ||
|
|
76295ee046 | ||
|
|
5e8c9e100f | ||
|
|
9a1dd45931 | ||
|
|
3878c46657 | ||
|
|
f82bab022a | ||
|
|
2ed6ba885d | ||
|
|
b24d4009ed | ||
|
|
c1cef614ba |
58
.gitignore
vendored
58
.gitignore
vendored
@ -1,53 +1,23 @@
|
|||||||
# AgileWebs local orchestration
|
# Repository orchestration folders (local only)
|
||||||
|
.repo-tasks/
|
||||||
|
.repo-context/
|
||||||
.tasks/
|
.tasks/
|
||||||
.agile/
|
.agile/
|
||||||
|
|
||||||
# Build artifacts
|
# .NET build outputs
|
||||||
**/[Bb]in/
|
**/bin/
|
||||||
**/[Oo]bj/
|
**/obj/
|
||||||
/**/out/
|
|
||||||
/**/artifacts/
|
|
||||||
|
|
||||||
# IDE and editor files
|
|
||||||
.vs/
|
.vs/
|
||||||
.idea/
|
TestResults/
|
||||||
.vscode/
|
**/TestResults/
|
||||||
*.suo
|
|
||||||
*.user
|
*.user
|
||||||
*.userosscache
|
*.suo
|
||||||
*.sln.docstates
|
|
||||||
*.rsuser
|
*.rsuser
|
||||||
*.swp
|
|
||||||
*.swo
|
|
||||||
|
|
||||||
# NuGet
|
# IDE
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# Package artifacts
|
||||||
*.nupkg
|
*.nupkg
|
||||||
*.snupkg
|
*.snupkg
|
||||||
**/packages/*
|
artifacts/
|
||||||
!**/packages/build/
|
|
||||||
|
|
||||||
# Test output
|
|
||||||
**/TestResults/
|
|
||||||
*.trx
|
|
||||||
*.coverage
|
|
||||||
*.coveragexml
|
|
||||||
|
|
||||||
# Logs
|
|
||||||
*.log
|
|
||||||
logs/
|
|
||||||
|
|
||||||
# Local environment files
|
|
||||||
.env
|
|
||||||
.env.*
|
|
||||||
!.env.example
|
|
||||||
|
|
||||||
# Docker
|
|
||||||
.docker/
|
|
||||||
**/.docker/
|
|
||||||
*.pid
|
|
||||||
docker-compose.override.yml
|
|
||||||
docker-compose.*.override.yml
|
|
||||||
|
|
||||||
# OS files
|
|
||||||
.DS_Store
|
|
||||||
Thumbs.db
|
|
||||||
|
|||||||
@ -1,86 +0,0 @@
|
|||||||
# Stage 1 Task
|
|
||||||
|
|
||||||
## 0. Header
|
|
||||||
- Task ID: TASK-20260222-001
|
|
||||||
- Title: Define inventory capability contract boundaries
|
|
||||||
- Status: Planned
|
|
||||||
- Priority: P1
|
|
||||||
- Target Repo: building-block-inventory
|
|
||||||
- Target Branch: feature/building-block-inventory-001
|
|
||||||
- Related Master Plan: plan/master-stage1-structural-normalization-2026-02-22.md
|
|
||||||
- Related Mini Plan: plan/building-block-inventory-mini-plan.md
|
|
||||||
|
|
||||||
## 1. Goal (What and Why)
|
|
||||||
### What
|
|
||||||
- Catalog inventory contract entities and request-response shapes
|
|
||||||
- Separate capability contracts from implementation concerns
|
|
||||||
|
|
||||||
### Why
|
|
||||||
- Inventory building block must remain contracts-only
|
|
||||||
|
|
||||||
## 2. Scope
|
|
||||||
### In Scope
|
|
||||||
- Contract ownership and boundary rules for inventory capability
|
|
||||||
|
|
||||||
### Out of Scope
|
|
||||||
- Provider or repository implementation details
|
|
||||||
|
|
||||||
## 3. Constraints (Non-Negotiable)
|
|
||||||
- Stage 1 planning only. No implementation changes.
|
|
||||||
- Do not modify any file under legacy.
|
|
||||||
- Do not run repo provisioning or CI generation.
|
|
||||||
- Follow the approved architecture boundaries and protocol policy.
|
|
||||||
- Keep identity abstractions inside Thalos repositories.
|
|
||||||
|
|
||||||
## 4. Documentation Requirement
|
|
||||||
- [ ] Capture planning decisions clearly for handoff.
|
|
||||||
- [ ] Identify documentation and diagram updates expected in later stages.
|
|
||||||
|
|
||||||
## 5. Context
|
|
||||||
- This task derives from plan/building-block-inventory-mini-plan.md.
|
|
||||||
- This task must remain decision-focused and implementation-ready.
|
|
||||||
|
|
||||||
## 6. Proposed Approach
|
|
||||||
- Define an ownership catalog for inventory capability contracts
|
|
||||||
|
|
||||||
## 7. Execution Steps
|
|
||||||
1. Review legacy evidence relevant to this task scope.
|
|
||||||
2. Define target boundary decisions and contract implications.
|
|
||||||
3. Record risks, dependencies, and compatibility notes.
|
|
||||||
4. Produce clear handoff guidance for implementation stage.
|
|
||||||
|
|
||||||
## 8. Acceptance Criteria
|
|
||||||
- [ ] Decisions are explicit, scoped, and actionable.
|
|
||||||
- [ ] Ownership boundaries are unambiguous.
|
|
||||||
- [ ] Protocol policy alignment is explicit where applicable.
|
|
||||||
- [ ] No forbidden Stage 1 actions were performed.
|
|
||||||
|
|
||||||
## 9. Testing Plan
|
|
||||||
### Unit Tests
|
|
||||||
- Not applicable for Stage 1 planning artifacts.
|
|
||||||
|
|
||||||
### Validation
|
|
||||||
- Ensure consistency with master plan and mini plan.
|
|
||||||
|
|
||||||
## 10. Definition of Done
|
|
||||||
- [ ] Task content is complete and consistent with other task files.
|
|
||||||
- [ ] References to master and mini plans are correct.
|
|
||||||
- [ ] Handoff notes are clear enough for immediate implementation.
|
|
||||||
|
|
||||||
## 11. Risks and Questions
|
|
||||||
- Risk: boundary drift during implementation.
|
|
||||||
- Mitigation: enforce repo intent metadata and mini plan ownership.
|
|
||||||
|
|
||||||
## 12. Handoff Notes
|
|
||||||
- Preserve approved constraints exactly.
|
|
||||||
- Implementers should execute this task only after reading master and mini plans.
|
|
||||||
|
|
||||||
END OF TASK
|
|
||||||
|
|
||||||
## 13. Completion Metadata
|
|
||||||
- Completion Stage: Stage 3 Execution
|
|
||||||
- Completed On: 2026-02-22
|
|
||||||
- Completed By: Codex
|
|
||||||
- Completion Branch: feature/building-block-inventory-001
|
|
||||||
- Completion Commit: b0cddfe
|
|
||||||
- Lifecycle State: done
|
|
||||||
10
Directory.Build.props
Normal file
10
Directory.Build.props
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<Authors>AgileWebs</Authors>
|
||||||
|
<Company>AgileWebs</Company>
|
||||||
|
<RepositoryType>git</RepositoryType>
|
||||||
|
<RepositoryUrl>https://gitea.dream-views.com/AgileWebs/building-block-inventory</RepositoryUrl>
|
||||||
|
<PackageProjectUrl>https://gitea.dream-views.com/AgileWebs/building-block-inventory</PackageProjectUrl>
|
||||||
|
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@ -3,15 +3,23 @@ skinparam packageStyle rectangle
|
|||||||
|
|
||||||
package "building-block-inventory" {
|
package "building-block-inventory" {
|
||||||
package "BuildingBlock.Inventory.Contracts" {
|
package "BuildingBlock.Inventory.Contracts" {
|
||||||
|
class Conventions
|
||||||
class Requests
|
class Requests
|
||||||
class Responses
|
class Responses
|
||||||
|
interface Adapters
|
||||||
|
class Grpc
|
||||||
interface Abstractions
|
interface Abstractions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
package "blueprint-platform" {
|
||||||
|
interface IBlueprintPackageContract
|
||||||
|
}
|
||||||
|
|
||||||
package "furniture-service" as FurnitureService
|
package "furniture-service" as FurnitureService
|
||||||
package "furniture-bff" as FurnitureBff
|
package "furniture-bff" as FurnitureBff
|
||||||
|
|
||||||
|
Conventions ..> IBlueprintPackageContract
|
||||||
FurnitureService --> Requests
|
FurnitureService --> Requests
|
||||||
FurnitureService --> Responses
|
FurnitureService --> Responses
|
||||||
FurnitureBff --> Requests
|
FurnitureBff --> Requests
|
||||||
|
|||||||
@ -4,14 +4,18 @@
|
|||||||
|
|
||||||
- `BuildingBlock.Inventory.Contracts`
|
- `BuildingBlock.Inventory.Contracts`
|
||||||
|
|
||||||
## Current Contract Groups
|
## Contract Groups
|
||||||
|
|
||||||
|
- `Conventions`: transport-neutral request/response and envelope conventions.
|
||||||
- `Requests`: capability request shapes for inventory use cases.
|
- `Requests`: capability request shapes for inventory use cases.
|
||||||
- `Responses`: capability response shapes for inventory use cases.
|
- `Responses`: capability response shapes for inventory use cases.
|
||||||
- `Abstractions`: marker abstractions for inventory contract ownership.
|
- `Abstractions`: marker abstractions for inventory contract ownership.
|
||||||
|
- `Adapters`: protocol adapter boundaries.
|
||||||
|
- `Grpc`: gRPC contract shapes for adapter translation.
|
||||||
|
|
||||||
## Ownership Boundary
|
## Ownership Boundary
|
||||||
|
|
||||||
- This repository owns inventory capability contracts only.
|
- This repository owns inventory capability contracts only.
|
||||||
|
- Contract metadata consumes `Core.Blueprint.Common.Contracts` and does not redefine Blueprint contracts.
|
||||||
- Implementation details stay in furniture-service, furniture-bff, or furniture-dal.
|
- Implementation details stay in furniture-service, furniture-bff, or furniture-dal.
|
||||||
- Identity abstractions are out of scope and remain Thalos-owned.
|
- Identity abstractions are out of scope and remain Thalos-owned.
|
||||||
|
|||||||
@ -6,7 +6,12 @@
|
|||||||
- Breaking changes require a new major package version.
|
- Breaking changes require a new major package version.
|
||||||
- Deprecated members should remain for at least one release cycle.
|
- Deprecated members should remain for at least one release cycle.
|
||||||
|
|
||||||
|
## Blueprint Compatibility
|
||||||
|
|
||||||
|
- Package descriptor metadata is implemented via `IBlueprintPackageContract` from `Core.Blueprint.Common.Contracts`.
|
||||||
|
- Inventory contracts consume Blueprint common contract primitives rather than redefining them.
|
||||||
|
|
||||||
## Compatibility Notes
|
## Compatibility Notes
|
||||||
|
|
||||||
- Consumer repositories (`furniture-service`, `furniture-bff`) should update contracts explicitly.
|
- Consumer repositories (`furniture-service`, `furniture-bff`) should update contracts explicitly.
|
||||||
- Transport adapters remain outside this contracts package.
|
- Protocol adapters remain edge concerns; inventory contracts remain transport-neutral.
|
||||||
|
|||||||
29
docs/contracts/nuget-publication-baseline.md
Normal file
29
docs/contracts/nuget-publication-baseline.md
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# Inventory Contracts NuGet Publication Baseline
|
||||||
|
|
||||||
|
## Feed
|
||||||
|
|
||||||
|
- Source: `https://gitea.dream-views.com/api/packages/AgileWebs/nuget/index.json`
|
||||||
|
- Authentication: Gitea login + token
|
||||||
|
- HTTP requirement: `allowInsecureConnections="true"` in `nuget.config`
|
||||||
|
|
||||||
|
## Stable Version Matrix
|
||||||
|
|
||||||
|
| Package | Version | Published On |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| BuildingBlock.Inventory.Contracts | 0.2.0 | 2026-02-25 |
|
||||||
|
|
||||||
|
## Dependency Note
|
||||||
|
|
||||||
|
`BuildingBlock.Inventory.Contracts` depends on:
|
||||||
|
|
||||||
|
- `Core.Blueprint.Common` version `0.2.0`
|
||||||
|
|
||||||
|
Stable package waves must keep dependency versions aligned.
|
||||||
|
|
||||||
|
## Consumer Validation
|
||||||
|
|
||||||
|
Restore validation passed using:
|
||||||
|
|
||||||
|
- `TargetFramework`: `net10.0`
|
||||||
|
- `PackageReference`: `BuildingBlock.Inventory.Contracts` `0.2.0`
|
||||||
|
- Restore flags: `--no-cache --force`
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
using BuildingBlock.Inventory.Contracts.Grpc;
|
||||||
|
using BuildingBlock.Inventory.Contracts.Requests;
|
||||||
|
using BuildingBlock.Inventory.Contracts.Responses;
|
||||||
|
|
||||||
|
namespace BuildingBlock.Inventory.Contracts.Adapters;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines adapter boundary for gRPC contract translation.
|
||||||
|
/// </summary>
|
||||||
|
public interface IInventoryGrpcContractAdapter
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Maps transport-neutral request into gRPC contract shape.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request">Transport-neutral inventory lookup request.</param>
|
||||||
|
/// <returns>gRPC contract request shape.</returns>
|
||||||
|
InventoryItemLookupGrpcContract ToGrpcRequest(InventoryItemLookupRequest request);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Maps gRPC contract response data into transport-neutral response.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="contract">gRPC contract response shape.</param>
|
||||||
|
/// <returns>Transport-neutral inventory lookup response.</returns>
|
||||||
|
InventoryItemLookupResponse FromGrpcResponse(InventoryItemLookupGrpcContract contract);
|
||||||
|
}
|
||||||
@ -4,4 +4,7 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Core.Blueprint.Common" Version="0.2.0" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -0,0 +1,9 @@
|
|||||||
|
namespace BuildingBlock.Inventory.Contracts.Conventions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines transport-neutral request contract shape for inventory capability operations.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TResponse">Response contract type.</typeparam>
|
||||||
|
public interface IInventoryContractRequest<out TResponse>
|
||||||
|
{
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
namespace BuildingBlock.Inventory.Contracts.Conventions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines transport-neutral envelope metadata for inventory contract messages.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ContractVersion">Contract schema version.</param>
|
||||||
|
/// <param name="CorrelationId">Correlation identifier for cross-service tracing.</param>
|
||||||
|
public sealed record InventoryContractEnvelope(string ContractVersion, string CorrelationId);
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
using Core.Blueprint.Common.Contracts;
|
||||||
|
|
||||||
|
namespace BuildingBlock.Inventory.Contracts.Conventions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines package descriptor metadata for inventory contracts package.
|
||||||
|
/// </summary>
|
||||||
|
public sealed class InventoryPackageContract : IBlueprintPackageContract
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public BlueprintPackageDescriptor Descriptor { get; } = new(
|
||||||
|
"BuildingBlock.Inventory.Contracts",
|
||||||
|
PackageVersionPolicy.Minor,
|
||||||
|
["Core.Blueprint.Common"]);
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
namespace BuildingBlock.Inventory.Contracts.Grpc;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines minimal gRPC contract shape for adapter-level translation.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ItemCode">External item identifier.</param>
|
||||||
|
public sealed record InventoryItemLookupGrpcContract(string ItemCode);
|
||||||
@ -1,7 +1,13 @@
|
|||||||
|
using BuildingBlock.Inventory.Contracts.Conventions;
|
||||||
|
|
||||||
namespace BuildingBlock.Inventory.Contracts.Requests;
|
namespace BuildingBlock.Inventory.Contracts.Requests;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the contract request to lookup an inventory item.
|
/// Represents the transport-neutral contract request to lookup an inventory item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="Envelope">Contract envelope metadata.</param>
|
||||||
/// <param name="ItemCode">External item identifier.</param>
|
/// <param name="ItemCode">External item identifier.</param>
|
||||||
public sealed record InventoryItemLookupRequest(string ItemCode);
|
public sealed record InventoryItemLookupRequest(
|
||||||
|
InventoryContractEnvelope Envelope,
|
||||||
|
string ItemCode)
|
||||||
|
: IInventoryContractRequest<Responses.InventoryItemLookupResponse>;
|
||||||
|
|||||||
@ -1,8 +1,14 @@
|
|||||||
|
using BuildingBlock.Inventory.Contracts.Conventions;
|
||||||
|
|
||||||
namespace BuildingBlock.Inventory.Contracts.Responses;
|
namespace BuildingBlock.Inventory.Contracts.Responses;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the contract response for an inventory item lookup.
|
/// Represents the transport-neutral contract response for an inventory item lookup.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="Envelope">Contract envelope metadata.</param>
|
||||||
/// <param name="ItemCode">External item identifier.</param>
|
/// <param name="ItemCode">External item identifier.</param>
|
||||||
/// <param name="QuantityAvailable">Current quantity available.</param>
|
/// <param name="QuantityAvailable">Current quantity available.</param>
|
||||||
public sealed record InventoryItemLookupResponse(string ItemCode, int QuantityAvailable);
|
public sealed record InventoryItemLookupResponse(
|
||||||
|
InventoryContractEnvelope Envelope,
|
||||||
|
string ItemCode,
|
||||||
|
int QuantityAvailable);
|
||||||
|
|||||||
@ -1,24 +1,42 @@
|
|||||||
|
using BuildingBlock.Inventory.Contracts.Conventions;
|
||||||
using BuildingBlock.Inventory.Contracts.Requests;
|
using BuildingBlock.Inventory.Contracts.Requests;
|
||||||
using BuildingBlock.Inventory.Contracts.Responses;
|
using BuildingBlock.Inventory.Contracts.Responses;
|
||||||
|
using Core.Blueprint.Common.Contracts;
|
||||||
|
|
||||||
namespace BuildingBlock.Inventory.Contracts.UnitTests;
|
namespace BuildingBlock.Inventory.Contracts.UnitTests;
|
||||||
|
|
||||||
public class ContractShapeTests
|
public class ContractShapeTests
|
||||||
{
|
{
|
||||||
[Fact]
|
[Fact]
|
||||||
public void InventoryItemLookupRequest_WhenCreated_StoresItemCode()
|
public void InventoryItemLookupRequest_WhenCreated_StoresTransportNeutralData()
|
||||||
{
|
{
|
||||||
var request = new InventoryItemLookupRequest("SKU-001");
|
var envelope = new InventoryContractEnvelope("1.0.0", "corr-123");
|
||||||
|
var request = new InventoryItemLookupRequest(envelope, "SKU-001");
|
||||||
|
|
||||||
|
Assert.Equal("1.0.0", request.Envelope.ContractVersion);
|
||||||
|
Assert.Equal("corr-123", request.Envelope.CorrelationId);
|
||||||
Assert.Equal("SKU-001", request.ItemCode);
|
Assert.Equal("SKU-001", request.ItemCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void InventoryItemLookupResponse_WhenCreated_StoresContractData()
|
public void InventoryItemLookupResponse_WhenCreated_StoresTransportNeutralData()
|
||||||
{
|
{
|
||||||
var response = new InventoryItemLookupResponse("SKU-001", 5);
|
var envelope = new InventoryContractEnvelope("1.0.0", "corr-123");
|
||||||
|
var response = new InventoryItemLookupResponse(envelope, "SKU-001", 5);
|
||||||
|
|
||||||
|
Assert.Equal("1.0.0", response.Envelope.ContractVersion);
|
||||||
|
Assert.Equal("corr-123", response.Envelope.CorrelationId);
|
||||||
Assert.Equal("SKU-001", response.ItemCode);
|
Assert.Equal("SKU-001", response.ItemCode);
|
||||||
Assert.Equal(5, response.QuantityAvailable);
|
Assert.Equal(5, response.QuantityAvailable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void InventoryPackageContract_WhenCreated_UsesBlueprintDescriptorContract()
|
||||||
|
{
|
||||||
|
IBlueprintPackageContract contract = new InventoryPackageContract();
|
||||||
|
|
||||||
|
Assert.Equal("BuildingBlock.Inventory.Contracts", contract.Descriptor.PackageId);
|
||||||
|
Assert.Equal(PackageVersionPolicy.Minor, contract.Descriptor.VersionPolicy);
|
||||||
|
Assert.Contains("Core.Blueprint.Common", contract.Descriptor.DependencyPackageIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user