Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DriverInterface ¶
type DriverInterface interface {
Prefix() string
FetchAllUserGroups(ctx context.Context) ([]UserGroupMapping, error)
}
DriverInterface defines the contract for external data sources that can provide user-to-group mappings for import into the local database.
type Importer ¶
type Importer struct {
// contains filtered or unexported fields
}
Importer handles the bulk import of user-group mappings from an external driver into the local database.
func NewImporter ¶
func NewImporter(driver DriverInterface, storage StorageInterface, logger logging.LoggerInterface) *Importer
NewImporter creates a new Importer with the given driver, storage, and logger.
type SalesforceDriver ¶
type SalesforceDriver struct {
// contains filtered or unexported fields
}
SalesforceDriver implements DriverInterface by querying the Salesforce API for all team member records and extracting user-to-group mappings.
func NewSalesforceDriver ¶
func NewSalesforceDriver(client salesforce.SalesforceInterface) *SalesforceDriver
NewSalesforceDriver creates a new SalesforceDriver with the given Salesforce client.
func (*SalesforceDriver) FetchAllUserGroups ¶
func (d *SalesforceDriver) FetchAllUserGroups(ctx context.Context) ([]UserGroupMapping, error)
FetchAllUserGroups queries Salesforce for all team members and returns a flat list of user-to-group mappings. Each user may have up to two group mappings: one for their department and one for their team.
func (*SalesforceDriver) Prefix ¶
func (d *SalesforceDriver) Prefix() string
type StorageInterface ¶
type StorageInterface interface {
CreateGroup(ctx context.Context, group *types.Group) (*types.Group, error)
GetGroupByName(ctx context.Context, name, tenantID string) (*types.Group, error)
AddUsersToGroup(ctx context.Context, groupID string, userIDs []string) error
}
StorageInterface defines the storage operations required by the Importer.
type TeamMemberRecord ¶
type TeamMemberRecord struct {
Email string `mapstructure:"fHCM2__Email__c"`
Department string `mapstructure:"Department2__c"`
Team string `mapstructure:"fHCM2__Team__c"`
}
TeamMemberRecord represents a single Salesforce team member record.
type UserGroupMapping ¶
UserGroupMapping represents a mapping between a user identifier and a group name.