services

package
v0.0.0-...-b2c487f Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BidService

type BidService interface {
	GetPublicProjectBids(projectID int) []dto.PublicProjectBidInfo
	GetPrivateProjectBids(userID int, projectID int) []dto.PrivateProjectBidInfo
	GetTeamBids(userID int, teamID int64) []dto.BidInfo
	PutBidOnProject(info dto.BidInfo) int
	AcceptBid(userID int, bidID int, projectID int)
	UpdateBid(info dto.BidInfo)
}

type CareerService

type CareerService interface {
	GetCareersForUser(userid int, target int) []dto.SendCareerDTO
	UpdateCareers(userid int, params []dto.CareerDTO) []dto.CareerDTO
}

type ChatService

type ChatService interface {
	GetAllRoom(userID int) []dto.RoomInfo
	GetRoomMessages(userID, roomID int) []dto.Message
	CreateUserRoom(userID int, targetUserID int) *dto.RoomInfo
	SaveMessage(roomID int, senderID int, content string) *dto.Message
}

type CommentService

type CommentService interface {
	PutComment(userID, ProjectID int, content string, star int) int
	GetUserStarAndComment(userID int) (float64, int)
	GetUserComments(userID int) []dto.CommentWithUserDTO
	GetCommentInfo(id int) *dto.CommentWithUserDTO
	GetCommentOfProject(projectID int) *dto.CommentDTO
}

type EmailService

type EmailService interface {
	SendTeamInvites(userId int, newMembers []int, teamId int64) error

	SendAcceptedInvitationEmail(inviteeid, inviterid int, teamid int64) error
	SendEmailVerificationEmail(userid int) error

	SendNotification(userId int, subject string, body string) error
	SendEmail(to, subject string, body string) error
}

type FileService

type FileService interface {
	GetProfilePhotoURL(userid int, wantHighQual bool) string
	GetTeamProfilePhotoURL(teamid int64, wantHighQual bool) string
	GetResumeURL(userid int) string
	UploadProfilePhoto(data []byte, userid int)
	DeleteProfilePhoto(userid int)
	UploadTeamProfilePhoto(data []byte, teamid int64)
	DeleteTeamProfilePhoto(teamid int64)
	UploadResume(data []byte, userid int)
	DeleteResume(userid int)
}

type JWT

type JWT interface {
	GenerateToken(userID int) (string, string)
	VerifyToken(tokenString string) (jwt.MapClaims, error)
	RefreshToken(token string) string
}

type LabelService

type LabelService interface {
	GetLabels() []byte
	GetLabelInfo(labelID int) *models.LabelModel
}

type PaymentService

type PaymentService interface {
	GetUserBalance(userID int) int64
	GetUserTransactions(userID int, offset, limit int, sortBy, order string) (int, []dto.UserTransactionDTO)
	ProjectPayment(ctx context.Context, tx transaction.Tx, userID int, amount int64)
	Deposit(userID int, amount int64, description string)
	Withdraw(userID int, amount int64, description string)
	TransferMoney(ctx context.Context, tx transaction.Tx, fromUserID, toUserID int, amount int64, description string)
}

type ProjectService

type ProjectService interface {
	LandingProps() []dto.ProjectLanding
	GetProject(projectID int) *models.ProjectModel
	GetUserProjects(userID, targetuserID, offset, limit int) ([]models.ProjectModel, int)
	GetProjectCount(userID int) int
	CreateProject(userID int, title, description string, label int, durationInt int, price int64, tags []int) int
	UpdateProject(projectID, userID int, title, description string, label int, price int64, tags []int)
	DeleteProject(userID, projectID int)
	EndOfProject(userID, projectID int)
	GetTeamProjects(userID int, teamID int64) []models.ProjectModel
	GetParticipatedProjectsForUser(userid int) []models.ProjectModel
	GetOneManTeamProjects(userID int) []models.ProjectModel
	SearchProjects(req *elasticmodel.QueryAndTagSearchReqDto) []map[string]any
}

