services

package
v0.0.0-...-f3f608d Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package services contains the application services (use cases).

Package services contains the application services (use cases).

Package services contains the application services (use cases).

Package services contains the application services (use cases).

Package services implements application services and use cases.

Package services contains the application services (use cases).

Package services contains the application services (use cases).

Package services contains the application services (use cases).

Package services contains the application services (use cases).

Package services contains the application services (use cases) that orchestrate domain logic and coordinate between ports.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPDF      = errors.New("invalid PDF format")
	ErrPageCountFailed = errors.New("failed to extract page count from PDF")
)

PDF page counting errors.

Functions

func CountPDFPages

func CountPDFPages(pdfData []byte) (int, error)

CountPDFPages extracts the number of pages from a PDF byte slice. It parses the PDF structure to find the /Pages dictionary and reads the /Count value. This is a lightweight implementation that avoids external dependencies.

func GetLanguageName

func GetLanguageName(locale Locale) string

GetLanguageName returns the display name for a locale.

Types

type AddProjectBulletRequest

type AddProjectBulletRequest struct {
	ProjectID    string
	Content      string
	DisplayOrder int
}

AddProjectBulletRequest contains parameters for adding a bullet to a project.

type AnalyzeBulletImpactRequest

type AnalyzeBulletImpactRequest struct {
	BulletID       string
	JobDescription string
}

AnalyzeBulletImpactRequest contains parameters for analyzing bullet impact.

type BatchUpsertSkillsRequest

type BatchUpsertSkillsRequest struct {
	UserID string
	Skills []CreateSkillRequest
}

BatchUpsertSkillsRequest contains parameters for batch upserting skills.

type BatchUpsertSkillsResponse

type BatchUpsertSkillsResponse struct {
	Created int
	Updated int
}

BatchUpsertSkillsResponse contains the result of batch upsert.

type BulletService

type BulletService struct {
	// contains filtered or unexported fields
}

BulletService handles bullet-related use cases.

func NewBulletService

func NewBulletService(
	bulletRepo ports.BulletRepository,
	experienceRepo ports.ExperienceRepository,
	aiProvider ports.AIProvider,
) *BulletService

NewBulletService creates a new BulletService with required dependencies.

func (*BulletService) AnalyzeBulletImpact

func (s *BulletService) AnalyzeBulletImpact(ctx context.Context, req AnalyzeBulletImpactRequest) (*domain.Bullet, error)

AnalyzeBulletImpact uses AI to analyze and score a bullet's impact.

func (*BulletService) CreateBullet

func (s *BulletService) CreateBullet(ctx context.Context, req CreateBulletRequest) (*domain.Bullet, error)

CreateBullet creates a new bullet for an experience.

func (*BulletService) DeleteBullet

func (s *BulletService) DeleteBullet(ctx context.Context, bulletID string) error

DeleteBullet removes a bullet.

func (*BulletService) GetBullet

func (s *BulletService) GetBullet(ctx context.Context, bulletID string) (*domain.Bullet, error)

GetBullet retrieves a bullet by ID.

func (*BulletService) GetHighImpactBullets

func (s *BulletService) GetHighImpactBullets(ctx context.Context, req GetHighImpactBulletsRequest) ([]domain.Bullet, error)

GetHighImpactBullets retrieves bullets with high impact scores.

func (*BulletService) ListBulletsByExperience

func (s *BulletService) ListBulletsByExperience(ctx context.Context, experienceID string) ([]domain.Bullet, error)

ListBulletsByExperience lists all bullets for an experience.

func (*BulletService) ListBulletsByUser

func (s *BulletService) ListBulletsByUser(ctx context.Context, userID string) ([]domain.Bullet, error)

ListBulletsByUser lists all bullets for a user across all experiences.

func (*BulletService) SearchBullets

func (s *BulletService) SearchBullets(ctx context.Context, req SearchBulletsRequest) ([]domain.Bullet, error)

SearchBullets searches bullets by keywords.

func (*BulletService) UpdateBullet

func (s *BulletService) UpdateBullet(ctx context.Context, req UpdateBulletRequest) (*domain.Bullet, error)

UpdateBullet updates an existing bullet.

type CreateBulletRequest

