@sourceloop/survey-service / Exports / SurveyResponseService
Class: SurveyResponseService¶
Table of contents¶
Constructors¶
Properties¶
- logger
- surveyCycleRepository
- surveyRepository
- surveyResponderRepository
- surveyResponseDetailRepository
- surveyResponseRepository
Methods¶
- createResponse
- getQuestionMapId
- handleAnswer
- handleResponseWithType
- handleSurveyResponseDetail
- validateAndGetResponder
- validateSurveyCycleAndGetCycleId
Constructors¶
constructor¶
• new SurveyResponseService(surveyResponseRepository
, surveyResponseDetailRepository
, surveyRepository
, surveyCycleRepository
, logger
, surveyResponderRepository
)
Parameters¶
Name | Type |
---|---|
surveyResponseRepository |
SurveyResponseRepository |
surveyResponseDetailRepository |
SurveyResponseDetailRepository |
surveyRepository |
SurveyRepository |
surveyCycleRepository |
SurveyCycleRepository |
logger |
ILogger |
surveyResponderRepository |
SurveyResponderRepository |
Defined in¶
services/survey-service/src/services/survey-response.service.ts:30
Properties¶
logger¶
• logger: ILogger
Defined in¶
services/survey-service/src/services/survey-response.service.ts:39
surveyCycleRepository¶
• Protected
surveyCycleRepository: SurveyCycleRepository
Defined in¶
services/survey-service/src/services/survey-response.service.ts:38
surveyRepository¶
• surveyRepository: SurveyRepository
Defined in¶
services/survey-service/src/services/survey-response.service.ts:36
surveyResponderRepository¶
• Protected
surveyResponderRepository: SurveyResponderRepository
Defined in¶
services/survey-service/src/services/survey-response.service.ts:41
surveyResponseDetailRepository¶
• surveyResponseDetailRepository: SurveyResponseDetailRepository
Defined in¶
services/survey-service/src/services/survey-response.service.ts:34
surveyResponseRepository¶
• surveyResponseRepository: SurveyResponseRepository
Defined in¶
services/survey-service/src/services/survey-response.service.ts:32
Methods¶
createResponse¶
▸ createResponse(token
, surveyId
, surveyResponseDto
): Promise
<SurveyResponse
& SurveyResponseRelations
>
Parameters¶
Name | Type |
---|---|
token |
string |
surveyId |
string |
surveyResponseDto |
SurveyResponseDto |
Returns¶
Promise
<SurveyResponse
& SurveyResponseRelations
>
Defined in¶
services/survey-service/src/services/survey-response.service.ts:44
getQuestionMapId¶
▸ getQuestionMapId(questions
): Object
Parameters¶
Name | Type |
---|---|
questions |
Question [] |
Returns¶
Object
Defined in¶
services/survey-service/src/services/survey-response.service.ts:264
handleAnswer¶
▸ handleAnswer(surveyResponseDetailDto
, surveyResponseId
, questionType
, textAnswer?
, optionId?
): SurveyResponseDetail
Parameters¶
Name | Type |
---|---|
surveyResponseDetailDto |
SurveyResponseDetailDto |
surveyResponseId |
string |
questionType |
QuestionType |
textAnswer? |
string |
optionId? |
string |
Returns¶
Defined in¶
services/survey-service/src/services/survey-response.service.ts:247
handleResponseWithType¶
▸ handleResponseWithType(surveyResponseDetailDto
, surveyResponseDetails
, question
, surveyResponseId
): void
Parameters¶
Name | Type |
---|---|
surveyResponseDetailDto |
SurveyResponseDetailDto |
surveyResponseDetails |
SurveyResponseDetail [] |
question |
Question |
surveyResponseId |
string |
Returns¶
void
Defined in¶
services/survey-service/src/services/survey-response.service.ts:192
handleSurveyResponseDetail¶
▸ handleSurveyResponseDetail(surveyResponseDetailsDto
, questions
, surveyResponseId
): SurveyResponseDetail
[]
Parameters¶
Name | Type |
---|---|
surveyResponseDetailsDto |
SurveyResponseDetailDto [] |
questions |
Object |
surveyResponseId |
string |
Returns¶
Defined in¶
services/survey-service/src/services/survey-response.service.ts:175
validateAndGetResponder¶
▸ validateAndGetResponder(responderId
, surveyId
, surveyCycleId
): Promise
<SurveyResponder
& SurveyResponderRelations
>
Parameters¶
Name | Type |
---|---|
responderId |
string |
surveyId |
string |
surveyCycleId |
string |
Returns¶
Promise
<SurveyResponder
& SurveyResponderRelations
>
Defined in¶
services/survey-service/src/services/survey-response.service.ts:290
validateSurveyCycleAndGetCycleId¶
▸ validateSurveyCycleAndGetCycleId(surveyCycles
): string
Parameters¶
Name | Type |
---|---|
surveyCycles |
SurveyCycle [] |
Returns¶
string
Defined in¶
services/survey-service/src/services/survey-response.service.ts:168