controller

package
v0.0.0-...-53e80a7 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TaskItemPaymentStatusPaid   = 1
	TaskItemPaymentStatusUnpaid = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignableAssociate

type AssignableAssociate struct {
	ID                  primitive.ObjectID       `bson:"_id" json:"id"`
	PublicID            uint64                   `bson:"public_id" json:"public_id"`
	Name                string                   `bson:"name" json:"name"`
	LexicalName         string                   `bson:"lexical_name" json:"lexical_name"`
	Email               string                   `bson:"email" json:"email"`
	Phone               string                   `bson:"phone" json:"phone,omitempty"`
	PhoneType           int8                     `bson:"phone_type" json:"phone_type"`
	PhoneExtension      string                   `bson:"phone_extension" json:"phone_extension"`
	OtherPhone          string                   `bson:"other_phone" json:"other_phone"`
	OtherPhoneExtension string                   `bson:"other_phone_extension" json:"other_phone_extension"`
	OtherPhoneType      int8                     `bson:"other_phone_type" json:"other_phone_type"`
	Status              int8                     `bson:"status" json:"status"`
	Type                int8                     `bson:"type" json:"type"`
	AvatarObjectKey     string                   `bson:"avatar_object_key" json:"avatar_object_key"`
	AvatarFileType      string                   `bson:"avatar_file_type" json:"avatar_file_type"`
	AvatarFileName      string                   `bson:"avatar_file_name" json:"avatar_file_name"`
	Birthdate           time.Time                `bson:"birthdate" json:"birthdate"`
	JoinDate            time.Time                `bson:"join_date" json:"join_date"`
	Nationality         string                   `bson:"nationality" json:"nationality"`
	Gender              int8                     `bson:"gender" json:"gender"`
	GenderOther         string                   `bson:"gender_other" json:"gender_other"`
	OrganizationName    string                   `bson:"organization_name" json:"organization_name"`
	OrganizationType    int8                     `bson:"organization_type" json:"organization_type"`
	ContactsLast30Days  int64                    `bson:"contacts_last_30_days" json:"contacts_last_30_days"`
	WsibNumber          string                   `bson:"wsib_number" json:"wsib_number"`
	HourlySalaryDesired int64                    `bson:"hourly_salary_desired" json:"hourly_salary_desired"`
	SkillSets           []*a_c.AssociateSkillSet `bson:"skill_sets" json:"skill_sets,omitempty"`
}

AssociateLite represents the limited detail of a associate which is to be displayed in a list view.

type ByContactsLast30Days

type ByContactsLast30Days []*AssignableAssociate

func (ByContactsLast30Days) Len

func (a ByContactsLast30Days) Len() int

func (ByContactsLast30Days) Less

func (a ByContactsLast30Days) Less(i, j int) bool

func (ByContactsLast30Days) Swap

func (a ByContactsLast30Days) Swap(i, j int)

type ListAssignableAssociatesByTaskIDResponse

type ListAssignableAssociatesByTaskIDResponse struct {
	Results []*AssignableAssociate
}

type TaskItemController

