diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e1dee6..406952a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +- Add extras field to survey data [#39](https://github.com/rokwire/surveys-building-block/issues/39) ### Fixed - Fix "start_date" and "end_date" [#43](https://github.com/rokwire/surveys-building-block/issues/43) diff --git a/core/model/surveys.go b/core/model/surveys.go index a267eb7..16511ec 100644 --- a/core/model/surveys.go +++ b/core/model/surveys.go @@ -92,17 +92,18 @@ type SurveyStats struct { // SurveyData is data stored for a Survey type SurveyData struct { - Section *string `json:"section,omitempty" bson:"section,omitempty"` - Sections []string `json:"sections,omitempty" bson:"sections,omitempty"` - AllowSkip bool `json:"allow_skip" bson:"allow_skip"` - Text string `json:"text" bson:"text"` - MoreInfo string `json:"more_info" bson:"more_info"` - DefaultFollowUpKey *string `json:"default_follow_up_key" bson:"default_follow_up_key"` - DefaultResponseRule *string `json:"default_response_rule" bson:"default_response_rule"` - FollowUpRule *string `json:"follow_up_rule" bson:"follow_up_rule"` - ScoreRule *string `json:"score_rule" bson:"score_rule"` - Replace bool `json:"replace" bson:"replace"` - Response interface{} `json:"response" bson:"response"` + Section *string `json:"section,omitempty" bson:"section,omitempty"` + Sections []string `json:"sections,omitempty" bson:"sections,omitempty"` + AllowSkip bool `json:"allow_skip" bson:"allow_skip"` + Text string `json:"text" bson:"text"` + MoreInfo string `json:"more_info" bson:"more_info"` + DefaultFollowUpKey *string `json:"default_follow_up_key" bson:"default_follow_up_key"` + DefaultResponseRule *string `json:"default_response_rule" bson:"default_response_rule"` + FollowUpRule *string `json:"follow_up_rule" bson:"follow_up_rule"` + ScoreRule *string `json:"score_rule" bson:"score_rule"` + Replace bool `json:"replace" bson:"replace"` + Response interface{} `json:"response" bson:"response"` + Extras *map[string]interface{} `json:"extras" bson:"extras"` Type string `json:"type" bson:"type"` diff --git a/driver/web/docs/gen/def.yaml b/driver/web/docs/gen/def.yaml index fb824b2..51d0bb5 100644 --- a/driver/web/docs/gen/def.yaml +++ b/driver/web/docs/gen/def.yaml @@ -1498,6 +1498,9 @@ components: type: boolean response: type: object + extras: + type: object + nullable: true type: type: string correct_answer: diff --git a/driver/web/docs/schemas/surveys/SurveyData.yaml b/driver/web/docs/schemas/surveys/SurveyData.yaml index f904639..2e44a5f 100644 --- a/driver/web/docs/schemas/surveys/SurveyData.yaml +++ b/driver/web/docs/schemas/surveys/SurveyData.yaml @@ -20,6 +20,9 @@ properties: type: boolean response: type: object + extras: + type: object + nullable: true type: type: string correct_answer: