Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Version is version of CclaWhitelistRequest Version = "v1" // StatusPending is status of CclaWhitelistRequest StatusPending = "pending" // ProjectIDIndex is the index for for the project_id secondary index ProjectIDIndex = "ccla-approval-list-request-project-id-index" )
View Source
const (
DontLoadRepoDetails = true
)
constants
Variables ¶
View Source
var (
ErrCclaApprovalRequestAlreadyExists = errors.New("approval request already exist")
)
errors
Functions ¶
func Configure ¶
func Configure(api *operations.ClaAPI, service IService, sessionStore *dynastore.Store, signatureService signatures.SignatureService, eventsService events.Service)
Configure setups handlers on api with service
Types ¶
type ApprovalItem ¶
type ApprovalItem struct { ApprovalID string `dynamodbav:"approval_id"` SignatureID string `dynamodbav:"signature_id"` DateAdded string `dynamodbav:"date_added"` DateCreated string `dynamodbav:"date_created"` DateModified string `dynamodbav:"date_modified"` ApprovalName string `dynamodbav:"approval_name"` ApprovalCriteria string `dynamodbav:"approval_criteria"` }
type CLARequestModel ¶
type CLARequestModel struct { RequestID string `dynamodbav:"request_id"` RequestStatus string `dynamodbav:"request_status"` CompanyID string `dynamodbav:"company_id"` CompanyExternalID string `dynamodbav:"company_external_id"` CompanyName string `dynamodbav:"company_name"` ProjectID string `dynamodbav:"project_id"` ProjectName string `dynamodbav:"project_name"` ProjectExternalID string `dynamodbav:"project_external_id"` UserID string `dynamodbav:"user_id"` UserEmails []string `dynamodbav:"user_emails"` UserName string `dynamodbav:"user_name"` UserGithubID string `dynamodbav:"user_github_id"` UserGithubUsername string `dynamodbav:"user_github_username"` DateCreated string `dynamodbav:"date_created"` DateModified string `dynamodbav:"date_modified"` Version string `dynamodbav:"version"` }
CLARequestModel data model
type CclaWhitelistRequest ¶
type CclaWhitelistRequest struct { RequestID string `dynamodbav:"request_id"` RequestStatus string `dynamodbav:"request_status"` CompanyID string `dynamodbav:"company_id"` CompanyName string `dynamodbav:"company_name"` ProjectID string `dynamodbav:"project_id"` ProjectName string `dynamodbav:"project_name"` UserID string `dynamodbav:"user_id"` UserEmails []string `dynamodbav:"user_emails"` UserName string `dynamodbav:"user_name"` UserGithubID string `dynamodbav:"user_github_id"` UserGithubUsername string `dynamodbav:"user_github_username"` DateCreated string `dynamodbav:"date_created"` DateModified string `dynamodbav:"date_modified"` Version string `dynamodbav:"version"` }
CclaWhitelistRequest data model
type IRepository ¶
type IRepository interface { AddCclaApprovalRequest(company *models.Company, project *models.ClaGroup, user *models.User, requesterName, requesterEmail string) (string, error) GetCclaApprovalListRequest(requestID string) (*CLARequestModel, error) ApproveCclaApprovalListRequest(requestID string) error RejectCclaApprovalListRequest(requestID string) error ListCclaApprovalListRequests(companyID string, projectID, status, userID *string) (*models.CclaWhitelistRequestList, error) GetRequestsByCLAGroup(claGroupID string) ([]CLARequestModel, error) UpdateRequestsByCLAGroup(model *models2.DBProjectModel) error }
IRepository interface defines the functions for the approval list service
func NewRepository ¶
func NewRepository(awsSession *session.Session, stage string) IRepository
NewRepository creates a new instance of the approval list service
type IService ¶
type IService interface { AddCclaApprovalListRequest(ctx context.Context, companyID string, claGroupID string, args models.CclaWhitelistRequestInput) (string, error) ApproveCclaApprovalListRequest(ctx context.Context, claUser *user.CLAUser, ClacompanyID, claGroupID, requestID string) error RejectCclaApprovalListRequest(ctx context.Context, companyID, claGroupID, requestID string) error ListCclaApprovalListRequest(companyID string, claGroupID, status *string) (*models.CclaWhitelistRequestList, error) ListCclaApprovalListRequestByCompanyProjectUser(companyID string, claGroupID, status, userID *string) (*models.CclaWhitelistRequestList, error) }
IService interface defines the service methods/functions
func NewService ¶
func NewService(repo IRepository, projectsCLAGroupRepository projects_cla_groups.Repository, projService service2.Service, userRepo users.UserRepository, companyRepo company.IRepository, projectRepo repository2.ProjectRepository, signatureRepo signatures.SignatureRepository, emailTemplateService emails.EmailTemplateService, corpConsoleURL string, httpClient *http.Client) IService
NewService creates a new approval list service
Click to show internal directories.
Click to hide internal directories.