mirror of
https://github.com/azaion/admin.git
synced 2026-06-21 18:31:10 +00:00
[AZ-513] [AZ-196] [AZ-183] Add /classes CRUD, /devices, fleet OTA
AZ-513: POST/PATCH/DELETE /classes for detection-class CRUD; new DetectionClass entity, schema, DTOs, IDetectionClassService. Unblocks ui/AZ-512. AZ-196: POST /devices auto-assigns sequential azj-NNNN serial+email +password and inserts a CompanionPC user. Returns plaintext credentials for the provisioning script. AZ-183: Resources table + POST /get-update + POST /resources/publish for fleet OTA. Per-resource encryption_key column AES-256-CBC encrypted at rest with ResourcesConfig.EncryptionMasterKey; ICache wraps the per-(arch,stage) latest-versions lookup and is invalidated on publish. Adds IDbFactory.RunAdmin<T> overload for write-and-return. Backfills _docs/02_document/module-layout.md to satisfy the implement skill's File Ownership prerequisite (the _docs/ artifact set predates the Step 1.5 module-layout addition). Code review: PASS_WITH_WARNINGS — see _docs/03_implementation/reviews/batch_05_review.md. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace Azaion.Common.Requests;
|
||||
|
||||
public class CreateDetectionClassRequest
|
||||
{
|
||||
public string Name { get; set; } = null!;
|
||||
public string ShortName { get; set; } = null!;
|
||||
public string Color { get; set; } = null!;
|
||||
public double MaxSizeM { get; set; }
|
||||
public string? PhotoMode { get; set; }
|
||||
}
|
||||
|
||||
public class CreateDetectionClassValidator : AbstractValidator<CreateDetectionClassRequest>
|
||||
{
|
||||
public CreateDetectionClassValidator()
|
||||
{
|
||||
RuleFor(r => r.Name).NotEmpty().MaximumLength(120);
|
||||
RuleFor(r => r.ShortName).NotEmpty().MaximumLength(20);
|
||||
RuleFor(r => r.Color).NotEmpty().MaximumLength(20);
|
||||
RuleFor(r => r.MaxSizeM).GreaterThan(0);
|
||||
RuleFor(r => r.PhotoMode!).MaximumLength(20).When(r => r.PhotoMode != null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user