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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomerController

CustomerController 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,
	org_storer ten_s.TenantStorer,
	com_storer com_s.CommentStorer,
	hh_storer hh_s.HowHearAboutUsItemStorer,
	t_storer t_s.TagStorer,
	usr_storer user_s.UserStorer,
	attch_storer attachment_s.AttachmentStorer,
	c_storer c_s.CustomerStorer,
	o_storer o_s.OrderStorer,
	ti_storer ti_s.TaskItemStorer,
) CustomerController

type CustomerControllerImpl

type CustomerControllerImpl 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
	HowHearStorer    hh_s.HowHearAboutUsItemStorer
	TagStorer        t_s.TagStorer
	UserStorer       user_s.UserStorer
	AttachmentStorer attachment_s.AttachmentStorer
	CustomerStorer   c_s.CustomerStorer
	OrderStorer      o_s.OrderStorer
	TaskItemStorer   ti_s.TaskItemStorer
}

func (*CustomerControllerImpl) Archive

func (*CustomerControllerImpl) Avatar

func (*CustomerControllerImpl) Ban

func (*CustomerControllerImpl) ChangePassword

func (*CustomerControllerImpl) ChangeTwoFactorAuthentication

func (*CustomerControllerImpl) Create

func (*CustomerControllerImpl) CreateComment

func (*CustomerControllerImpl) DeleteByID

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

func (*CustomerControllerImpl) Downgrade

func (*CustomerControllerImpl) GetByID

func (*CustomerControllerImpl) ListAsSelectOptionByFilter

func (c *CustomerControllerImpl) ListAsSelectOptionByFilter(ctx context.Context, f *c_s.CustomerListFilter) ([]*c_s.CustomerAsSelectOption, error)

func (*CustomerControllerImpl) Unban

func (*CustomerControllerImpl) UpdateByID

func (*CustomerControllerImpl) UpdateRelatedByOrders

func (impl *CustomerControllerImpl) UpdateRelatedByOrders(sessCtx mongo.SessionContext, cust *c_s.Customer) error

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

func (*CustomerControllerImpl) UpdateRelatedByTags

func (impl *CustomerControllerImpl) UpdateRelatedByTags(sessCtx mongo.SessionContext, cust *c_s.Customer, modifiedTIDs []primitive.ObjectID) error

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

func (*CustomerControllerImpl) UpdateRelatedByTaskItems

func (impl *CustomerControllerImpl) UpdateRelatedByTaskItems(sessCtx mongo.SessionContext, cust *c_s.Customer) error

UpdateRelatedByTaskItems function will take the inputted `TaskItem` with the customer.

func (*CustomerControllerImpl) UpdateRelatedByUser

func (impl *CustomerControllerImpl) UpdateRelatedByUser(sessCtx mongo.SessionContext, cust *c_s.Customer) error

UpdateRelatedByUser function will update the user account.

func (*CustomerControllerImpl) Upgrade

type CustomerCreateRequestIDO

type CustomerCreateRequestIDO 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"`
	OtherPhoneType              int8                 `json:"other_phone_type"`
	OtherPhoneExtension         string               `json:"other_phone_extension"`
	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"`
	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"`
	PreferredLanguage           string               `bson:"preferred_language" json:"preferred_language"`
	Password                    string               `bson:"password" json:"password"`
	PasswordRepeated            string               `bson:"password_repeated" json:"password_repeated"`
}

type CustomerOperationArchiveRequestIDO

type CustomerOperationArchiveRequestIDO struct {
	CustomerID primitive.ObjectID `json:"customer_id"`
}

type CustomerOperationAvatarRequest

type CustomerOperationAvatarRequest struct {
	CustomerID primitive.ObjectID `bson:"customer_id" json:"customer_id"`
	FileName   string
	FileType   string
	File       multipart.File
}

type CustomerOperationBanRequest

type CustomerOperationBanRequest struct {
	CustomerID         primitive.ObjectID `bson:"customer_id" json:"customer_id"`
	BanningReason      int8               `bson:"banning_reason" json:"banning_reason"`
	BanningReasonOther string             `bson:"banning_reason_other" json:"banning_reason_other"`
}

type CustomerOperationChangePasswordRequest

type CustomerOperationChangePasswordRequest struct {
	CustomerID       primitive.ObjectID `bson:"customer_id" json:"customer_id"`
	Password         string             `bson:"password" json:"password"`
	PasswordRepeated string             `bson:"password_repeated" json:"password_repeated"`
}

type CustomerOperationChangeTwoFactorAuthenticationRequest

type CustomerOperationChangeTwoFactorAuthenticationRequest struct {
	CustomerID primitive.ObjectID `bson:"customer_id" json:"customer_id"`
	OTPEnabled bool               `bson:"otp_enabled" json:"otp_enabled"`
}

type CustomerOperationCreateCommentRequest

type CustomerOperationCreateCommentRequest struct {
	CustomerID primitive.ObjectID `bson:"customer_id" json:"customer_id"`
	Content    string             `bson:"content" json:"content"`
}

type CustomerOperationDowngradeRequest

type CustomerOperationDowngradeRequest struct {
	CustomerID primitive.ObjectID `bson:"customer_id" json:"customer_id"`
}

type CustomerOperationUnbanRequest

type CustomerOperationUnbanRequest struct {
	CustomerID primitive.ObjectID `bson:"customer_id" json:"customer_id"`
}

type CustomerOperationUpgradeRequest

type CustomerOperationUpgradeRequest struct {
	CustomerID       primitive.ObjectID `bson:"customer_id" json:"customer_id"`
	OrganizationName string             `bson:"organization_name" json:"organization_name"`
	OrganizationType int8               `bson:"organization_type" json:"organization_type"`
}

type CustomerUpdateRequestIDO

type CustomerUpdateRequestIDO 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"`
	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"`
	PreferredLanguage           string               `bson:"preferred_language" json:"preferred_language"`
}

Jump to

Keyboard shortcuts

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