cla_manager

package
v0.0.0-...-0c3f707 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//BadRequest error Response code
	BadRequest = "400"
	//Conflict error Response code
	Conflict = "409"
	// NotFound error Response code
	NotFound = "404"
	//Accepted Response code
	Accepted = "202"
)

Variables

View Source
var (
	//ErrCLACompanyNotFound returned if EasyCLA company not found
	ErrCLACompanyNotFound = errors.New("company not found")
	//ErrCLAUserNotFound returned if EasyCLA User is not found
	ErrCLAUserNotFound = errors.New("cla user not found")
	//ErrLFXUserNotFound when user-service fails to find user
	ErrLFXUserNotFound = errors.New("lfx user not found")
	//ErrNoLFID thrown when users dont have an LFID
	ErrNoLFID = errors.New("user has no LF Login")
	//ErrNoOrgAdmins when No admins found for organization
	ErrNoOrgAdmins = errors.New("no admins in company")
	//ErrRoleScopeConflict thrown if user already has role scope
	ErrRoleScopeConflict = errors.New("user is already cla-manager")
	//ErrCLAManagerDesigneeConflict when user is already assigned cla-manager-designee role
	ErrCLAManagerDesigneeConflict = errors.New("user already assigned cla-manager")
	//ErrProjectSigned returns error if project already signed
	ErrProjectSigned = errors.New("project already signed")
	//ErrClaGroupNotFound returns error if cla group not found
	ErrClaGroupNotFound = errors.New("cla group not found")
	//ErrClaGroupBadRequest returns error if cla group bad request
	ErrClaGroupBadRequest = errors.New("cla group bad request")
)

Functions

func Configure

func Configure(api *operations.EasyclaAPI, service Service, v1CompanyService v1Company.IService, LfxPortalURL, CorporateConsoleV2URL string, projectClaGroupRepo projects_cla_groups.Repository, easyCLAUserRepo v1User.RepositoryService)

Configure is the API handler routine for CLA Manager routes

func GetNonNoReplyUserEmail

func GetNonNoReplyUserEmail(userEmails []string) string

GetNonNoReplyUserEmail tries to fetch an email which doesn't have noreply string in it but if it's the only one we have it'll still be returned

Types

type ContributorEmailToOrgAdminModel

type ContributorEmailToOrgAdminModel struct {
	// contains filtered or unexported fields
}

ContributorEmailToOrgAdminModel data model for sending emails

type DesigneeEmailToUserWithNoLFIDModel

type DesigneeEmailToUserWithNoLFIDModel struct {
	// contains filtered or unexported fields
}

DesigneeEmailToUserWithNoLFIDModel data model for sending emails

type EmailToCLAManagerModel

type EmailToCLAManagerModel struct {
	Contributor         *v1Models.User
	CLAManagerName      string
	CLAManagerEmail     string
	CompanyName         string
	CLAGroupName        string
	CorporateConsoleURL string
}

EmailToCLAManagerModel data model for sending emails to CLA Managers

type EmailToOrgAdminModel

type EmailToOrgAdminModel struct {
	// contains filtered or unexported fields
}

EmailToOrgAdminModel data model for sending emails

type EmailToUserWithNoLFIDModel

type EmailToUserWithNoLFIDModel struct {
	// contains filtered or unexported fields
}

EmailToUserWithNoLFIDModel data model for sending emails

type Service

type Service interface {
	CreateCLAManager(ctx context.Context, authUser *auth.User, claGroupID string, params cla_manager.CreateCLAManagerParams, authUsername string) (*models.CompanyClaManager, *models.ErrorResponse)
	DeleteCLAManager(ctx context.Context, authUser *auth.User, claGroupID string, params cla_manager.DeleteCLAManagerParams) *models.ErrorResponse
	InviteCompanyAdmin(ctx context.Context, contactAdmin bool, companyID string, projectID string, userEmail string, name string, contributor *v1User.User) ([]*models.ClaManagerDesignee, error)
	CreateCLAManagerDesignee(ctx context.Context, companyID string, projectID string, userEmail string) (*models.ClaManagerDesignee, error)
	CreateCLAManagerRequest(ctx context.Context, contactAdmin bool, companyID string, projectID string, userEmail string, fullName string, authUser *auth.User) (*models.ClaManagerDesignee, error)
	NotifyCLAManagers(ctx context.Context, notifyCLAManagers *models.NotifyClaManagerList, CorporateConsoleV2URL string) error
	CreateCLAManagerDesigneeByGroup(ctx context.Context, params cla_manager.CreateCLAManagerDesigneeByGroupParams, projectCLAGroups []*projects_cla_groups.ProjectClaGroup) ([]*models.ClaManagerDesignee, string, error)
	ProjectCompanySignedOrNot(ctx context.Context, signedAtFoundation bool, projectCLAGroups []*projects_cla_groups.ProjectClaGroup, companyModel *v1Models.Company) error
	IsCLAManagerDesignee(ctx context.Context, companySFID, claGroupID, userLFID string) (*models.UserRoleStatus, error)

	// Email Functions
	SendEmailToCLAManager(ctx context.Context, input *EmailToCLAManagerModel, projectSFIDs []string)
	SendEmailToOrgAdmin(ctx context.Context, input EmailToOrgAdminModel)
	ContributorEmailToOrgAdmin(ctx context.Context, input ContributorEmailToOrgAdminModel)
	SendEmailToCLAManagerDesigneeCorporate(ctx context.Context, input ToCLAManagerDesigneeCorporateModel)
	SendEmailToCLAManagerDesignee(ctx context.Context, input ToCLAManagerDesigneeModel)
	SendDesigneeEmailToUserWithNoLFID(ctx context.Context, input DesigneeEmailToUserWithNoLFIDModel) error
	SendEmailToUserWithNoLFID(ctx context.Context, input EmailToUserWithNoLFIDModel) error
}

Service interface

func NewService

func NewService(emailTemplateService emails.EmailTemplateService, compService company.IService, projService service2.Service, mgrService v1ClaManager.IService, claUserService easyCLAUser.Service,
	repoService repositories.Service, v2CompService v2Company.Service,
	evService events.Service, projectCGroupRepo projects_cla_groups.Repository) Service

NewService returns instance of CLA Manager service

type ToCLAManagerDesigneeCorporateModel

type ToCLAManagerDesigneeCorporateModel struct {
	// contains filtered or unexported fields
}

ToCLAManagerDesigneeCorporateModel data model for sending emails

type ToCLAManagerDesigneeModel

type ToCLAManagerDesigneeModel struct {
	// contains filtered or unexported fields
}

ToCLAManagerDesigneeModel data model for sending emails

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL