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: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssociateController

AssociateController Interface for associate business logic controller.

func NewController

func NewController(
	appCfg *config.Conf,
	loggerp *slog.Logger,
	uuidp uuid.Provider,
	jsidp jobseekerid.Provider,
	s3 s3_storage.S3Storager,
	passwordp password.Provider,
	kmux kmutex.Provider,
	temailer templatedemailer.TemplatedEmailer,
	client *mongo.Client,
	org_storer ten_s.TenantStorer,
	com_storer com_s.CommentStorer,
	act_storer act_s.ActivitySheetStorer,
	task_storer task_s.TaskItemStorer,
	hh_storer hh_s.HowHearAboutUsItemStorer,
	skillset_s ss_s.SkillSetStorer,
	vehicletype_s vt_s.VehicleTypeStorer,
	servicefee_s servicefee_s.ServiceFeeStorer,
	insurancerequirement_s ir_s.InsuranceRequirementStorer,
	usr_storer user_s.UserStorer,
	t_storer t_s.TagStorer,
	ord_s o_s.OrderStorer,
	attch_storer attachment_s.AttachmentStorer,
	a_ctorer a_c.AssociateStorer,
) AssociateController

type AssociateControllerImpl

type AssociateControllerImpl struct {
	Config                     *config.Conf
	Logger                     *slog.Logger
	UUID                       uuid.Provider
	S3                         s3_storage.S3Storager
	Password                   password.Provider
	Kmutex                     kmutex.Provider
	JobSeekerID                jobseekerid.Provider
	TemplatedEmailer           templatedemailer.TemplatedEmailer
	DbClient                   *mongo.Client
	TenantStorer               ten_s.TenantStorer
	CommentStorer              com_s.CommentStorer
	ActivitySheetStorer        act_s.ActivitySheetStorer
	TaskItemStorer             task_s.TaskItemStorer
	HowHearStorer              hh_s.HowHearAboutUsItemStorer
	SkillSetStorer             ss_s.SkillSetStorer
	VehicleTypeStorer          vt_s.VehicleTypeStorer
	TagStorer                  t_s.TagStorer
	ServiceFeeStorer           servicefee_s.ServiceFeeStorer
	InsuranceRequirementStorer ir_s.InsuranceRequirementStorer
	OrderStorer                o_s.OrderStorer
	AttachmentStorer           attachment_s.AttachmentStorer
	UserStorer                 user_s.UserStorer
	AssociateStorer            a_c.AssociateStorer
}

func (*AssociateControllerImpl) Archive

func (*AssociateControllerImpl) Avatar

func (*AssociateControllerImpl) ChangePassword

func (*AssociateControllerImpl) ChangeTwoFactorAuthentication

func (*AssociateControllerImpl) Create

func (*AssociateControllerImpl) CreateComment

func (*AssociateControllerImpl) DeleteByID

func (impl *AssociateControllerImpl) DeleteByID(ctx context.Context, id primitive.ObjectID) error

func (*AssociateControllerImpl) Downgrade

func (*AssociateControllerImpl) GetByID

func (*AssociateControllerImpl) ListAsSelectOptionByFilter

func (*AssociateControllerImpl) UpdateByID

func (*AssociateControllerImpl) UpdateRelatedByInsuranceRequirements

func (impl *AssociateControllerImpl) UpdateRelatedByInsuranceRequirements(sessCtx mongo.SessionContext, a *a_c.Associate, modifiedIRIDs []primitive.ObjectID) error

UpdateRelatedByInsuranceRequirements function will take the inputted `insurance requirements` with the associate.

func (*AssociateControllerImpl) UpdateRelatedByOrders

func (impl *AssociateControllerImpl) UpdateRelatedByOrders(sessCtx mongo.SessionContext, associate *a_s.Associate) error

UpdateRelatedByOrders function will take the inputted `order` with the associate.

func (*AssociateControllerImpl) UpdateRelatedBySkillSets

func (impl *AssociateControllerImpl) UpdateRelatedBySkillSets(sessCtx mongo.SessionContext, a *a_c.Associate, modifiedSSIDs []primitive.ObjectID) error

