Set FirstLevel true for auto-created third parties
Third parties created by the tracker mapping worker are confirmed active on the organization's cookie banner, making them first-level by definition. Also remove unused ptr test helpers. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -28,9 +28,6 @@ import (
|
|||||||
"go.probo.inc/probo/pkg/gid"
|
"go.probo.inc/probo/pkg/gid"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:fix inline
|
|
||||||
func ptr[T any](v T) *T { return new(v) }
|
|
||||||
|
|
||||||
// promotionFixture extends workerFixture with a CommonThirdParty and a
|
// promotionFixture extends workerFixture with a CommonThirdParty and a
|
||||||
// CommonTrackerPattern linking the catalog to the test pattern. It is
|
// CommonTrackerPattern linking the catalog to the test pattern. It is
|
||||||
// the minimum scaffolding promoteThirdParty needs to run end-to-end.
|
// the minimum scaffolding promoteThirdParty needs to run end-to-end.
|
||||||
@@ -252,7 +249,7 @@ func TestPromoteThirdParty_FallbackCreate(t *testing.T) {
|
|||||||
require.NotNil(t, reloaded.CommonThirdPartyID)
|
require.NotNil(t, reloaded.CommonThirdPartyID)
|
||||||
assert.Equal(t, fx.commonThirdPartyID, *reloaded.CommonThirdPartyID)
|
assert.Equal(t, fx.commonThirdPartyID, *reloaded.CommonThirdPartyID)
|
||||||
assert.Equal(t, coredata.ThirdPartyCategoryAnalytics, reloaded.Category)
|
assert.Equal(t, coredata.ThirdPartyCategoryAnalytics, reloaded.Category)
|
||||||
assert.False(t, reloaded.FirstLevel)
|
assert.True(t, reloaded.FirstLevel)
|
||||||
assert.False(t, reloaded.ShowOnTrustCenter)
|
assert.False(t, reloaded.ShowOnTrustCenter)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
9
pkg/thirdparty/match.go
vendored
9
pkg/thirdparty/match.go
vendored
@@ -219,9 +219,10 @@ func LinkToCommon(
|
|||||||
// CreateFromCommon inserts a new org ThirdParty seeded from the catalog
|
// CreateFromCommon inserts a new org ThirdParty seeded from the catalog
|
||||||
// row (name, category, addresses, URLs, certifications, …). The new row
|
// row (name, category, addresses, URLs, certifications, …). The new row
|
||||||
// has common_third_party_id pointed at commonParty, an empty Countries
|
// has common_third_party_id pointed at commonParty, an empty Countries
|
||||||
// list, and ShowOnTrustCenter / FirstLevel both false — mirroring the
|
// list, ShowOnTrustCenter false, and FirstLevel true — the caller has
|
||||||
// front-end CreateThirdPartyDialog's "pick from catalog" seeding shape
|
// already confirmed the vendor is actively present on the
|
||||||
// so the result is indistinguishable from a manual creation.
|
// organization's cookie banner, which makes it a first-level third
|
||||||
|
// party by definition.
|
||||||
//
|
//
|
||||||
// Deliberately bypasses any service-level webhook emission: callers
|
// Deliberately bypasses any service-level webhook emission: callers
|
||||||
// that need a webhook for the implicit creation should emit it
|
// that need a webhook for the implicit creation should emit it
|
||||||
@@ -257,7 +258,7 @@ func CreateFromCommon(
|
|||||||
SecurityPageURL: commonParty.SecurityPageURL,
|
SecurityPageURL: commonParty.SecurityPageURL,
|
||||||
TrustPageURL: commonParty.TrustPageURL,
|
TrustPageURL: commonParty.TrustPageURL,
|
||||||
ShowOnTrustCenter: false,
|
ShowOnTrustCenter: false,
|
||||||
FirstLevel: false,
|
FirstLevel: true,
|
||||||
CreatedAt: now,
|
CreatedAt: now,
|
||||||
UpdatedAt: now,
|
UpdatedAt: now,
|
||||||
}
|
}
|
||||||
|
|||||||
3
pkg/thirdparty/match_test.go
vendored
3
pkg/thirdparty/match_test.go
vendored
@@ -23,9 +23,6 @@ import (
|
|||||||
"go.probo.inc/probo/pkg/gid"
|
"go.probo.inc/probo/pkg/gid"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:fix inline
|
|
||||||
func ptr[T any](v T) *T { return new(v) }
|
|
||||||
|
|
||||||
func TestStripCorporateSuffixes(t *testing.T) {
|
func TestStripCorporateSuffixes(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user