@sourceloop/survey-service / Exports / QuestionTemplateService
Class: QuestionTemplateService¶
Table of contents¶
Constructors¶
Properties¶
Methods¶
- _addLeadingZero
- addDependentOnQuestionId
- addTemplateQuestions
- checkDeleteValidation
- checkIfAllowedTemplateQuestionToUpdate
- checkIfAllowedToUpdate
- createTemplate
- deleteRelatedObjects
- generateQuestionnaireId
- separateIdsToAddAndRemove
- updateModifiedByAndOn
- updateTemplate
Constructors¶
constructor¶
• new QuestionTemplateService(questionTemplateRepository
, templateQuestionRepository
)
Parameters¶
Name | Type |
---|---|
questionTemplateRepository |
QuestionTemplateRepository |
templateQuestionRepository |
TemplateQuestionRepository |
Defined in¶
services/survey-service/src/services/question-template.service.ts:17
Properties¶
questionTemplateRepository¶
• questionTemplateRepository: QuestionTemplateRepository
Defined in¶
services/survey-service/src/services/question-template.service.ts:19
templateQuestionRepository¶
• templateQuestionRepository: TemplateQuestionRepository
Defined in¶
services/survey-service/src/services/question-template.service.ts:21
Methods¶
_addLeadingZero¶
▸ Private
_addLeadingZero(number
, size
): string
Parameters¶
Name | Type |
---|---|
number |
number |
size |
number |
Returns¶
string
Defined in¶
services/survey-service/src/services/question-template.service.ts:154
addDependentOnQuestionId¶
▸ addDependentOnQuestionId(templateId
, existingTemplateQuestions
): Promise
<void
>
Parameters¶
Name | Type |
---|---|
templateId |
string |
existingTemplateQuestions |
TemplateQuestion [] |
Returns¶
Promise
<void
>
Defined in¶
services/survey-service/src/services/question-template.service.ts:189
addTemplateQuestions¶
▸ addTemplateQuestions(existingTemplateId
, templateId
): Promise
<void
>
Parameters¶
Name | Type |
---|---|
existingTemplateId |
string |
templateId |
string |
Returns¶
Promise
<void
>
Defined in¶
services/survey-service/src/services/question-template.service.ts:168
checkDeleteValidation¶
▸ checkDeleteValidation(templateId
): Promise
<void
>
Parameters¶
Name | Type |
---|---|
templateId |
string |
Returns¶
Promise
<void
>
Defined in¶
services/survey-service/src/services/question-template.service.ts:100
checkIfAllowedTemplateQuestionToUpdate¶
▸ checkIfAllowedTemplateQuestionToUpdate(templateId
): Promise
<boolean
>
Parameters¶
Name | Type |
---|---|
templateId |
string |
Returns¶
Promise
<boolean
>
Defined in¶
services/survey-service/src/services/question-template.service.ts:274
checkIfAllowedToUpdate¶
▸ Private
checkIfAllowedToUpdate(existingQuestionnaire
): void
Parameters¶
Name | Type |
---|---|
existingQuestionnaire |
QuestionTemplate <DataObject <Model >> |
Returns¶
void
Defined in¶
services/survey-service/src/services/question-template.service.ts:267
createTemplate¶
▸ createTemplate(questionTemplate
): Promise
<QuestionTemplate
<DataObject
<Model
>>>
Parameters¶
Name | Type |
---|---|
questionTemplate |
Omit <QuestionTemplatesDto , "id" > |
Returns¶
Promise
<QuestionTemplate
<DataObject
<Model
>>>
Defined in¶
services/survey-service/src/services/question-template.service.ts:24
deleteRelatedObjects¶
▸ deleteRelatedObjects(templateId
): Promise
<void
>
Parameters¶
Name | Type |
---|---|
templateId |
string |
Returns¶
Promise
<void
>
Defined in¶
services/survey-service/src/services/question-template.service.ts:112
generateQuestionnaireId¶
▸ generateQuestionnaireId(): Promise
<string
>
Returns¶
Promise
<string
>
Defined in¶
services/survey-service/src/services/question-template.service.ts:132
separateIdsToAddAndRemove¶
▸ separateIdsToAddAndRemove(dataArray
, dataKey
, requestedIds
): Object
Parameters¶
Name | Type |
---|---|
dataArray |
AnyObject [] |
dataKey |
string |
requestedIds |
string [] |
Returns¶
Object
Name | Type |
---|---|
toAddIds |
string [] |
toDeleteIds |
any [] |
Defined in¶
services/survey-service/src/services/question-template.service.ts:86
updateModifiedByAndOn¶
▸ updateModifiedByAndOn(templateId
): Promise
<void
>
Parameters¶
Name | Type |
---|---|
templateId |
string |
Returns¶
Promise
<void
>
Defined in¶
services/survey-service/src/services/question-template.service.ts:80
updateTemplate¶
▸ updateTemplate(templateId
, questionTemplate
): Promise
<void
>
Parameters¶
Name | Type |
---|---|
templateId |
string |
questionTemplate |
QuestionTemplatesDto |
Returns¶
Promise
<void
>
Defined in¶
services/survey-service/src/services/question-template.service.ts:228