Skip to content

@sourceloop/survey-service / Exports / SurveyRepository

Class: SurveyRepository

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new SurveyRepository(dataSource, surveyCycleRepositoryGetter, surveyResponderRepositoryGetter, surveyQuestionRepositoryGetter, questionRepositoryGetter, sectionRepositoryGetter, getCurrentUser)

Parameters

Name Type
dataSource DataSource
surveyCycleRepositoryGetter Getter<SurveyCycleRepository>
surveyResponderRepositoryGetter Getter<SurveyResponderRepository>
surveyQuestionRepositoryGetter Getter<SurveyQuestionRepository>
questionRepositoryGetter Getter<QuestionRepository>
sectionRepositoryGetter Getter<SectionRepository>
getCurrentUser Getter<IAuthUserWithPermissions<string, string, string>>

Overrides

DefaultUserModifyCrudRepository< Survey, typeof Survey.prototype.id, SurveyRelations \>.constructor

Defined in

services/survey-service/src/repositories/survey.repository.ts:51

Properties

getCurrentUser

Readonly getCurrentUser: Getter<IAuthUserWithPermissions<string, string, string>>

Inherited from

DefaultUserModifyCrudRepository.getCurrentUser

Defined in

services/survey-service/src/repositories/survey.repository.ts:65


questionRepositoryGetter

Protected questionRepositoryGetter: Getter<QuestionRepository>

Defined in

services/survey-service/src/repositories/survey.repository.ts:61


questions

Readonly questions: HasManyThroughRepositoryFactory<Question, undefined | string, SurveyQuestion<DataObject<Model>>, undefined | string>

Defined in

services/survey-service/src/repositories/survey.repository.ts:44


sectionRepositoryGetter

Protected sectionRepositoryGetter: Getter<SectionRepository>

Defined in

services/survey-service/src/repositories/survey.repository.ts:63


sections

Readonly sections: HasManyRepositoryFactory<Section, undefined | string>

Defined in

services/survey-service/src/repositories/survey.repository.ts:40


surveyCycleRepositoryGetter

Protected surveyCycleRepositoryGetter: Getter<SurveyCycleRepository>

Defined in

services/survey-service/src/repositories/survey.repository.ts:54


surveyCycles

Readonly surveyCycles: HasManyRepositoryFactory<SurveyCycle, undefined | string>

Defined in

services/survey-service/src/repositories/survey.repository.ts:30


surveyQuestionRepositoryGetter

Protected surveyQuestionRepositoryGetter: Getter<SurveyQuestionRepository>

Defined in

services/survey-service/src/repositories/survey.repository.ts:59


surveyResponderRepositoryGetter

Protected surveyResponderRepositoryGetter: Getter<SurveyResponderRepository>

Defined in

services/survey-service/src/repositories/survey.repository.ts:56


surveyResponders

Readonly surveyResponders: HasManyRepositoryFactory<SurveyResponder, undefined | string>

Defined in

services/survey-service/src/repositories/survey.repository.ts:35

Methods

create

create(entity, options?): Promise<Survey<DataObject<Model>>>

Parameters

Name Type
entity DataObject<Survey<DataObject<Model>>>
options? Options

Returns

Promise<Survey<DataObject<Model>>>

Inherited from

DefaultUserModifyCrudRepository.create

Defined in

packages/core/dist/repositories/default-user-modify-crud.repository.base.d.ts:11


createAll

createAll(entities, options?): Promise<Survey<DataObject<Model>>[]>

Parameters

Name Type
entities DataObject<Survey<DataObject<Model>>>[]
options? Options

Returns

Promise<Survey<DataObject<Model>>[]>

Inherited from

DefaultUserModifyCrudRepository.createAll

Defined in

packages/core/dist/repositories/default-user-modify-crud.repository.base.d.ts:12


replaceById

replaceById(id, data, options?): Promise<void>

Parameters

Name Type
id undefined | string
data DataObject<Survey<DataObject<Model>>>
options? Options

Returns

Promise<void>

Inherited from

DefaultUserModifyCrudRepository.replaceById

Defined in

packages/core/dist/repositories/default-user-modify-crud.repository.base.d.ts:17


save

save(entity, options?): Promise<Survey<DataObject<Model>>>

Parameters

Name Type
entity Survey<DataObject<Model>>
options? Options

Returns

Promise<Survey<DataObject<Model>>>

Inherited from

DefaultUserModifyCrudRepository.save

Defined in

packages/core/dist/repositories/default-user-modify-crud.repository.base.d.ts:13


update

update(entity, options?): Promise<void>

Parameters

Name Type
entity Survey<DataObject<Model>>
options? Options

Returns

Promise<void>

Inherited from

DefaultUserModifyCrudRepository.update

Defined in

packages/core/dist/repositories/default-user-modify-crud.repository.base.d.ts:14


updateAll

updateAll(data, where?, options?): Promise<Count>

Parameters

Name Type
data DataObject<Survey<DataObject<Model>>>
where? Where<Survey<DataObject<Model>>>
options? Options

Returns

Promise<Count>

Inherited from

DefaultUserModifyCrudRepository.updateAll

Defined in

packages/core/dist/repositories/default-user-modify-crud.repository.base.d.ts:15


updateById

updateById(id, data, options?): Promise<void>

Parameters

Name Type
id undefined | string
data DataObject<Survey<DataObject<Model>>>
options? Options

Returns

Promise<void>

Inherited from

DefaultUserModifyCrudRepository.updateById

Defined in

packages/core/dist/repositories/default-user-modify-crud.repository.base.d.ts:16