UpdateRelatedBySkillSets function will take the inputted `skill sets` with the associate.

func (*AssociateControllerImpl) UpdateRelatedByTags

func (impl *AssociateControllerImpl) UpdateRelatedByTags(sessCtx mongo.SessionContext, a *a_c.Associate, modifiedTIDs []primitive.ObjectID) error

UpdateRelatedByTags function will take the inputted `tags` with the associate.

func (*AssociateControllerImpl) UpdateRelatedByTaskItems

func (impl *AssociateControllerImpl) UpdateRelatedByTaskItems(sessCtx mongo.SessionContext, associate *a_s.Associate) error

UpdateRelatedByTaskItems function will take the inputted `order` with the associate.

func (*AssociateControllerImpl) UpdateRelatedByUser

func (impl *AssociateControllerImpl) UpdateRelatedByUser(sessCtx mongo.SessionContext, a *a_s.Associate) error

UpdateRelatedByUser function will update the user account.

func (*AssociateControllerImpl) UpdateRelatedByVehicleTypes

func (impl *AssociateControllerImpl) UpdateRelatedByVehicleTypes(sessCtx mongo.SessionContext, a *a_c.Associate, modifiedVTIDs []primitive.ObjectID) error

UpdateRelatedByVehicleTypes function will take the inputted `vehicle types` with the associate.

func (*AssociateControllerImpl) Upgrade

type AssociateCreateRequestIDO