type TaskItemController interface {
	// Create(ctx context.Context, m *TaskItemCreateRequestIDO) (*ti_s.TaskItem, error)
	GetByID(ctx context.Context, id primitive.ObjectID) (*ti_s.TaskItem, error)
	// UpdateByID(ctx context.Context, req *TaskItemUpdateRequestIDO) (*ti_s.TaskItem, error)
	// ListByFilter(ctx context.Context, f *ti_s.TaskItemListFilter) (*ti_s.TaskItemListResult, error)
	ListAndCountByFilter(ctx context.Context, f *ti_s.TaskItemPaginationListFilter) (*ti_s.TaskItemPaginationListAndCountResult, error)
	CountByFilter(ctx context.Context, f *as_s.TaskItemPaginationListFilter) (*TaskItemCountResponseIDO, error)
	// ArchiveByID(ctx context.Context, id primitive.ObjectID) (*user_s.User, error)
	// DeleteByID(ctx context.Context, id primitive.ObjectID) error
	// CreateComment(ctx context.Context, req *TaskItemOperationCreateCommentRequest) (*ti_s.TaskItem, error)
	ListAssignableAssociatesByTaskID(ctx context.Context, id primitive.ObjectID) (*ListAssignableAssociatesByTaskIDResponse, error)
	AssignAssociateOperation(ctx context.Context, requestData *TaskItemOperationAssignAssociateRequestIDO) (*ti_s.TaskItem, error)
	OrderCompletionOperation(ctx context.Context, req *TaskItemOperationOrderCompletionRequestIDO) (*ti_s.TaskItem, error)
	PostponeOperation(ctx context.Context, req *TaskItemOperationPostponeRequestIDO) (*ti_s.TaskItem, error)
	CloseOperation(ctx context.Context, req *TaskItemOperationCloseRequestIDO) (*ti_s.TaskItem, error)
	SurveyOperation(ctx context.Context, req *TaskItemOperationSurveyRequestIDO) (*ti_s.TaskItem, error)
}

TaskItemController Interface for customer business logic controller.

func NewController

func NewController(
	appCfg *config.Conf,
	loggerp *slog.Logger,
	uuidp uuid.Provider,
	s3 s3_storage.S3Storager,
	passwordp password.Provider,
	kmux kmutex.Provider,
	temailer templatedemailer.TemplatedEmailer,
	client *mongo.Client,
	com_storer com_s.CommentStorer,
	hh_storer hh_s.HowHearAboutUsItemStorer,
	t_storer t_s.TagStorer,
	usr_storer user_s.UserStorer,
	act_storer act_s.ActivitySheetStorer,
	c_storer c_s.CustomerStorer,
	ti_storer ti_s.TaskItemStorer,
	a_ctorer a_c.AssociateStorer,
	o_storer o_s.OrderStorer,
	servicefee_s servicefee_s.ServiceFeeStorer,
) TaskItemController

type TaskItemControllerImpl

type TaskItemControllerImpl struct {
	Config              *config.Conf
	Logger              *slog.Logger
	UUID                uuid.Provider
	S3                  s3_storage.S3Storager
	Password            password.Provider
	Kmutex              kmutex.Provider
	DbClient            *mongo.Client
	TemplatedEmailer    templatedemailer.TemplatedEmailer
	CommentStorer       com_s.CommentStorer
	HowHearStorer       hh_s.HowHearAboutUsItemStorer
	TagStorer           t_s.TagStorer
	UserStorer          user_s.UserStorer
	ActivitySheetStorer act_s.ActivitySheetStorer
	CustomerStorer      c_s.CustomerStorer
	TaskItemStorer      ti_s.TaskItemStorer
	AssociateStorer     a_c.AssociateStorer
	OrderStorer         o_s.OrderStorer
	ServiceFeeStorer    servicefee_s.ServiceFeeStorer
}

func (*TaskItemControllerImpl) AssignAssociateOperation

func (*TaskItemControllerImpl) CloseOperation

func (*TaskItemControllerImpl) CountByFilter

func (*TaskItemControllerImpl) GetByID

func (*TaskItemControllerImpl) ListAssignableAssociatesByTaskID

func (impl *TaskItemControllerImpl) ListAssignableAssociatesByTaskID(ctx context.Context, id primitive.ObjectID) (*ListAssignableAssociatesByTaskIDResponse, error)

func (*TaskItemControllerImpl) OrderCompletionOperation

func (*TaskItemControllerImpl) PostponeOperation

func (*TaskItemControllerImpl) SurveyOperation

type TaskItemCountResponseIDO

type TaskItemCountResponseIDO struct {
	Count int64 `bson:"count" json:"count"`
}

type TaskItemOperationAssignAssociateRequestIDO