type CreateBulletRequest struct {
	ExperienceID string
	Content      string
	ImpactScore  *int
	Keywords     []string
	DisplayOrder int
}

CreateBulletRequest contains the parameters for creating a bullet.

type CreateEducationRequest

type CreateEducationRequest struct {
	UserID       string
	Institution  string
	Degree       string
	FieldOfStudy *string
	Location     *string
	StartDate    *domain.Date
	EndDate      *domain.Date
	GPA          *string
	Honors       []string
	DisplayOrder int
}

CreateEducationRequest contains the parameters for creating an education entry.

type CreateExperienceRequest

type CreateExperienceRequest struct {
	UserID       string
	Type         string
	Title        string
	Organization string
	Location     *string
	StartDate    string
	EndDate      *string
	IsCurrent    bool
	Description  *string
	URL          *string
	DisplayOrder int
}

CreateExperienceRequest contains the parameters for creating an experience.

type CreateProjectRequest

type CreateProjectRequest struct {
	UserID        string
	Name          string
	Description   *string
	TechStack     []string
	URL           *string
	RepositoryURL *string
	StartDate     *domain.Date
	EndDate       *domain.Date
	DisplayOrder  int
	Bullets       []string // Initial bullet contents
}

CreateProjectRequest contains the parameters for creating a project.

type CreateResumeRequest

type CreateResumeRequest struct {
	UserID         string
	JobDescription string
	JobTitle       *string
	CompanyName    *string
	JobURL         *string
	TargetLanguage string
	TargetPages    int
}

CreateResumeRequest contains parameters for creating a resume.

type CreateSkillRequest

type CreateSkillRequest struct {
	UserID            string
	Name              string
	Category          *string
	ProficiencyLevel  int
	YearsOfExperience *float64
	IsHighlighted     bool
	DisplayOrder      int
}

CreateSkillRequest contains the parameters for creating a skill.

type CreateSpokenLanguageRequest

type CreateSpokenLanguageRequest struct {
	UserID       string
	Language     string
	Proficiency  string
	DisplayOrder int
}

CreateSpokenLanguageRequest contains parameters for creating a spoken language.

type DownloadPDFRequest

type DownloadPDFRequest struct {
	ResumeID        string
	TemplateName    string
	ForceRegenerate bool
}

DownloadPDFRequest contains parameters for downloading a resume PDF.

type DownloadPDFResult

type DownloadPDFResult struct {
	Content     []byte
	Filename    string
	ContentType string
}

DownloadPDFResult contains the result of downloading a PDF.

type EducationService

type EducationService struct {
	// contains filtered or unexported fields
}

EducationService handles education-related use cases.

func NewEducationService

func NewEducationService(educationRepo ports.EducationRepository) *EducationService

NewEducationService creates a new EducationService with required dependencies.

func (*EducationService) CreateEducation

func (s *EducationService) CreateEducation(ctx context.Context, req CreateEducationRequest) (*domain.Education, error)

CreateEducation creates a new education entry for a user.

func (*EducationService) DeleteEducation

func (s *EducationService) DeleteEducation(ctx context.Context, educationID string) error

DeleteEducation removes an education entry.

func (*EducationService) GetEducation

func (s *EducationService) GetEducation(ctx context.Context, educationID string) (*domain.Education, error)

GetEducation retrieves an education entry by ID.

func (*EducationService) ListEducation

func (s *EducationService) ListEducation(ctx context.Context, req ListEducationRequest) ([]domain.Education, error)

ListEducation lists all education entries for a user.

func (*EducationService) UpdateEducation

func (s *EducationService) UpdateEducation(ctx context.Context, req UpdateEducationRequest) (*domain.Education, error)

UpdateEducation updates an existing education entry.

func (*EducationService) UpdateEducationOrder

func (s *EducationService) UpdateEducationOrder(ctx context.Context, req UpdateEducationOrderRequest) error

UpdateEducationOrder updates the display order of education entries.

type ExperienceService

type ExperienceService struct {
	// contains filtered or unexported fields
}

ExperienceService handles experience-related use cases.

func NewExperienceService

func NewExperienceService(
	experienceRepo ports.ExperienceRepository,
	bulletRepo ports.BulletRepository,
) *ExperienceService

