feat(admin): add routed task evidence details
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
// Package taskdetail provides a read-only audit projection for one task.
|
||||
package taskdetail
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"time"
|
||||
)
|
||||
|
||||
var ErrNotFound = errors.New("task detail not found")
|
||||
|
||||
type Store interface {
|
||||
Get(context.Context, string) (Detail, error)
|
||||
}
|
||||
|
||||
type Detail struct {
|
||||
Task Task
|
||||
Authorizations []Authorization
|
||||
Attempts []Attempt
|
||||
Submissions []Submission
|
||||
Evidence []Evidence
|
||||
}
|
||||
|
||||
type Task struct {
|
||||
ID, Source, Title, GoodsID, SKUColor, SKUSize, MaxTotalPrice, Status string
|
||||
Quantity, Version int
|
||||
CreatedAt, UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type Authorization struct {
|
||||
ID, Status, CreatedBy, TotalPriceCap string
|
||||
TaskVersion int
|
||||
CreatedAt, ExpiresAt time.Time
|
||||
}
|
||||
|
||||
type Attempt struct {
|
||||
ID, AuthorizationID, Status string
|
||||
ClaimGeneration int
|
||||
Gate1UnitPrice *string
|
||||
Gate2UnitPrice *string
|
||||
QuantityRead *int
|
||||
ConfirmAmount *string
|
||||
FailureCode *string
|
||||
StartedAt time.Time
|
||||
FinishedAt *time.Time
|
||||
}
|
||||
|
||||
type Submission struct {
|
||||
ID, AuthorizationID, AttemptID, Status string
|
||||
Gate1UnitPrice, Gate2UnitPrice, ConfirmAmount string
|
||||
QuantityRead int
|
||||
CreatedAt time.Time
|
||||
ResolvedAt *time.Time
|
||||
}
|
||||
|
||||
type Evidence struct {
|
||||
ID, AttemptID, Kind, PrivacyTier, SHA256, ContentType string
|
||||
ByteSize, Width, Height int64
|
||||
CapturedAt time.Time
|
||||
}
|
||||
Reference in New Issue
Block a user