type TaskItemOperationAssignAssociateRequestIDO struct {
	TaskItemID        primitive.ObjectID `bson:"task_item_id" json:"task_item_id"`
	AssociateID       primitive.ObjectID `bson:"associate_id" json:"associate_id"`
	Status            int8               `bson:"status" json:"status"`
	HowWasJobAccepted int8               `bson:"how_was_job_accepted" json:"how_was_job_accepted"`
	WhyJobDeclined    int8               `bson:"why_job_declined" json:"why_job_declined"`
	PredefinedComment string             `bson:"predefined_comment" json:"predefined_comment"`
	Comment           string             `bson:"comment" json:"comment"` // Note: This is optional.
}

type TaskItemOperationCloseRequestIDO

type TaskItemOperationCloseRequestIDO struct {
	TaskItemID              primitive.ObjectID `bson:"task_item_id" json:"task_item_id"`
	WasCompleted            int8               `bson:"was_completed" json:"was_completed"`
	Reason                  int8               `bson:"reason" json:"reason"`
	ReasonOther             string             `bson:"reason_other" json:"reason_other"`
	CompletionDate          string             `bson:"completion_date" json:"completion_date"`
	CompletionDateFormatted time.Time          `bson:"-" json:"-"`
	DescribeTheComment      string             `bson:"describe_the_comment" json:"describe_the_comment"`
}

type TaskItemOperationOrderCompletionRequestIDO

type TaskItemOperationOrderCompletionRequestIDO struct {
	// Step 1 of 5.
	TaskItemID primitive.ObjectID `bson:"task_item_id" json:"task_item_id"`

	// Step 2 of 5.
	WasCompleted            int8      `bson:"was_completed" json:"was_completed"`
	Reason                  int8      `bson:"reason" json:"reason"`
	ReasonOther             string    `bson:"reason_other" json:"reason_other"`
	ReasonComment           string    `bson:"reason_comment" json:"reason_comment"`
	Visits                  int8      `bson:"visits" json:"visits"`
	CompletionDate          string    `bson:"completion_date" json:"completion_date"`
	CompletionDateFormatted time.Time `bson:"-" json:"-"`
	ClosingReasonComment    string    `bson:"closing_reason_comment" json:"closing_reason_comment"`

	// Step 3 of 5.
	HasInputtedFinancials         int8               `bson:"has_inputted_financials" json:"has_inputted_financials"`
	InvoicePaidTo                 int8               `bson:"invoice_paid_to" json:"invoice_paid_to"`
	PaymentStatus                 int8               `bson:"payment_status" json:"payment_status"`
	InvoiceDate                   string             `bson:"invoice_date" json:"invoice_date"`
	InvoiceDateFormatted          time.Time          `bson:"-" json:"-"`
	InvoiceIDs                    string             `bson:"invoice_ids" json:"invoice_ids"`
	InvoiceQuotedLabourAmount     float64            `bson:"invoice_quoted_labour_amount" json:"invoice_quoted_labour_amount"`
	InvoiceQuotedMaterialAmount   float64            `bson:"invoice_quoted_material_amount" json:"invoice_quoted_material_amount"`
	InvoiceQuotedOtherCostsAmount float64            `bson:"invoice_quoted_other_costs_amount" json:"invoice_quoted_other_costs_amount"`
	InvoiceTotalQuoteAmount       float64            `bson:"invoice_total_quote_amount" json:"invoice_total_quote_amount"`
	InvoiceLabourAmount           float64            `bson:"invoice_labour_amount" json:"invoice_labour_amount"`
	InvoiceMaterialAmount         float64            `bson:"invoice_material_amount" json:"invoice_material_amount"`
	InvoiceOtherCostsAmount       float64            `bson:"invoice_other_costs_amount" json:"invoice_other_costs_amount"`
	InvoiceTaxAmount              float64            `bson:"invoice_tax_amount" json:"invoice_tax_amount"`
	InvoiceIsCustomTaxAmount      bool               `bson:"invoice_is_custom_tax_amount" json:"invoice_is_custom_tax_amount"`
	InvoiceTotalAmount            float64            `bson:"invoice_total_amount" json:"invoice_total_amount"`
	InvoiceDepositAmount          float64            `bson:"invoice_deposit_amount" json:"invoice_deposit_amount"`
	InvoiceAmountDue              float64            `bson:"invoice_amount_due" json:"invoice_amount_due"`
	InvoiceServiceFeeID           primitive.ObjectID `bson:"invoice_service_fee_id" json:"invoice_service_fee_id"`
	// InvoiceServiceFeePercentage   float64            `bson:"invoice_service_fee_percentage" json:"invoice_service_fee_percentage"`
	// InvoiceServiceFeeOther        string             `bson:"invoice_service_fee_other" json:"invoice_service_fee_other"`
	// IsInvoiceServiceFeeOther              bool               `bson:"is_invoice_service_fee_other" json:"is_invoice_service_fee_other"`
	InvoiceServiceFeeAmount               float64   `bson:"invoice_service_fee_amount" json:"invoice_service_fee_amount"`
	InvoiceServiceFeePaymentDate          string    `bson:"invoice_service_fee_payment_date" json:"invoice_service_fee_payment_date"`
	InvoiceServiceFeePaymentDateFormatted time.Time `bson:"-" json:"-"`
	PaymentMethods                        []int8    `bson:"payment_methods" json:"payment_methods,omitempty"`
	InvoiceActualServiceFeeAmountPaid     float64   `bson:"invoice_actual_service_fee_amount_paid" json:"invoice_actual_service_fee_amount_paid"`
	InvoiceBalanceOwingAmount             float64   `bson:"invoice_balance_owing_amount" json:"invoice_balance_owing_amount"`

	// Step 4 of 5.
	Comment string `bson:"comment" json:"comment"`
}