NewExperienceService creates a new ExperienceService with required dependencies.

func (*ExperienceService) CreateExperience

CreateExperience creates a new experience entry.

func (*ExperienceService) DeleteExperience

func (s *ExperienceService) DeleteExperience(ctx context.Context, experienceID string) error

DeleteExperience removes an experience and all its bullets.

func (*ExperienceService) GetExperience

func (s *ExperienceService) GetExperience(ctx context.Context, experienceID string) (*domain.Experience, error)

GetExperience retrieves an experience by ID.

func (*ExperienceService) GetExperienceWithBullets

func (s *ExperienceService) GetExperienceWithBullets(ctx context.Context, experienceID string) (*domain.Experience, error)

GetExperienceWithBullets retrieves an experience with all its bullets.

func (*ExperienceService) ListExperiences

ListExperiences lists experiences for a user with optional type filter.

func (*ExperienceService) ReorderExperiences

func (s *ExperienceService) ReorderExperiences(ctx context.Context, req ReorderExperiencesRequest) error

ReorderExperiences updates the display order of multiple experiences.

func (*ExperienceService) UpdateExperience

UpdateExperience updates an existing experience.

type GeneratePDFRequest

type GeneratePDFRequest struct {
	ResumeID     string
	TemplateName string
}

GeneratePDFRequest contains parameters for generating a PDF.

type GetHighImpactBulletsRequest

type GetHighImpactBulletsRequest struct {
	UserID   string
	MinScore int
	Limit    int
}

GetHighImpactBulletsRequest contains parameters for getting high-impact bullets.

type I18n

type I18n struct {
	// contains filtered or unexported fields
}

I18n provides internationalization utilities for resume generation.

func NewI18n

func NewI18n(locale Locale) *I18n

NewI18n creates a new I18n instance for the specified locale.

func (*I18n) FormatDate

func (i *I18n) FormatDate(t time.Time) string

FormatDate formats a date according to the locale. For en-US: "Jan 2024" For pt-BR: "01/2024" For es-ES: "Ene 2024"

func (*I18n) FormatDateRange

func (i *I18n) FormatDateRange(startDate string, endDate *string) string

FormatDateRange formats a date range according to the locale. If endDate is nil or empty, uses "Present" (localized).

func (*I18n) FormatDateString

func (i *I18n) FormatDateString(dateStr string) string

FormatDateString parses a date string and formats it according to the locale. Accepts formats: "2024-01-15", "2024-01", "Jan 2024"

func (*I18n) FormatGPA

func (i *I18n) FormatGPA(gpa float64, scale float64) string

FormatGPA formats GPA display according to the locale. For en-US: "GPA: 3.8" For pt-BR: "CR: 3.8" or "Média: 8.5"

func (*I18n) FormatProficiencyLevel

func (i *I18n) FormatProficiencyLevel(level string) string

FormatProficiencyLevel returns the localized proficiency level.

func (*I18n) Locale

func (i *I18n) Locale() Locale

Locale returns the current locale.

func (*I18n) T

func (i *I18n) T(key TranslationKey) string

T returns the translated string for the given key.

type JakeResumeTemplate

type JakeResumeTemplate struct{}

JakeResumeTemplate implements the Jake's Resume format. This is the gold standard for developer resumes: - Single page, dense, ATS-friendly - Sections: Header → Education → Experience → Projects → Technical Skills - Clean typography with clear visual hierarchy

func NewJakeResumeTemplate

func NewJakeResumeTemplate() *JakeResumeTemplate

NewJakeResumeTemplate creates a new Jake's Resume template.

func (*JakeResumeTemplate) Render

Render generates the HTML for the resume.

type ListEducationRequest

type ListEducationRequest struct {
	UserID string
}

ListEducationRequest contains parameters for listing education entries.

type ListExperiencesRequest

type ListExperiencesRequest struct {
	UserID string
	Type   *string
	Limit  int
	Offset int
}

ListExperiencesRequest contains the parameters for listing experiences.

type ListExperiencesResponse

type ListExperiencesResponse struct {
	Experiences []domain.Experience
	Total       int
}

ListExperiencesResponse contains the result of listing experiences.

