@@ -2,6 +2,7 @@ package connectors
22
33import (
44 "context"
5+ "time"
56
67 "github.com/google/uuid"
78
@@ -10,51 +11,55 @@ import (
1011)
1112
1213type FrameworkUsecase interface {
13- ListControls (ctx context.Context ) []domain. Control
14- GetControl (ctx context.Context , id string ) (* domain. Control , error )
14+ ListControls (ctx context.Context ) []dto. ControlResponse
15+ GetControl (ctx context.Context , id string ) (* dto. ControlResponse , error )
1516
16- ListFrameworks (ctx context.Context ) []domain. Framework
17- GetFramework (ctx context.Context , key string ) (* domain. Framework , error )
17+ ListFrameworks (ctx context.Context ) []dto. FrameworkResponse
18+ GetFramework (ctx context.Context , key string ) (* dto. FrameworkResponse , error )
1819
1920 CreateControl (ctx context.Context , c domain.Control ) (* domain.Control , error )
2021 UpdateControl (ctx context.Context , c domain.Control ) (* domain.Control , error )
2122 DeleteControl (ctx context.Context , id string ) error
22- SetControlEnabled (ctx context.Context , id string , enabled bool ) error
2323
2424 CreateFramework (ctx context.Context , f domain.Framework ) (* domain.Framework , error )
2525 UpdateFramework (ctx context.Context , f domain.Framework ) (* domain.Framework , error )
2626 DeleteFramework (ctx context.Context , key string ) error
27- SetFrameworkEnabled (ctx context.Context , key string , enabled bool ) error
2827}
2928
3029type ReportBrand struct {
31- Name string // product/company name (defaults to "UTMStack")
32- LogoPath string // absolute path to a PNG/JPG report logo on disk ("" → none)
30+ Name string // product/company name (defaults to "UTMStack")
31+ LogoPath string // absolute path to a PNG/JPG report logo on disk ("" → none)
32+ // CoverPath is the full-bleed image behind the cover page, configured with
33+ // the rest of the branding. Empty falls back to a plain typographic cover.
34+ CoverPath string
3335 AccentHex string // accent color, CSS hex (e.g. "#6366f1"); "" → default
36+ // PreparedBy names whoever asked for the document. A report says who
37+ // produced it; that is half of what makes it evidence.
38+ PreparedBy string
3439}
3540
3641type BrandingProvider interface {
3742 ReportBrand (ctx context.Context ) ReportBrand
3843}
3944
4045type EvaluatorUsecase interface {
41- EvaluateFramework (ctx context.Context , frameworkKey string ) (* domain. Report , error )
42- GenerateReport (ctx context.Context , frameworkKey string ) (* domain. Report , error ) // evaluate + store snapshot
43- ListReports (ctx context.Context , frameworkKey string , limit int ) ([]domain. ReportSnapshotMeta , error )
44- GetReport (ctx context.Context , id string ) ( * domain. ReportSnapshot , error )
45- DeleteReport (ctx context.Context , id string ) error
46- FrameworkReportPDF ( ctx context. Context , frameworkKey string ) ([] byte , string , error ) // live eval → PDF + framework name
47- SnapshotPDF ( ctx context. Context , id string ) ([] byte , string , error ) // stored snapshot → PDF + framework name
48- SetStatusOverride ( ctx context. Context , frameworkKey , controlID , status , reason string ) error
49- ClearStatusOverride (ctx context.Context , frameworkKey , controlID string ) error
50- SetControlNote (ctx context.Context , frameworkKey , controlID , note string ) error
51- ClearControlNote (ctx context.Context , frameworkKey , controlID string ) error
46+ Evaluate (ctx context.Context , frameworkKey string , windowDays int ) (* dto. ReportResponse , error )
47+ Get (ctx context.Context , frameworkKey string ) (* dto. ReportResponse , error )
48+ List (ctx context.Context ) ([]dto. ReportMeta , error )
49+ Delete (ctx context.Context , frameworkKey string ) error
50+ EditControl (ctx context.Context , editedBy , frameworkKey , controlID string , req dto. EditControlRequest ) ( * dto. ReportResponse , error )
51+ // preparedBy names whoever asked for the document — a report says who
52+ // produced it, and that is half of what makes it evidence. A scheduled run
53+ // has no requester and passes "".
54+ PDF (ctx context.Context , frameworkKey , preparedBy string ) ([] byte , string , error )
55+ History (ctx context.Context , frameworkKey string , from , to time. Time ) ([]dto. ScorePoint , error )
56+ HistoryPDF (ctx context.Context , frameworkKey , preparedBy string , day time. Time ) ([] byte , string , error )
5257}
5358
5459type ScheduleUsecase interface {
5560 Create (ctx context.Context , userID uuid.UUID , req dto.CreateScheduleRequest ) (* dto.ScheduleResponse , error )
5661 Update (ctx context.Context , userID uuid.UUID , req dto.UpdateScheduleRequest ) (* dto.ScheduleResponse , error )
57- GetByID (ctx context.Context , id int64 ) (* dto.ScheduleResponse , error )
62+ GetByID (ctx context.Context , id uuid. UUID ) (* dto.ScheduleResponse , error )
5863 ListByUser (ctx context.Context , userID uuid.UUID , f dto.ScheduleFilters ) ([]dto.ScheduleResponse , int64 , error )
59- Delete (ctx context.Context , id int64 ) error
64+ Delete (ctx context.Context , id uuid. UUID ) error
6065}
0 commit comments