Return campaign status sentinels without wrapping

Drop CampaignStatusError from errors.go and map coredata status to
client errors in the service layer only. Cancel on terminal statuses
uses the same sentinels instead of fmt status strings.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
Cursor Agent
2026-07-27 13:06:39 +00:00
parent c187ea7124
commit 352c551e53
3 changed files with 28 additions and 32 deletions

View File

@@ -21,15 +21,13 @@
package accessreview
import (
"errors"
"fmt"
"testing"
"github.com/stretchr/testify/assert"
"go.probo.inc/probo/pkg/coredata"
)
func TestCampaignStatusError(t *testing.T) {
func TestCampaignNotDraftError(t *testing.T) {
t.Parallel()
tests := []struct {
@@ -46,8 +44,7 @@ func TestCampaignStatusError(t *testing.T) {
t.Run(string(tt.status), func(t *testing.T) {
t.Parallel()
err := fmt.Errorf("cannot start campaign: %w", CampaignStatusError(tt.status))
assert.ErrorIs(t, err, tt.want)
assert.ErrorIs(t, campaignNotDraftError(tt.status), tt.want)
})
}
}