type TaskItemOperationPostponeRequestIDO

type TaskItemOperationPostponeRequestIDO struct {
	TaskItemID         primitive.ObjectID `bson:"task_item_id" json:"task_item_id"`
	Reason             int8               `bson:"reason" json:"reason"`
	ReasonOther        string             `bson:"reason_other" json:"reason_other"`
	StartDate          string             `bson:"start_date" json:"start_date"`
	StartDateFormatted time.Time          `bson:"-" json:"-"`
	DescribeTheComment string             `bson:"describe_the_comment" json:"describe_the_comment"`
}

type TaskItemOperationSurveyRequestIDO

type TaskItemOperationSurveyRequestIDO struct {
	TaskItemID                        primitive.ObjectID `bson:"task_item_id" json:"task_item_id"`
	WasSurveyConducted                int8               `bson:"was_survey_conducted" json:"was_survey_conducted"`
	NoSurveyConductedReason           int8               `bson:"no_survey_conducted_reason" json:"no_survey_conducted_reason"`
	NoSurveyConductedReasonOther      string             `bson:"no_survey_conducted_reason_other" json:"no_survey_conducted_reason_other"`
	Comment                           string             `bson:"comment" json:"comment"`
	WasJobSatisfactory                int8               `bson:"was_job_satisfactory" json:"was_job_satisfactory"`
	WasJobFinishedOnTimeAndOnBudget   int8               `bson:"was_job_finished_on_time_and_on_budget" json:"was_job_finished_on_time_and_on_budget"`
	WasAssociatePunctual              int8               `bson:"was_associate_punctual" json:"was_associate_punctual"`
	WasAssociateProfessional          int8               `bson:"was_associate_professional" json:"was_associate_professional"`
	WouldCustomerReferOurOrganization int8               `bson:"would_customer_refer_our_organization" json:"would_customer_refer_our_organization"`
}

Jump to

Keyboard shortcuts

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