Skip to content

@sourceloop/survey-service / Exports / CreateSurveyHelperService

Class: CreateSurveyHelperService

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new CreateSurveyHelperService(surveyRepository, surveyQuestionRepository, sectionRepository, surveyCycleRepository, surveyResponderRepository)

Parameters

Name Type
surveyRepository SurveyRepository
surveyQuestionRepository SurveyQuestionRepository
sectionRepository SectionRepository
surveyCycleRepository SurveyCycleRepository
surveyResponderRepository SurveyResponderRepository

Defined in

services/survey-service/src/services/create-survey-helper.service.ts:13

Properties

sectionRepository

sectionRepository: SectionRepository

Defined in

services/survey-service/src/services/create-survey-helper.service.ts:19


surveyCycleRepository

surveyCycleRepository: SurveyCycleRepository

Defined in

services/survey-service/src/services/create-survey-helper.service.ts:21


surveyQuestionRepository

surveyQuestionRepository: SurveyQuestionRepository

Defined in

services/survey-service/src/services/create-survey-helper.service.ts:17


surveyRepository

surveyRepository: SurveyRepository

Defined in

services/survey-service/src/services/create-survey-helper.service.ts:15


surveyResponderRepository

Protected surveyResponderRepository: SurveyResponderRepository

Defined in

services/survey-service/src/services/create-survey-helper.service.ts:23

Methods

addDependentOnQuestionId

addDependentOnQuestionId(surveyId, existingTemplateQuestions, questionIdMap?): Promise<void>

Parameters

Name Type
surveyId string
existingTemplateQuestions AnyObject[]
questionIdMap? Map<string, string>

Returns

Promise<void>

Defined in

services/survey-service/src/services/create-survey-helper.service.ts:42


copyFromBaseSurvey

copyFromBaseSurvey(survey): Promise<Omit<SurveyDto, "id">>

Parameters

Name Type
survey Omit<SurveyDto, "id">

Returns

Promise<Omit<SurveyDto, "id">>

Defined in

services/survey-service/src/services/create-survey-helper.service.ts:26


createSection

createSection(section): Promise<null | Section>

Parameters

Name Type
section Section

Returns

Promise<null | Section>

Defined in

services/survey-service/src/services/create-survey-helper.service.ts:130


duplicateRespondersAndWorkgroups

duplicateRespondersAndWorkgroups(baseSurveyId, surveyId): Promise<void>

Parameters

Name Type
baseSurveyId string
surveyId string

Returns

Promise<void>

Defined in

services/survey-service/src/services/create-survey-helper.service.ts:141


duplicateSections

duplicateSections(surveyId, baseSurveyId, sectionIdMap): Promise<void>

Parameters

Name Type
surveyId string
baseSurveyId string
sectionIdMap Map<string, string>

Returns

Promise<void>

Defined in

services/survey-service/src/services/create-survey-helper.service.ts:107


duplicateSurveyQuestionEntry

duplicateSurveyQuestionEntry(survey, createdSurvey, questionIdMap, sectionIdMap): Promise<void>

Parameters

Name Type
survey Omit<SurveyDto, "id">
createdSurvey null | Survey<DataObject<Model>>
questionIdMap Map<string, string>
sectionIdMap Map<string, string>

Returns

Promise<void>

Defined in

services/survey-service/src/services/create-survey-helper.service.ts:180