Implement non-UI execution contract for department-labels#1609
Open
Benedict315 wants to merge 3 commits into
Open
Implement non-UI execution contract for department-labels#1609Benedict315 wants to merge 3 commits into
Benedict315 wants to merge 3 commits into
Conversation
Collaborator
|
@Benedict315 fix ci |
Author
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Created files:
contract.ts - Typed input/output interfaces with error codes
index.ts - Type exports
execution.service.ts - Non-UI service with validation and normalization
index.ts - Service exports
execution.fixtures.ts - Success and failure test fixtures
execution.service.test.ts - Comprehensive test suite
vitest.config.ts - Test configuration
CONTRACT.md - Complete execution contract documentation
index.ts - Main entry point exports
Key features:
Typed contract: DepartmentLabelsInput, DepartmentLabelsResult, DepartmentLabel interfaces
Error codes: INVALID_INPUT, DUPLICATE_LABEL_ID, DUPLICATE_DEPARTMENT, INVALID_COLOR_FORMAT, PERSISTENCE_FAILED, INTERNAL_ERROR
Service entry point: departmentLabelsService.execute(input) - default non-UI service
Customizable dependencies: Optional repository, generateId, and now for testing and backend integration
Fixtures: 9 test fixtures covering success case and all failure scenarios
Tests: 8 test cases validating contract behavior, error handling, and persistence
Acceptance criteria met:
✅ Typed input and output contract documented in CONTRACT.md
✅ Non-UI service entry point exported from index.ts
✅ Fixtures cover success and failure cases
✅ No styling or layout files changed
closes #1339