controller

package
v0.0.0-...-ee53a0f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StaffController

type StaffController interface {
	Create(ctx context.Context, m *StaffCreateRequestIDO) (*s_s.Staff, error)
	GetByID(ctx context.Context, id primitive.ObjectID) (*s_s.Staff, error)
	UpdateByID(ctx context.Context, req *StaffUpdateRequestIDO) (*s_s.Staff, error)
	LiteListAndCountByFilter(ctx context.Context, f *s_s.StaffPaginationListFilter) (*s_s.StaffPaginationLiteListAndCountResult, error)
	// ListAsSelectOptionByFilter(ctx context.Context, f *s_s.StaffListFilter) ([]*s_s.StaffAsSelectOption, error)
	DeleteByID(ctx context.Context, id primitive.ObjectID) error
	CreateComment(ctx context.Context, req *StaffOperationCreateCommentRequest) (*s_s.Staff, error)
	Archive(ctx context.Context, req *StaffOperationArchiveRequestIDO) (*s_s.Staff, error)
	Downgrade(ctx context.Context, req *StaffOperationDowngradeRequest) (*s_s.Staff, error)
	Upgrade(ctx context.Context, req *StaffOperationUpgradeRequest) (*s_s.Staff, error)
	Avatar(ctx context.Context, req *StaffOperationAvatarRequest) (*s_s.Staff, error)
	ChangePassword(ctx context.Context, req *StaffOperationChangePasswordRequest) error
	ChangeTwoFactorAuthentication(ctx context.Context, req *StaffOperationChangeTwoFactorAuthenticationRequest) error
}

StaffController Interface for staff 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,
	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,
	s_storer s_s.StaffStorer,
) StaffController

type StaffControllerImpl

type StaffControllerImpl struct {
	Config                     *config.Conf
	Logger                     *slog.Logger
	UUID                       uuid.Provider
	S3                         s3_storage.S3Storager
	Password                   password.Provider
	Kmutex                     kmutex.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
	StaffStorer                s_s.StaffStorer
}

func (*StaffControllerImpl) Archive

func (*StaffControllerImpl) Avatar

func (*StaffControllerImpl) ChangePassword

func (*StaffControllerImpl) ChangeTwoFactorAuthentication

func (impl *StaffControllerImpl) ChangeTwoFactorAuthentication(ctx context.Context, req *StaffOperationChangeTwoFactorAuthenticationRequest) error

func (*StaffControllerImpl) Create

func (*StaffControllerImpl) CreateComment

func (*StaffControllerImpl) DeleteByID

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

func (*StaffControllerImpl) Downgrade

func (*StaffControllerImpl) GetByID

func (impl *StaffControllerImpl) GetByID(ctx context.Context, id primitive.ObjectID) (*a_c.Staff, error)

func (*StaffControllerImpl) UpdateByID

func (impl *StaffControllerImpl) UpdateByID(ctx context.Context, req *StaffUpdateRequestIDO) (*c_s.Staff, error)

func (*StaffControllerImpl) Upgrade

type StaffCreateRequestIDO

type StaffCreateRequestIDO struct {
	Type                                 int8                 `json:"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"`
	VehicleTypes                         []primitive.ObjectID `bson:"vehicle_types" json:"vehicle_types,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"`
	LimitSpecial                         string               `bson:"limit_special" json:"limit_special"`
	PoliceCheck                          string               `bson:"police_check" json:"police_check"`
	PoliceCheckDT                        time.Time            `json:"-"`
	DriversLicenseClass                  string               `bson:"drivers_license_class" json:"drivers_license_class"`
	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 StaffOperationArchiveRequestIDO

type StaffOperationArchiveRequestIDO struct {
	StaffID primitive.ObjectID `json:"staff_id"`
}

type StaffOperationAvatarRequest

type StaffOperationAvatarRequest struct {
	StaffID  primitive.ObjectID `bson:"staff_id" json:"staff_id"`
	FileName string
	FileType string
	File     multipart.File
}

type StaffOperationChangePasswordRequest

type StaffOperationChangePasswordRequest struct {
	StaffID          primitive.ObjectID `bson:"staff_id" json:"staff_id"`
	Password         string             `bson:"password" json:"password"`
	PasswordRepeated string             `bson:"password_repeated" json:"password_repeated"`
}

type StaffOperationChangeTwoFactorAuthenticationRequest

type StaffOperationChangeTwoFactorAuthenticationRequest struct {
	StaffID    primitive.ObjectID `bson:"staff_id" json:"staff_id"`
	OTPEnabled bool               `bson:"otp_enabled" json:"otp_enabled"`
}

type StaffOperationCreateCommentRequest

type StaffOperationCreateCommentRequest struct {
	StaffID primitive.ObjectID `bson:"staff_id" json:"staff_id"`
	Content string             `bson:"content" json:"content"`
}

type StaffOperationDowngradeRequest

type StaffOperationDowngradeRequest struct {
	StaffID primitive.ObjectID `bson:"staff_id" json:"staff_id"`
}

type StaffOperationUpgradeRequest

type StaffOperationUpgradeRequest struct {
	StaffID primitive.ObjectID `bson:"staff_id" json:"staff_id"`
}

type StaffUpdateRequestIDO

type StaffUpdateRequestIDO struct {
	ID                                   primitive.ObjectID   `json:"id,omitempty"`
	Type                                 int8                 `json:"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"`
	VehicleTypes                         []primitive.ObjectID `bson:"vehicle_types" json:"vehicle_types,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"`
	LimitSpecial                         string               `bson:"limit_special" json:"limit_special"`
	PoliceCheck                          string               `bson:"police_check" json:"police_check"`
	PoliceCheckDT                        time.Time            `json:"-"`
	DriversLicenseClass                  string               `bson:"drivers_license_class" json:"drivers_license_class"`
	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"`
	Description                          string               `bson:"description" json:"description"`
}

Jump to

Keyboard shortcuts

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