type ListProjectsRequest

type ListProjectsRequest struct {
	UserID string
}

ListProjectsRequest contains parameters for listing projects.

type ListResumesRequest

type ListResumesRequest struct {
	UserID string
	Status *string
	Limit  int
	Offset int
}

ListResumesRequest contains parameters for listing resumes.

type ListResumesResponse

type ListResumesResponse struct {
	Resumes []domain.Resume
	Total   int
}

ListResumesResponse contains the result of listing resumes.

type ListSkillsRequest

type ListSkillsRequest struct {
	UserID   string
	Category *string
}

ListSkillsRequest contains parameters for listing skills.

type Locale

type Locale string

Locale represents a supported language/region combination.

const (
	LocaleEnUS Locale = "en-US"
	LocalePtBR Locale = "pt-BR"
	LocaleEsES Locale = "es-ES"
	LocaleFrFR Locale = "fr-FR"
	LocaleDeDE Locale = "de-DE"
)

func ParseLocale

func ParseLocale(s string) Locale

ParseLocale converts a locale string to a Locale type. Supports formats like "en", "en-US", "pt-br", "pt_BR".

func SupportedLocales

func SupportedLocales() []Locale

SupportedLocales returns all supported locales.

type PDFPageInfo

type PDFPageInfo struct {
	PageCount     int
	ExceedsTarget bool
	TargetPages   int
}

PDFPageInfo contains information about PDF pages.

func AnalyzePDFPages

func AnalyzePDFPages(pdfData []byte, targetPages int) (*PDFPageInfo, error)

AnalyzePDFPages analyzes a PDF and returns page information relative to a target.

type ParseJobURLRequest

type ParseJobURLRequest struct {
	URL string
}

ParseJobURLRequest contains parameters for parsing a job URL.

type ProjectService

type ProjectService struct {
	// contains filtered or unexported fields
}

ProjectService handles project-related use cases.

func NewProjectService

func NewProjectService(
	projectRepo ports.ProjectRepository,
	projectBulletRepo ports.ProjectBulletRepository,
) *ProjectService

NewProjectService creates a new ProjectService with required dependencies.

func (*ProjectService) AddProjectBullet

AddProjectBullet adds a bullet to a project.

func (*ProjectService) CreateProject

func (s *ProjectService) CreateProject(ctx context.Context, req CreateProjectRequest) (*domain.Project, error)

CreateProject creates a new project for a user.

func (*ProjectService) DeleteProject

func (s *ProjectService) DeleteProject(ctx context.Context, projectID string) error

DeleteProject removes a project and all its bullets.

func (*ProjectService) DeleteProjectBullet

func (s *ProjectService) DeleteProjectBullet(ctx context.Context, bulletID string) error

DeleteProjectBullet removes a project bullet.

func (*ProjectService) GetProject

func (s *ProjectService) GetProject(ctx context.Context, projectID string) (*domain.Project, error)

GetProject retrieves a project by ID.

func (*ProjectService) ListProjects

func (s *ProjectService) ListProjects(ctx context.Context, req ListProjectsRequest) ([]domain.Project, error)

ListProjects lists all projects for a user.

func (*ProjectService) SearchProjectsByTech

func (s *ProjectService) SearchProjectsByTech(ctx context.Context, req SearchProjectsByTechRequest) ([]domain.Project, error)

SearchProjectsByTech searches for projects containing specific technologies.

func (*ProjectService) UpdateProject

func (s *ProjectService) UpdateProject(ctx context.Context, req UpdateProjectRequest) (*domain.Project, error)

UpdateProject updates an existing project.

func (*ProjectService) UpdateProjectBullet

func (s *ProjectService) UpdateProjectBullet(ctx context.Context, req UpdateProjectBulletRequest) (*domain.ProjectBullet, error)

UpdateProjectBullet updates an existing project bullet.

func (*ProjectService) UpdateProjectOrder

func (s *ProjectService) UpdateProjectOrder(ctx context.Context, req UpdateProjectOrderRequest) error

UpdateProjectOrder updates the display order of projects.

type ReorderExperiencesRequest

type ReorderExperiencesRequest struct {
	Orders []ports.DisplayOrderUpdate
}

