draftservice

package
v0.0.0-...-424a8ae Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2020 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRepository

func NewRepository() m.DraftRepository

NewRepository returns a new instance of a MongoDB draft repository.

Types

type CreateRequest

type CreateRequest struct {
	TemplateID bson.ObjectId `json:"templateId"`
}

type Service

type Service interface {
	GetDraft(ctx *app.ReqCtx, draftID bson.ObjectId) (*m.Draft, error)

	Create(ctx *app.ReqCtx, userID uint64, templateID bson.ObjectId) (*m.Draft, error)

	UpdateSettings(ctx *app.ReqCtx, draft *m.Draft, req *UpdateSettingsRequest) (*m.Draft, error)
	UpdateVariables(ctx *app.ReqCtx, draft *m.Draft, variables []string) (*m.Draft, error)

	UpdateVerification(ctx *app.ReqCtx, draft *m.Draft, req *UpdateVerificationRequest) (*m.Draft, error)

	Update(ctx *app.ReqCtx, draft *m.Draft, req *UpdateRequest) (*m.Draft, error)

	Delete(ctx *app.ReqCtx, draft *m.Draft) error
	DeleteTaskData(ctx *app.ReqCtx, draft *m.Draft) (*m.Draft, error)

	Copy(ctx *app.ReqCtx, draft *m.Draft) (*m.Draft, error)
}

Service interface.

func NewService

func NewService(drafts m.DraftRepository, data m.DataRepository, templates m.TemplateRepository) Service

NewService returns a new instance of a drafts service

type UpdateRequest

type UpdateRequest struct {
	Whitelist        []*m.DraftWhitelist  `json:"whitelist,omitempty"`
	TaskForm         *m.Form              `json:"taskForm,omitempty"`
	VerificationForm *m.Form              `json:"verificationForm,omitempty"`
	Onboarding       *m.DraftOnboarding   `json:"onboarding,omitempty"`
	Eligibility      *m.DraftEligibility  `json:"eligibility,omitempty"`
	Assignment       *m.DraftAssignment   `json:"assignment,omitempty"`
	Verification     *m.DraftVerification `json:"verification,omitempty"`
	Funding          *m.DraftFunding      `json:"funding,omitempty"`
}

type UpdateSettingsRequest

type UpdateSettingsRequest struct {
	Name        string  `json:"name,omitempty"`
	Description string  `json:"description,omitempty"`
	LogoURL     string  `json:"logoUrl,omitempty"`
	Staking     bool    `json:"staking,omitempty"`
	Stake       float64 `json:"stake,omitempty"`
	Deduct      bool    `json:"deduct,omitempty"`
	CallbackURL string  `json:"callbackUrl,omitempty"`
}

type UpdateVariablesRequest

type UpdateVariablesRequest struct {
	Variables []string `json:"variables"`
}

type UpdateVerificationRequest

type UpdateVerificationRequest struct {
	VerificationModule   m.VerificationModuleID `json:"verificationModule"`
	AgreementCount       int64                  `json:"agreementCount,omitempty"`
	MinimumExecutionTime uint64                 `json:"minimumExecutionTime,omitempty"`
}

Jump to

Keyboard shortcuts

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