feat: add print service#139
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a comprehensive print service implementation for Stickerlandia, introducing a complete print job management system with printer registration, job queuing, polling, and acknowledgment capabilities.
Changes:
- Implements core print service functionality including printer registration, print job submission, polling, and acknowledgment
- Adds comprehensive unit and integration test coverage for all major components
- Introduces a Blazor-based printer client application for job processing
Reviewed changes
Copilot reviewed 242 out of 268 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| print-service/tests/Stickerlandia.PrintService.UnitTest/PrintJobTests/*.cs | Unit tests for print job query and command handlers |
| print-service/tests/Stickerlandia.PrintService.IntegrationTest/*.cs | Integration tests covering printer and print job workflows |
| print-service/tests/Stickerlandia.PrintService.Client.Tests/*.cs | Unit tests for the printer client application |
| print-service/src/Stickerlandia.PrintService.Core/**/*.cs | Core domain models, handlers, and interfaces for print service |
| print-service/src/Stickerlandia.PrintService.Client/**/* | Blazor-based printer client application |
| print-service/src/utils/Stickerlandia.PrintService.JwtGenerator/*.cs | JWT token generation utility |
| print-service/src/Stickerlandia.PrintService.Worker/*.cs | Background worker services for outbox processing |
Files not reviewed (3)
- print-service/infra/azure/.terraform.lock.hcl: Language not supported
- print-service/infra/gcp/.terraform.lock.hcl: Language not supported
- print-service/src/Stickerlandia.PrintService.Agnostic/Migrations/20260115122951_InitialCreate.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| [JsonPropertyName("EventName")] | ||
| public string EventName { get; set; } = string.Empty; | ||
|
|
||
| [JsonPropertyName("printerName")] | ||
| public string PrinterName { get; set; } = string.Empty; | ||
|
|
||
| [JsonPropertyName("Key")] |
There was a problem hiding this comment.
The JsonPropertyName attributes use PascalCase ("EventName", "Key") which is inconsistent with the camelCase naming convention used in other response models in the same directory (e.g., "printerId", "printerName"). Consider changing to "eventName" and "key" for consistency.
| [JsonPropertyName("EventName")] | |
| public string EventName { get; set; } = string.Empty; | |
| [JsonPropertyName("printerName")] | |
| public string PrinterName { get; set; } = string.Empty; | |
| [JsonPropertyName("Key")] | |
| [JsonPropertyName("eventName")] | |
| public string EventName { get; set; } = string.Empty; | |
| [JsonPropertyName("printerName")] | |
| public string PrinterName { get; set; } = string.Empty; | |
| [JsonPropertyName("key")] |
| [JsonPropertyName("printerId")] | ||
| public string PrinterId { get; set; } = ""; | ||
|
|
||
| [JsonPropertyName("EventName")] |
There was a problem hiding this comment.
The JsonPropertyName attribute uses PascalCase ("EventName") which is inconsistent with the camelCase naming convention used in other DTO models (e.g., "printerId", "printerName"). Consider changing to "eventName" for consistency.
| [JsonPropertyName("EventName")] | |
| [JsonPropertyName("eventName")] |
| [JsonPropertyName("printerId")] | ||
| public string PrinterId { get; set; } | ||
|
|
||
| [JsonPropertyName("EventName")] |
There was a problem hiding this comment.
The JsonPropertyName attribute uses PascalCase ("EventName") which is inconsistent with the camelCase naming convention used for other properties in this class ("printerId", "printerName"). Consider changing to "eventName" for consistency.
| [JsonPropertyName("EventName")] | |
| [JsonPropertyName("eventName")] |
| Key = printer.Key; | ||
| } | ||
|
|
||
| [JsonPropertyName("Key")] public string Key { get; set; } = string.Empty; |
There was a problem hiding this comment.
The JsonPropertyName attribute uses PascalCase ("Key") which is inconsistent with the camelCase naming convention. Consider changing to "key" for consistency with standard JSON naming conventions.
| [JsonPropertyName("Key")] public string Key { get; set; } = string.Empty; | |
| [JsonPropertyName("key")] public string Key { get; set; } = string.Empty; |
| PrinterId = printer?.Id?.Value ?? ""; | ||
| } | ||
|
|
||
| [JsonPropertyName("EventName")] |
There was a problem hiding this comment.
The JsonPropertyName attribute uses PascalCase ("EventName") which is inconsistent with the camelCase naming convention used for other properties ("eventVersion", "printerId"). Consider changing to "eventName" for consistency.
| [JsonPropertyName("EventName")] | |
| [JsonPropertyName("eventName")] |
| StickerId = printJob.StickerId; | ||
| } | ||
|
|
||
| [JsonPropertyName("EventName")] |
There was a problem hiding this comment.
The JsonPropertyName attribute uses PascalCase ("EventName") which is inconsistent with the camelCase naming convention used for other properties ("eventVersion", "printJobId", "printerId", "userId", "stickerId"). Consider changing to "eventName" for consistency.
| [JsonPropertyName("EventName")] | |
| [JsonPropertyName("eventName")] |
| FailureReason = printJob.FailureReason ?? string.Empty; | ||
| } | ||
|
|
||
| [JsonPropertyName("EventName")] |
There was a problem hiding this comment.
The JsonPropertyName attribute uses PascalCase ("EventName") which is inconsistent with the camelCase naming convention used for other properties ("eventVersion", "printJobId", "printerId", "failureReason"). Consider changing to "eventName" for consistency.
| [JsonPropertyName("EventName")] | |
| [JsonPropertyName("eventName")] |
| CompletedAt = printJob.CompletedAt ?? DateTimeOffset.UtcNow; | ||
| } | ||
|
|
||
| [JsonPropertyName("EventName")] |
There was a problem hiding this comment.
The JsonPropertyName attribute uses PascalCase ("EventName") which is inconsistent with the camelCase naming convention used for other properties ("eventVersion", "printJobId", "printerId", "completedAt"). Consider changing to "eventName" for consistency.
| [JsonPropertyName("EventName")] | |
| [JsonPropertyName("eventName")] |
|
|
||
| public abstract record DomainEvent | ||
| { | ||
| [JsonPropertyName("EventName")] |
There was a problem hiding this comment.
The JsonPropertyName attribute uses PascalCase ("EventName") which is inconsistent with the camelCase naming convention used for "eventVersion". Consider changing to "eventName" for consistency.
| [JsonPropertyName("EventName")] | |
| [JsonPropertyName("eventName")] |
scottgerring
left a comment
There was a problem hiding this comment.
Review: SHA tagging inconsistency identified
| } | ||
|
|
||
| services | ||
| .AddStickerlandiaUserManagement(); |
There was a problem hiding this comment.
Copy-paste: calls AddStickerlandiaUserManagement() - needs renaming
| { | ||
| "$schema": "http://json.schemastore.org/launchsettings.json", | ||
| "profiles": { | ||
| "Stickerlandia.UserManagement.MigrationService": { |
There was a problem hiding this comment.
Copy-paste: profile name is Stickerlandia.UserManagement.MigrationService
…/ViewModels/RegisterPrinterResponse.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
@scottgerring could you review this file in particular please to check I've not broken anything propertly
There was a problem hiding this comment.
@scottgerring could you have a look at these auth file changes in particular, just to see if you can spot anything obvious I've broken.
… into feat/print-servic:wq
Implement print station UI for the sticker printing microservice: - Add PrintStation page with printer list and status polling - Add PrintDialog for selecting stickers and submitting print jobs - Add RegisterPrinterDialog for admin printer registration with API key display - Add print button to StickerDetail page with navigation state - Fix Sidebar link to Print Station - Add print.js service with proper auth and error handling Security & stability improvements from code review: - Add AbortController for all async fetch operations - Add mounted ref checks to prevent state updates after unmount - Add double-submit protection with ref guards - Add userId validation before API calls - Add URL parameter encoding (encodeURIComponent) - Add token validation in getHeaders() to prevent "Bearer undefined" - Fix stale closure in escape handler with useCallback Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
print frontend into print-service
Code ReviewI've found 9 issues in this PR that need attention: Critical Bugs 🐛
Security Issue 🔒
Quality Issues
Priority: Issues 1-6 are critical and should be fixed before merging. Issues 7-9 are quality improvements but less urgent. |
No description provided.