type AssociateCreateRequestIDO struct {
	Type                                 int8                 `json:"type"`
	OrganizationName                     string               `json:"organization_name"`
	OrganizationType                     int8                 `json:"organization_type"`
	FirstName                            string               `json:"first_name"`
	LastName                             string               `json:"last_name"`
	Email                                string               `json:"email"`
	IsOkToEmail                          bool                 `json:"is_ok_to_email"`
	Phone                                string               `json:"phone,omitempty"`
	PhoneType                            int8                 `json:"phone_type"`
	PhoneExtension                       string               `json:"phone_extension"`
	IsOkToText                           bool                 `json:"is_ok_to_text"`
	OtherPhone                           string               `json:"other_phone"`
	OtherPhoneExtension                  string               `json:"other_phone_extension"`
	OtherPhoneType                       int8                 `json:"other_phone_type"`
	Country                              string               `json:"country,omitempty"`
	Region                               string               `json:"region,omitempty"`
	City                                 string               `json:"city,omitempty"`
	PostalCode                           string               `json:"postal_code,omitempty"`
	AddressLine1                         string               `json:"address_line1,omitempty"`
	AddressLine2                         string               `json:"address_line2,omitempty"`
	HasShippingAddress                   bool                 `json:"has_shipping_address,omitempty"`
	ShippingName                         string               `json:"shipping_name,omitempty"`
	ShippingPhone                        string               `json:"shipping_phone,omitempty"`
	ShippingCountry                      string               `json:"shipping_country,omitempty"`
	ShippingRegion                       string               `json:"shipping_region,omitempty"`
	ShippingCity                         string               `json:"shipping_city,omitempty"`
	ShippingPostalCode                   string               `json:"shipping_postal_code,omitempty"`
	ShippingAddressLine1                 string               `json:"shipping_address_line1,omitempty"`
	ShippingAddressLine2                 string               `json:"shipping_address_line2,omitempty"`
	SkillSets                            []primitive.ObjectID `bson:"skill_sets" json:"skill_sets,omitempty"`
	InsuranceRequirements                []primitive.ObjectID `bson:"insurance_requirements" json:"insurance_requirements,omitempty"`
	VehicleTypes                         []primitive.ObjectID `bson:"vehicle_types" json:"vehicle_types,omitempty"`
	AwayLogs                             []primitive.ObjectID `bson:"away_logs" json:"away_logs,omitempty"`
	Tags                                 []primitive.ObjectID `json:"tags,omitempty"`
	HowDidYouHearAboutUsID               primitive.ObjectID   `json:"how_did_you_hear_about_us_id,omitempty"`
	IsHowDidYouHearAboutUsOther          bool                 `json:"is_how_did_you_hear_about_us_other,omitempty"`
	HowDidYouHearAboutUsOther            string               `json:"how_did_you_hear_about_us_other,omitempty"`
	BirthDate                            string               `json:"birth_date"`
	BirthDateDT                          time.Time            `json:"-"`
	JoinDate                             string               `json:"join_date"`
	JoinDateDT                           time.Time            `json:"-"`
	Gender                               int8                 `bson:"gender" json:"gender"`
	GenderOther                          string               `bson:"gender_other" json:"gender_other"`
	AdditionalComment                    string               `json:"additional_comment"`
	Description                          string               `bson:"description" json:"description"`
	IsJobSeeker                          int8                 `bson:"is_job_seeker" json:"is_job_seeker"`
	StatusInCountry                      int8                 `bson:"status_in_country" json:"status_in_country"`
	StatusInCountryOther                 string               `bson:"status_in_country_other" json:"status_in_country_other"`
	CountryOfOrigin                      string               `bson:"country_of_origin" json:"country_of_origin"`
	DateOfEntryIntoCountry               string               `bson:"date_of_entry_into_country" json:"date_of_entry_into_country"`
	DateOfEntryIntoCountryDT             time.Time            `json:"-"`
	MaritalStatus                        int8                 `bson:"marital_status" json:"marital_status"`
	MaritalStatusOther                   string               `bson:"marital_status_other" json:"marital_status_other"`
	AccomplishedEducation                int8                 `bson:"accomplished_education" json:"accomplished_education"`
	AccomplishedEducationOther           string               `bson:"accomplished_education_other" json:"accomplished_education_other"`
	TaxID                                string               `bson:"tax_id" json:"tax_id"`
	HourlySalaryDesired                  int64                `bson:"hourly_salary_desired" json:"hourly_salary_desired"`
	LimitSpecial                         string               `bson:"limit_special" json:"limit_special"`
	DuesDate                             string               `bson:"dues_date" json:"dues_date"`
	DuesDateDT                           time.Time            `json:"-"`
	CommercialInsuranceExpiryDate        string               `bson:"commercial_insurance_expiry_date" json:"commercial_insurance_expiry_date"`
	CommercialInsuranceExpiryDateDT      time.Time            `json:"-"`
	AutoInsuranceExpiryDate              string               `bson:"auto_insurance_expiry_date" json:"auto_insurance_expiry_date"`
	AutoInsuranceExpiryDateDT            time.Time            `json:"-"`
	WsibNumber                           string               `bson:"wsib_number" json:"wsib_number"`
	WsibInsuranceDate                    string               `bson:"wsib_insurance_date" json:"wsib_insurance_date"`
	WsibInsuranceDateDT                  time.Time            `json:"-"`
	PoliceCheck                          string               `bson:"police_check" json:"police_check"`
	PoliceCheckDT                        time.Time            `json:"-"`
	DriversLicenseClass                  string               `bson:"drivers_license_class" json:"drivers_license_class"`
	ServiceFeeID                         primitive.ObjectID   `bson:"service_fee_id" json:"service_fee_id"`
	PreferredLanguage                    string               `bson:"preferred_language" json:"preferred_language"`
	EmergencyContactName                 string               `bson:"emergency_contact_name" json:"emergency_contact_name"`
	EmergencyContactRelationship         string               `bson:"emergency_contact_relationship" json:"emergency_contact_relationship"`
	EmergencyContactTelephone            string               `bson:"emergency_contact_telephone" json:"emergency_contact_telephone"`
	EmergencyContactAlternativeTelephone string               `bson:"emergency_contact_alternative_telephone" json:"emergency_contact_alternative_telephone"`
	IdentifyAs                           []int8               `bson:"identify_as" json:"identify_as,omitempty"`
	Password                             string               `bson:"password" json:"password"`
	PasswordRepeated                     string               `bson:"password_repeated" json:"password_repeated"`
}

type AssociateOperationArchiveRequestIDO

type AssociateOperationArchiveRequestIDO struct {
	AssociateID primitive.ObjectID `json:"associate_id"`
}

type AssociateOperationAvatarRequest

