Fix control object without state

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-02-05 11:07:48 -08:00
parent ace78da341
commit 2723d34592

View File

@@ -54,6 +54,7 @@ func (s Service) CreateControl(
FrameworkID: req.FrameworkID,
Name: req.Name,
Description: req.Description,
State: coredata.ControlStateNotStarted,
ContentRef: req.ContentRef,
CreatedAt: now,
UpdatedAt: now,
@@ -63,7 +64,7 @@ func (s Service) CreateControl(
StateTransition: coredata.StateTransition[coredata.ControlState]{
ID: controlStateTransitionID,
FromState: nil,
ToState: coredata.ControlStateNotStarted,
ToState: control.State,
Reason: ref.Ref("Initial state"),
CreatedAt: now,
UpdatedAt: now,