type RoleService

type RoleService interface {
	GetPermissionsForRole(role string) []string
	GetAllRolesForTeam() []string
}

type SherlockService

type SherlockService interface {
	SearchEverything(req *elasticmodel.SearchRequest) []elasticmodel.InnerHits
}

type SmsService

type SmsService interface {
	GenerateOTP() string
	SendOTP(phonenumber string, code string)
}

type TagService

type TagService interface {
	GetTags() []byte
	GetTagsForUser(userid int) []dto.GetTagDto
	UpdateTagsForCareerOrUser(careerUserid int, newTags []dto.RecieveTagDTO, isForUser bool) []dto.RecieveTagDTO
	UpdateTagsForProject(projectid int, newTags []int)
}

type TeamService

type TeamService interface {
	BehindCurtainTeam(ctx context.Context, tx transaction.Tx, userid int)
	CreateTeam(userid int, teamInfo *dto.TeamCreateDto) int64
	GetTeamsForUser(userid int, active, dontCare int) []dto.GetTeamPreviewDto
	GetTeam(commanderid int, teamid int64) *dto.GetTeamDto
	GetInternalTeamInfo(teamid int64) *dto.GetInternalTeamInfo
	GetTeamsForBidding(userid int) *dto.TeamListDto
	UpdateTeamInfo(userid int, info *dto.UpdateTeamInfoDto)
	UpdatePosition(commanderid int, req *dto.UpdateMemberPositionDto)
	UpdateMemeberRole(commanderid int, info *dto.UpdateMemberRoleDto)
	DeleteTeam(commanderid int, teamid int64)
	// GetTeamWithRole(userid int, teamid int64) *dto.GetTeamDto
	InviteMembers(userid int, teamid int64, members []int)
	LeaveTeam(userid int, teamid int64)
	KickMemebr(commanderid int, poorGuysid []int, teamid int64)
	GetMembers(commanderid int, teamid int64) []dto.SendMemberDto
	DeleteTeamProfile(commanderid int, teamid int64)
	UpdateTeamProfile(commanderid int, teamid int64, data []byte)
	GetOneManTeamID(userid int) int64
	GetAllTeamsIDs(userID int) []int64
	SearchTeams(req *elasticmodel.SimpleQuerySearchReqDto) []map[string]any
	AcceptInvite(token string, teamid int64)
}

type UrlTokenService

type UrlTokenService interface {
	GenerateTeamInviteToken(userid, senderID int, teamid int64) (string, error)
	GenerateEmailVerificationToken(userid int) (string, error)
	GetToken(tokenStr string) (*models.UrlToken, error)
	GetTokenWithPurpose(tokenStr string, expectedPurpose enums.UrlTokenPurpose) (*models.UrlToken, error)
	DeleteToken(token string) error
}

type UserService

type UserService interface {
	CheckAvailabilityForSignup(phonenumber string, username string) string
	CacheUserInfo(phonenumber string, username string, password string, otp string) string
	ValidateOTP(session string, otp string) (string, string, []byte)
	Register(phonenumber string, username string, password []byte, session string) int
	AuthenticateUser(identifier string, password string) *models.UserModel
	ChangePasswordValidate(user_id int, old_password string)
	ChangePassword(user_id int, new_password string)
	SetupOTP(phonenumber string, code string) string
	SetForgetPasswordFlag(userID string) string
	CheckFlagForPasswordReset(session string) int
	UpdateUserData(userid int, userData *dto.UpdateUserDTO)
	UpdateEmail(userid int, email string)
	UpdateUsername(userid int, username string)
	UpdatePhoneSendOTP(phone string, userid int, code string) string
	UpdatePhone(phone string, userid string)
	GetUserInfo(targetUserid int, userid int) *dto.UserProfileDTO
	DeleteUser(userid int)
	SearchUsers(req *elasticmodel.QueryAndTagSearchReqDto) []map[string]any

	VerifyEmail(userid int, token string)
	ResendEmailVerification(userid int)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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