type AssociateOperationAvatarRequest struct {
	AssociateID primitive.ObjectID `bson:"associate_id" json:"associate_id"`
	FileName    string
	FileType    string
	File        multipart.File
}

type AssociateOperationChangePasswordRequest

type AssociateOperationChangePasswordRequest struct {
	AssociateID      primitive.ObjectID `bson:"associate_id" json:"associate_id"`
	Password         string             `bson:"password" json:"password"`
	PasswordRepeated string             `bson:"password_repeated" json:"password_repeated"`
}

type AssociateOperationChangeTwoFactorAuthenticationRequest

type AssociateOperationChangeTwoFactorAuthenticationRequest struct {
	AssociateID primitive.ObjectID `bson:"associate_id" json:"associate_id"`
	OTPEnabled  bool               `bson:"otp_enabled" json:"otp_enabled"`
}

type AssociateOperationCreateCommentRequest

type AssociateOperationCreateCommentRequest struct {
	AssociateID primitive.ObjectID `bson:"associate_id" json:"associate_id"`
	Content     string             `bson:"content" json:"content"`
}

type AssociateOperationDowngradeRequest

type AssociateOperationDowngradeRequest struct {
	AssociateID primitive.ObjectID `bson:"associate_id" json:"associate_id"`
}

type AssociateOperationUpgradeRequest

type AssociateOperationUpgradeRequest struct {
	AssociateID      primitive.ObjectID `bson:"associate_id" json:"associate_id"`
	OrganizationName string             `bson:"organization_name" json:"organization_name"`
	OrganizationType int8               `bson:"organization_type" json:"organization_type"`
}

type AssociateUpdateRequestIDO

