serializers

package
v0.0.0-...-e75809f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2020 License: GPL-3.0 Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoryDetailSerializer

type CategoryDetailSerializer struct {
	ID          uint
	Title       string
	Description string
	Skills      map[uint]SkillDetailSerializer
}

CategoryDetailSerializer returns the list of questions for a skill of a category

type FeedbackDetailSerializer

type FeedbackDetailSerializer struct {
	ID             uint
	Title          string
	DurationStart  time.Time
	DurationEnd    time.Time
	SubmittedAt    *time.Time
	ExpireAt       *time.Time
	Status         models.FeedbackStatus
	FeedbackFormID uint
	Categories     map[uint]CategoryDetailSerializer
}

FeedbackDetailSerializer returns the details of a feedback

type FeedbackListSerializer

type FeedbackListSerializer struct {
	NewFeedbackCount       uint
	DraftFeedbackCount     uint
	SubmittedFeedbackCount uint
	Feedbacks              []models.Feedback
}

FeedbackListSerializer lists the feedbacks for a given user

type FeedbackResponseData

type FeedbackResponseData map[int64]map[int64]map[int64]QuestionResponseSerializer

FeedbackResponseData is the type of question response which is provided in the feedback form submit API It is a 3-level nested structure (category -> skill -> question), therefore we would have to 'dive' to the last level to apply any validations

type FeedbackResponseSerializer

type FeedbackResponseSerializer struct {
	Data        FeedbackResponseData   `json:"data" binding:"required,all_questions_present,dive,dive,dive"`
	Status      *models.FeedbackStatus `json:"status"`
	SubmittedAt string                 `json:"submittedAt" binding:"is_valid_submitted_at"`
	FeedbackID  string
}

FeedbackResponseSerializer returns the feedback response

type QuestionResponseDetailSerializer

type QuestionResponseDetailSerializer struct {
	ID         uint
	Text       string
	Type       models.QuestionType
	Options    interface{}
	Weight     int
	ResponseID uint
	Response   string
	Comment    string
}

QuestionResponseDetailSerializer returns the question response for a particular question

type QuestionResponseSerializer

type QuestionResponseSerializer struct {
	Response string `json:"response" binding:"is_valid_question_response"`
	Comment  string `json:"comment"`
}

QuestionResponseSerializer returns the question response

type SkillDetailSerializer

type SkillDetailSerializer struct {
	ID           uint
	Title        string
	DisplayTitle string
	Description  string
	Weight       int
	Questions    []QuestionResponseDetailSerializer
}

SkillDetailSerializer returns the skill details with a list of questions under that skill

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL