initial commit
This commit is contained in:
13
internal/domain/profile/about.go
Normal file
13
internal/domain/profile/about.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package profile
|
||||
|
||||
type About struct {
|
||||
ProfilePicture string
|
||||
About string
|
||||
Achievements []Achievement
|
||||
}
|
||||
|
||||
type Achievement struct {
|
||||
Title string
|
||||
Value string
|
||||
Enabled bool
|
||||
}
|
||||
12
internal/domain/profile/contact.go
Normal file
12
internal/domain/profile/contact.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package profile
|
||||
|
||||
type Contact struct {
|
||||
Email string
|
||||
Phone string
|
||||
SocialLinks []SocialLink
|
||||
}
|
||||
|
||||
type SocialLink struct {
|
||||
LinkType string
|
||||
Link string
|
||||
}
|
||||
5
internal/domain/profile/errors.go
Normal file
5
internal/domain/profile/errors.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package profile
|
||||
|
||||
import "errors"
|
||||
|
||||
var ErrProfileNotFound = errors.New("profile not found")
|
||||
15
internal/domain/profile/filter.go
Normal file
15
internal/domain/profile/filter.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package profile
|
||||
|
||||
import "github.com/google/uuid"
|
||||
|
||||
type Filter struct {
|
||||
RoleID uuid.UUID
|
||||
FirstName string
|
||||
LastName string
|
||||
Company string
|
||||
SkillName string // Search by skill name
|
||||
Page uint
|
||||
PageSize uint
|
||||
SortedBy string
|
||||
Ascending bool
|
||||
}
|
||||
12
internal/domain/profile/hero.go
Normal file
12
internal/domain/profile/hero.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package profile
|
||||
|
||||
type Hero struct {
|
||||
Role *Role
|
||||
FirstName string
|
||||
LastName string
|
||||
Company string
|
||||
ShortDescription string
|
||||
ResumeLink string
|
||||
CTAEnabled bool
|
||||
Avatar string
|
||||
}
|
||||
5
internal/domain/profile/page_setting.go
Normal file
5
internal/domain/profile/page_setting.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package profile
|
||||
|
||||
type PageSetting struct {
|
||||
VisibilityLevel string // enum: public, private, only_me
|
||||
}
|
||||
21
internal/domain/profile/profile.go
Normal file
21
internal/domain/profile/profile.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package profile
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type Profile struct {
|
||||
ID uuid.UUID
|
||||
UserID *uuid.UUID // Optional: links profile to a user account
|
||||
Handle string
|
||||
PageSectionOrder map[string]int
|
||||
Hero Hero
|
||||
About About
|
||||
Skills []Skill
|
||||
Contact Contact
|
||||
PageSetting PageSetting
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
17
internal/domain/profile/repository.go
Normal file
17
internal/domain/profile/repository.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package profile
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type Repository interface {
|
||||
FindByID(ctx context.Context, id uuid.UUID) (*Profile, error)
|
||||
FindByHandle(ctx context.Context, handle string) (*Profile, error)
|
||||
Create(ctx context.Context, profile *Profile) error
|
||||
Update(ctx context.Context, profile *Profile) error
|
||||
Delete(ctx context.Context, profile *Profile) error
|
||||
FindByUserID(ctx context.Context, userId uuid.UUID) (*Profile, error)
|
||||
FindAll(ctx context.Context, filter Filter) ([]*Profile, int, error)
|
||||
}
|
||||
9
internal/domain/profile/role.go
Normal file
9
internal/domain/profile/role.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package profile
|
||||
|
||||
import "github.com/google/uuid"
|
||||
|
||||
type Role struct {
|
||||
ID uuid.UUID
|
||||
Level string // e.g. Junior, Senior, Lead
|
||||
Title string
|
||||
}
|
||||
20
internal/domain/profile/role_repository.go
Normal file
20
internal/domain/profile/role_repository.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package profile
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
var ErrRoleNotFound = errors.New("profile role not found")
|
||||
|
||||
// RoleRepository provides access to profile_roles (roles for profiles).
|
||||
type RoleRepository interface {
|
||||
FindByID(ctx context.Context, id uuid.UUID) (*Role, error)
|
||||
FindAll(ctx context.Context) ([]*Role, error)
|
||||
List(ctx context.Context, limit, offset int) ([]*Role, error)
|
||||
Create(ctx context.Context, role *Role) error
|
||||
Update(ctx context.Context, role *Role) error
|
||||
Delete(ctx context.Context, id uuid.UUID) error
|
||||
}
|
||||
6
internal/domain/profile/skill.go
Normal file
6
internal/domain/profile/skill.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package profile
|
||||
|
||||
type Skill struct {
|
||||
SkillName string
|
||||
Level string
|
||||
}
|
||||
Reference in New Issue
Block a user