type AssociateUpdateRequestIDO struct {
	ID                                   primitive.ObjectID   `json:"id,omitempty"`
	Type                                 int8                 `json:"type"`
	OrganizationName                     string               `json:"organization_name"`
	OrganizationType                     int8                 `json:"organization_type"`
	FirstName                            string               `json:"first_name"`
	LastName                             string               `json:"last_name"`
	Email                                string               `json:"email"`
	IsOkToEmail                          bool                 `json:"is_ok_to_email"`
	Phone                                string               `json:"phone,omitempty"`
	PhoneType                            int8                 `json:"phone_type"`
	PhoneExtension                       string               `json:"phone_extension"`
	IsOkToText                           bool                 `json:"is_ok_to_text"`
	OtherPhone                           string               `json:"other_phone"`
	OtherPhoneExtension                  string               `json:"other_phone_extension"`
	OtherPhoneType                       int8                 `json:"other_phone_type"`
	Country                              string               `json:"country,omitempty"`
	Region                               string               `json:"region,omitempty"`
	City                                 string               `json:"city,omitempty"`
	PostalCode                           string               `json:"postal_code,omitempty"`
	AddressLine1                         string               `json:"address_line1,omitempty"`
	AddressLine2                         string               `json:"address_line2,omitempty"`
	HasShippingAddress                   bool                 `json:"has_shipping_address,omitempty"`
	ShippingName                         string               `json:"shipping_name,omitempty"`
	ShippingPhone                        string               `json:"shipping_phone,omitempty"`
	ShippingCountry                      string               `json:"shipping_country,omitempty"`
	ShippingRegion                       string               `json:"shipping_region,omitempty"`
	ShippingCity                         string               `json:"shipping_city,omitempty"`
	ShippingPostalCode                   string               `json:"shipping_postal_code,omitempty"`
	ShippingAddressLine1                 string               `json:"shipping_address_line1,omitempty"`
	ShippingAddressLine2                 string               `json:"shipping_address_line2,omitempty"`
	SkillSets                            []primitive.ObjectID `bson:"skill_sets" json:"skill_sets,omitempty"`
	InsuranceRequirements                []primitive.ObjectID `bson:"insurance_requirements" json:"insurance_requirements,omitempty"`
	VehicleTypes                         []primitive.ObjectID `bson:"vehicle_types" json:"vehicle_types,omitempty"`
	AwayLogs                             []primitive.ObjectID `bson:"away_logs" json:"away_logs,omitempty"`
	Tags                                 []primitive.ObjectID `json:"tags,omitempty"`
	HowDidYouHearAboutUsID               primitive.ObjectID   `json:"how_did_you_hear_about_us_id,omitempty"`
	IsHowDidYouHearAboutUsOther          bool                 `json:"is_how_did_you_hear_about_us_other,omitempty"`
	HowDidYouHearAboutUsOther            string               `json:"how_did_you_hear_about_us_other,omitempty"`
	BirthDate                            string               `json:"birth_date"`
	BirthDateDT                          time.Time            `json:"-"`
	JoinDate                             string               `json:"join_date"`
	JoinDateDT                           time.Time            `json:"-"`
	Gender                               int8                 `bson:"gender" json:"gender"`
	GenderOther                          string               `bson:"gender_other" json:"gender_other"`
	AdditionalComment                    string               `json:"additional_comment"`
	Description                          string               `bson:"description" json:"description"`
	IsJobSeeker                          int8                 `bson:"is_job_seeker" json:"is_job_seeker"`
	StatusInCountry                      int8                 `bson:"status_in_country" json:"status_in_country"`
	StatusInCountryOther                 string               `bson:"status_in_country_other" json:"status_in_country_other"`
	CountryOfOrigin                      string               `bson:"country_of_origin" json:"country_of_origin"`
	DateOfEntryIntoCountry               string               `bson:"date_of_entry_into_country" json:"date_of_entry_into_country"`
	DateOfEntryIntoCountryDT             time.Time            `json:"-"`
	MaritalStatus                        int8                 `bson:"marital_status" json:"marital_status"`
	MaritalStatusOther                   string               `bson:"marital_status_other" json:"marital_status_other"`
	AccomplishedEducation                int8                 `bson:"accomplished_education" json:"accomplished_education"`
	AccomplishedEducationOther           string               `bson:"accomplished_education_other" json:"accomplished_education_other"`
	TaxID                                string               `bson:"tax_id" json:"tax_id"`
	HourlySalaryDesired                  int64                `bson:"hourly_salary_desired" json:"hourly_salary_desired"`
	LimitSpecial                         string               `bson:"limit_special" json:"limit_special"`
	DuesDate                             string               `bson:"dues_date" json:"dues_date"`
	DuesDateDT                           time.Time            `json:"-"`
	CommercialInsuranceExpiryDate        string               `bson:"commercial_insurance_expiry_date" json:"commercial_insurance_expiry_date"`
	CommercialInsuranceExpiryDateDT      time.Time            `json:"-"`
	AutoInsuranceExpiryDate              string               `bson:"auto_insurance_expiry_date" json:"auto_insurance_expiry_date"`
	AutoInsuranceExpiryDateDT            time.Time            `json:"-"`
	WsibNumber                           string               `bson:"wsib_number" json:"wsib_number"`
	WsibInsuranceDate                    string               `bson:"wsib_insurance_date" json:"wsib_insurance_date"`
	WsibInsuranceDateDT                  time.Time            `json:"-"`
	PoliceCheck                          string               `bson:"police_check" json:"police_check"`
	PoliceCheckDT                        time.Time            `json:"-"`
	DriversLicenseClass                  string               `bson:"drivers_license_class" json:"drivers_license_class"`
	ServiceFeeID                         primitive.ObjectID   `bson:"service_fee_id" json:"service_fee_id"`
	PreferredLanguage                    string               `bson:"preferred_language" json:"preferred_language"`
	EmergencyContactName                 string               `bson:"emergency_contact_name" json:"emergency_contact_name"`
	EmergencyContactRelationship         string               `bson:"emergency_contact_relationship" json:"emergency_contact_relationship"`
	EmergencyContactTelephone            string               `bson:"emergency_contact_telephone" json:"emergency_contact_telephone"`
	EmergencyContactAlternativeTelephone string               `bson:"emergency_contact_alternative_telephone" json:"emergency_contact_alternative_telephone"`
	IdentifyAs                           []int8               `bson:"identify_as" json:"identify_as,omitempty"`
}

Jump to

Keyboard shortcuts

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