ReorderExperiencesRequest contains the new order for experiences.

type ResumeService

type ResumeService struct {
	// contains filtered or unexported fields
}

ResumeService handles resume generation and management use cases.

func NewResumeService

func NewResumeService(
	resumeRepo ports.ResumeRepository,
	userRepo ports.UserRepository,
	experienceRepo ports.ExperienceRepository,
	bulletRepo ports.BulletRepository,
	skillRepo ports.SkillRepository,
	languageRepo ports.SpokenLanguageRepository,
	educationRepo ports.EducationRepository,
	projectRepo ports.ProjectRepository,
	aiProvider ports.AIProvider,
	pdfEngine ports.PDFEngine,
	jobParser ports.JobParser,
	fileStorage ports.FileStorage,
) *ResumeService

NewResumeService creates a new ResumeService with required dependencies.

func (*ResumeService) CreateResume

func (s *ResumeService) CreateResume(ctx context.Context, req CreateResumeRequest) (*domain.Resume, error)

CreateResume creates a new resume draft.

func (*ResumeService) DeleteResume

func (s *ResumeService) DeleteResume(ctx context.Context, resumeID string) error

DeleteResume removes a resume.

func (*ResumeService) DownloadPDF

DownloadPDF generates (if needed) and returns the PDF bytes for a resume. Implements "Ruthless Page Enforcement" - aggressively removes content to fit target pages.

func (*ResumeService) GeneratePDF

func (s *ResumeService) GeneratePDF(ctx context.Context, req GeneratePDFRequest) (*domain.Resume, error)

GeneratePDF generates a PDF for a resume.

func (*ResumeService) GetResume

func (s *ResumeService) GetResume(ctx context.Context, resumeID string) (*domain.Resume, error)

GetResume retrieves a resume by ID.

func (*ResumeService) ListResumes

ListResumes lists resumes for a user with optional status filter.

func (*ResumeService) ParseJobURL

func (s *ResumeService) ParseJobURL(ctx context.Context, req ParseJobURLRequest) (*ports.ParsedJob, error)

ParseJobURL parses a job description from a URL using Jina Reader.

func (*ResumeService) TailorResume

func (s *ResumeService) TailorResume(ctx context.Context, req TailorResumeRequest) (*domain.Resume, error)

TailorResume generates AI-tailored content for a resume. This uses the split selection logic: Experiences first, then Projects as fillers.

func (*ResumeService) UpdateResume

func (s *ResumeService) UpdateResume(ctx context.Context, req UpdateResumeRequest) (*domain.Resume, error)

UpdateResume updates a resume with all provided fields.

func (*ResumeService) UpdateResumeStatus

func (s *ResumeService) UpdateResumeStatus(ctx context.Context, req UpdateResumeStatusRequest) (*domain.Resume, error)

UpdateResumeStatus updates the status of a resume.

type ResumeTemplateData

type ResumeTemplateData struct {
	User        *domain.User
	Resume      *domain.Resume
	Education   []domain.Education
	ProjectsMap map[string]domain.Project // Lookup map for project metadata (tech stack, URLs, etc.)
	Languages   []domain.SpokenLanguage
	Skills      []domain.Skill
	FontSize    int    // Base font size in pt (10, 9, or 8)
	ShowSummary bool   // Whether to show the professional summary
	Locale      Locale // Locale for internationalization (defaults to en-US)
}

ResumeTemplateData contains all data needed to render a resume.

type SearchBulletsRequest

type SearchBulletsRequest struct {
	UserID   string
	Keywords []string
}

SearchBulletsRequest contains the parameters for searching bullets.

type SearchProjectsByTechRequest

type SearchProjectsByTechRequest struct {
	UserID       string
	Technologies []string
}

SearchProjectsByTechRequest contains parameters for searching projects by tech stack.

type SkillService

type SkillService struct {
	// contains filtered or unexported fields
}

SkillService handles skill and spoken language-related use cases.

func NewSkillService

func NewSkillService(
	skillRepo ports.SkillRepository,
	languageRepo ports.SpokenLanguageRepository,
) *SkillService

NewSkillService creates a new SkillService with required dependencies.

func (*SkillService) BatchUpsertSkills

