7.4 Application (Commands, Queries, Endpoints)¶
Sprint: Sprint 07 - Product Catalog Domain
Feature ID: 7.4
Subtasks: 7.4.1, 7.4.2, 7.4.3, 7.4.4
Objective¶
Deliver "Application (Commands, Queries, Endpoints)" within Sprint 07 - Product Catalog Domain.
Dependencies¶
Aggregated from the subtasks below (prerequisite task IDs and enablers):
- 7.2.3
- 5.5.1
- 7.2.2
- 7.4.1
- 7.4.3
Subtasks¶
7.4.1 Create tariff (admin)¶
- ID: 7.4.1
- Title: Implement POST /api/v1/tariffs (admin)
- Description: Admin-guarded
CreateTariffCommandcreating an ACTIVE tariff and publishingtariff.created.v1via the outbox.CreateTariffRequest/TariffResponseDTOs. - Business Purpose: Admin catalog authoring (FR-05).
- Inputs: FR-05, event-catalog
tariff.created.v1. - Outputs: Command, handler, DTOs, endpoint, event.
- Acceptance Criteria:
- Admin creates a tariff (201) and
tariff.created.v1is written; non-admin gets 403. - Dependencies: 7.2.3, 5.5.1
- Complexity: M
7.4.2 Change tariff price (admin, versioned)¶
- ID: 7.4.2
- Title: Implement tariff price change with versioning and event
- Description: Admin-guarded command applying a price change via versioning (7.2.2), publishing
tariff.price-changed.v1(consumed by billing, notification). - Business Purpose: Controlled, audited price evolution (FR-08).
- Inputs: FR-08, event-catalog
tariff.price-changed.v1. - Outputs: Price-change command + endpoint + event.
- Acceptance Criteria:
- A price change creates a new version and emits
tariff.price-changed.v1; existing version pricing is unchanged. - Dependencies: 7.2.2, 7.4.1
- Complexity: M
7.4.3 Catalog read endpoints¶
- ID: 7.4.3
- Title: Implement tariff/addon read queries and endpoints
- Description:
GET /api/v1/tariffs,GET /api/v1/tariffs/{code},GET /api/v1/addons?tariffCode=..., returningApiResultwith pagination; only active-window products by default. - Business Purpose: Catalog browsing for customers and order-service (FR-05, FR-06).
- Inputs: FR-05, FR-06, analysis Section 8.2.
- Outputs: Queries + endpoints + DTOs.
- Acceptance Criteria:
- Listing returns paginated active tariffs;
GET /tariffs/{code}returns the current active version; addons can be filtered by tariff code. - Dependencies: 7.2.3
- Complexity: M
7.4.4 Internal price-snapshot endpoint¶
- ID: 7.4.4
- Title: Implement internal price-quote endpoint for order-service
- Description: An endpoint returning a priced snapshot for a product code at a point in time (current active version) that order-service calls synchronously and stores as a snapshot (analysis Section 9.1).
- Business Purpose: Orders must capture an immutable price snapshot at order time (FR-09 dependency).
- Inputs: analysis Section 9.1 ("Snapshot alınmalı").
- Outputs: Price-quote query + endpoint.
- Acceptance Criteria:
- Given a product code, the endpoint returns code, price, currency, and version usable as an order snapshot; an unknown/inactive code returns 404.
- Dependencies: 7.4.3
- Complexity: S
Acceptance Criteria¶
Each subtask above carries its own objective, testable acceptance criteria. This feature is complete when every subtask's acceptance criteria are met.
Deliverables¶
- Command, handler, DTOs, endpoint, event.
- Price-change command + endpoint + event.
- Queries + endpoints + DTOs.
- Price-quote query + endpoint.
Definition of Done¶
- All subtasks (7.4.1, 7.4.2, 7.4.3, 7.4.4) completed and their acceptance criteria verified.
- All listed dependencies satisfied.
- Build and tests green per the global conventions in ../README.md (Section 3).