package constants

// Profile IDs owned by the platform bootstrap profile metadata.
const (
	ProfileSystemAdmin  = "system_admin"
	ProfileStandardUser = "standard_user"
)

// ProfileDisplayName returns the display name for a known profile ID.
// Returns the ID itself as fallback for unknown/custom profiles.
var profileNames = map[string]string{
	ProfileSystemAdmin:  "System Administrator",
	ProfileStandardUser: "Standard User",
}

func ProfileDisplayName(profileID string) string {
	if name, ok := profileNames[profileID]; ok {
		return name
	}
	return profileID
}

// PlatformDefaultProfileIDs is the set of built-in profiles for which the
// platform seeds default object/field permissions. Imported / admin-created
// profiles are NOT platform-managed: their access is owned by the import or the
// admin, so the platform must neither seed defaults for them nor expect full
// permission coverage on them. This set MUST stay in sync with
// permissions.profilePermRules — guarded by a test in the permissions package.
var PlatformDefaultProfileIDs = map[string]struct{}{
	ProfileSystemAdmin:  {},
	ProfileStandardUser: {},
}

// IsPlatformDefaultProfile reports whether the platform seeds (and therefore
// expects full business-object coverage for) default permissions on this
// profile. Used to source-limit seeding, coverage reconcile, and the coverage
// verify gate so they all agree on which profiles the platform owns.
func IsPlatformDefaultProfile(profileID string) bool {
	_, ok := PlatformDefaultProfileIDs[profileID]
	return ok
}

// User Defaults
const (
	DefaultNewUserProfileID = ProfileStandardUser
)
