Compare commits
No commits in common. "5fc02886cf72a5ed1661e8defb7cd1dd74762fb7" and "f58b431adf9719b63c7775c5a17383ccae1df05e" have entirely different histories.
5fc02886cf
...
f58b431adf
60
.gitignore
vendored
60
.gitignore
vendored
@ -1,23 +1,53 @@
|
|||||||
# Repository orchestration folders (local only)
|
# AgileWebs local orchestration
|
||||||
.repo-tasks/
|
|
||||||
.repo-context/
|
|
||||||
.tasks/
|
.tasks/
|
||||||
.agile/
|
.agile/
|
||||||
|
|
||||||
# .NET build outputs
|
# Build artifacts
|
||||||
**/bin/
|
**/[Bb]in/
|
||||||
**/obj/
|
**/[Oo]bj/
|
||||||
|
/**/out/
|
||||||
|
/**/artifacts/
|
||||||
|
|
||||||
|
# IDE and editor files
|
||||||
.vs/
|
.vs/
|
||||||
TestResults/
|
|
||||||
**/TestResults/
|
|
||||||
*.user
|
|
||||||
*.suo
|
|
||||||
*.rsuser
|
|
||||||
|
|
||||||
# IDE
|
|
||||||
.idea/
|
.idea/
|
||||||
|
.vscode/
|
||||||
|
*.suo
|
||||||
|
*.user
|
||||||
|
*.userosscache
|
||||||
|
*.sln.docstates
|
||||||
|
*.rsuser
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
|
||||||
# Package artifacts
|
# NuGet
|
||||||
*.nupkg
|
*.nupkg
|
||||||
*.snupkg
|
*.snupkg
|
||||||
artifacts/
|
**/packages/*
|
||||||
|
!**/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
|
||||||
|
|||||||
86
.tasks/done/TASK-20260222-001.md
Normal file
86
.tasks/done/TASK-20260222-001.md
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
# 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
|
||||||
@ -1,10 +0,0 @@
|
|||||||
<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,23 +3,15 @@ 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,18 +4,14 @@
|
|||||||
|
|
||||||
- `BuildingBlock.Inventory.Contracts`
|
- `BuildingBlock.Inventory.Contracts`
|
||||||
|
|
||||||
## Contract Groups
|
## Current 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,12 +6,7 @@
|
|||||||
- 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.
|
||||||
- Protocol adapters remain edge concerns; inventory contracts remain transport-neutral.
|
- Transport adapters remain outside this contracts package.
|
||||||
|
|||||||
@ -1,29 +0,0 @@
|
|||||||
# 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`
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
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,7 +4,4 @@
|
|||||||
<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>
|
||||||
|
|||||||
@ -1,9 +0,0 @@
|
|||||||
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>
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
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);
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
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"]);
|
|
||||||
}
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
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,13 +1,7 @@
|
|||||||
using BuildingBlock.Inventory.Contracts.Conventions;
|
|
||||||
|
|
||||||
namespace BuildingBlock.Inventory.Contracts.Requests;
|
namespace BuildingBlock.Inventory.Contracts.Requests;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the transport-neutral contract request to lookup an inventory item.
|
/// Represents the 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(
|
public sealed record InventoryItemLookupRequest(string ItemCode);
|
||||||
InventoryContractEnvelope Envelope,
|
|
||||||
string ItemCode)
|
|
||||||
: IInventoryContractRequest<Responses.InventoryItemLookupResponse>;
|
|
||||||
|
|||||||
@ -1,14 +1,8 @@
|
|||||||
using BuildingBlock.Inventory.Contracts.Conventions;
|
|
||||||
|
|
||||||
namespace BuildingBlock.Inventory.Contracts.Responses;
|
namespace BuildingBlock.Inventory.Contracts.Responses;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the transport-neutral contract response for an inventory item lookup.
|
/// Represents the 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(
|
public sealed record InventoryItemLookupResponse(string ItemCode, int QuantityAvailable);
|
||||||
InventoryContractEnvelope Envelope,
|
|
||||||
string ItemCode,
|
|
||||||
int QuantityAvailable);
|
|
||||||
|
|||||||
@ -1,42 +1,24 @@
|
|||||||
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_StoresTransportNeutralData()
|
public void InventoryItemLookupRequest_WhenCreated_StoresItemCode()
|
||||||
{
|
{
|
||||||
var envelope = new InventoryContractEnvelope("1.0.0", "corr-123");
|
var request = new InventoryItemLookupRequest("SKU-001");
|
||||||
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_StoresTransportNeutralData()
|
public void InventoryItemLookupResponse_WhenCreated_StoresContractData()
|
||||||
{
|
{
|
||||||
var envelope = new InventoryContractEnvelope("1.0.0", "corr-123");
|
var response = new InventoryItemLookupResponse("SKU-001", 5);
|
||||||
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