BatchUpsertSkills creates or updates multiple skills at once.

func (*SkillService) CreateSkill

func (s *SkillService) CreateSkill(ctx context.Context, req CreateSkillRequest) (*domain.Skill, error)

CreateSkill creates a new skill for a user.

func (*SkillService) CreateSpokenLanguage

func (s *SkillService) CreateSpokenLanguage(ctx context.Context, req CreateSpokenLanguageRequest) (*domain.SpokenLanguage, error)

CreateSpokenLanguage creates a new spoken language for a user.

func (*SkillService) DeleteSkill

func (s *SkillService) DeleteSkill(ctx context.Context, skillID string) error

DeleteSkill removes a skill.

func (*SkillService) DeleteSpokenLanguage

func (s *SkillService) DeleteSpokenLanguage(ctx context.Context, languageID string) error

DeleteSpokenLanguage removes a spoken language.

func (*SkillService) GetSkill

func (s *SkillService) GetSkill(ctx context.Context, skillID string) (*domain.Skill, error)

GetSkill retrieves a skill by ID.

func (*SkillService) ListHighlightedSkills

func (s *SkillService) ListHighlightedSkills(ctx context.Context, userID string) ([]domain.Skill, error)

ListHighlightedSkills lists highlighted skills for a user.

func (*SkillService) ListSkills

func (s *SkillService) ListSkills(ctx context.Context, req ListSkillsRequest) ([]domain.Skill, error)

ListSkills lists all skills for a user with optional category filter.

func (*SkillService) ListSpokenLanguages

func (s *SkillService) ListSpokenLanguages(ctx context.Context, userID string) ([]domain.SpokenLanguage, error)

ListSpokenLanguages lists all spoken languages for a user.

func (*SkillService) SearchSkills

func (s *SkillService) SearchSkills(ctx context.Context, userID, query string) ([]domain.Skill, error)

SearchSkills searches skills by name.

func (*SkillService) UpdateSkill

func (s *SkillService) UpdateSkill(ctx context.Context, req UpdateSkillRequest) (*domain.Skill, error)

UpdateSkill updates an existing skill.

func (*SkillService) UpdateSpokenLanguage

func (s *SkillService) UpdateSpokenLanguage(ctx context.Context, req UpdateSpokenLanguageRequest) (*domain.SpokenLanguage, error)

UpdateSpokenLanguage updates an existing spoken language.

type SyncUserRequest

type SyncUserRequest struct {
	IDToken string
}

SyncUserRequest contains the parameters for syncing a user from auth provider.

type SyncUserResponse

type SyncUserResponse struct {
	User      *domain.User
	IsNewUser bool
}

SyncUserResponse contains the result of user synchronization.

type TailorResumeRequest

type TailorResumeRequest struct {
	ResumeID   string
	MaxBullets int
}

TailorResumeRequest contains parameters for tailoring a resume.

type TranslationKey

type TranslationKey string

TranslationKey represents a key for translated text.

const (
	KeyProfessionalSummary TranslationKey = "professional_summary"
	KeyEducation           TranslationKey = "education"
	KeyExperience          TranslationKey = "experience"
	KeyProjects            TranslationKey = "projects"
	KeyTechnicalSkills     TranslationKey = "technical_skills"
	KeyLanguages           TranslationKey = "languages"
	KeyPresent             TranslationKey = "present"
	KeyGPA                 TranslationKey = "gpa"
	KeyGrade               TranslationKey = "grade"
	KeyNative              TranslationKey = "native"
	KeyFluent              TranslationKey = "fluent"
	KeyAdvanced            TranslationKey = "advanced"
	KeyIntermediate        TranslationKey = "intermediate"
	KeyBasic               TranslationKey = "basic"
)

Common translation keys used in resume templates.

type UpdateBulletRequest

type UpdateBulletRequest struct {
	BulletID     string
	Content      *string
	ImpactScore  *int
	Keywords     []string
	DisplayOrder *int
}

UpdateBulletRequest contains the parameters for updating a bullet.

type UpdateEducationOrderRequest

type UpdateEducationOrderRequest struct {
	Orders []ports.DisplayOrderUpdate
}

UpdateEducationOrderRequest contains parameters for updating education display order.

type UpdateEducationRequest

type UpdateEducationRequest struct {
	EducationID  string
	Institution  *string
	Degree       *string
	FieldOfStudy *string
	Location     *string
	StartDate    *domain.Date
	EndDate      *domain.Date
	GPA          *string
	Honors       []string
	DisplayOrder *int
}

UpdateEducationRequest contains parameters for updating an education entry.

type UpdateExperienceRequest

type UpdateExperienceRequest struct {
	ExperienceID string
	Type         *string
	Title        *string
	Organization *string
	Location     *string
	StartDate    *string
	EndDate      *string
	IsCurrent    *bool
	Description  *string
	URL          *string
	DisplayOrder *int
}

UpdateExperienceRequest contains the parameters for updating an experience.

type UpdateProfileRequest

type UpdateProfileRequest struct {
	UserID            string
	Name              *string
	Headline          *string
	Summary           *string
	Location          *string
	Phone             *string
	Website           *string
	LinkedInURL       *string
	GitHubURL         *string
	PortfolioURL      *string
	PreferredLanguage *string
}

UpdateProfileRequest contains the parameters for updating a user's profile.

type UpdateProjectBulletRequest

type UpdateProjectBulletRequest struct {
	BulletID     string
	Content      *string
	DisplayOrder *int
}

UpdateProjectBulletRequest contains parameters for updating a project bullet.

type UpdateProjectOrderRequest

type UpdateProjectOrderRequest struct {
	Orders []ports.DisplayOrderUpdate
}

UpdateProjectOrderRequest contains parameters for updating project display order.

type UpdateProjectRequest

type UpdateProjectRequest struct {
	ProjectID     string
	Name          *string
	Description   *string
	TechStack     []string
	URL           *string
	RepositoryURL *string
	StartDate     *domain.Date
	EndDate       *domain.Date
	DisplayOrder  *int
}

UpdateProjectRequest contains parameters for updating a project.

type UpdateResumeRequest

type UpdateResumeRequest struct {
	ResumeID         string
	JobDescription   *string
	TargetLanguage   *string
	TargetPages      *int
	Notes            *string
	GeneratedContent *domain.ResumeContent
	Status           *string
}

UpdateResumeRequest contains parameters for updating a resume (PUT).

type UpdateResumeStatusRequest

type UpdateResumeStatusRequest struct {
	ResumeID  string
	NewStatus string
	Notes     *string
}

UpdateResumeStatusRequest contains parameters for updating resume status.

type UpdateSkillRequest

type UpdateSkillRequest struct {
	SkillID           string
	Name              *string
	Category          *string
	ProficiencyLevel  *int
	YearsOfExperience *float64
	IsHighlighted     *bool
	DisplayOrder      *int
}

UpdateSkillRequest contains the parameters for updating a skill.

type UpdateSpokenLanguageRequest

type UpdateSpokenLanguageRequest struct {
	LanguageID   string
	Language     *string
	Proficiency  *string
	DisplayOrder *int
}

UpdateSpokenLanguageRequest contains parameters for updating a spoken language.

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

UserService handles user-related use cases.

func NewUserService

func NewUserService(userRepo ports.UserRepository, authProvider ports.AuthProvider) *UserService

NewUserService creates a new UserService with the required dependencies.

func (*UserService) DeleteUser

func (s *UserService) DeleteUser(ctx context.Context, userID string) error

DeleteUser removes a user and all their data.

func (*UserService) GetUser

func (s *UserService) GetUser(ctx context.Context, userID string) (*domain.User, error)

GetUser retrieves a user by ID.

func (*UserService) GetUserByFirebaseUID

func (s *UserService) GetUserByFirebaseUID(ctx context.Context, firebaseUID string) (*domain.User, error)

GetUserByFirebaseUID retrieves a user by their Firebase UID.

func (*UserService) SyncUser

SyncUser synchronizes a user from the authentication provider. Creates a new user if they don't exist, or updates their information if they do.

func (*UserService) UpdateProfile

func (s *UserService) UpdateProfile(ctx context.Context, req UpdateProfileRequest) (*domain.User, error)

UpdateProfile updates a user's profile information.

Jump to

Keyboard shortcuts

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