initial commit

This commit is contained in:
m.zare
2026-04-10 18:25:21 +03:30
commit 77ca6c34a3
263 changed files with 34470 additions and 0 deletions

View 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
}

View File

@@ -0,0 +1,12 @@
package profile
type Contact struct {
Email string
Phone string
SocialLinks []SocialLink
}
type SocialLink struct {
LinkType string
Link string
}

View File

@@ -0,0 +1,5 @@
package profile
import "errors"
var ErrProfileNotFound = errors.New("profile not found")

View 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
}

View 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
}

View File

@@ -0,0 +1,5 @@
package profile
type PageSetting struct {
VisibilityLevel string // enum: public, private, only_me
}

View 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
}

View 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)
}

View 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
}

View 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
}

View File

@@ -0,0 +1,6 @@
package profile
type Skill struct {
SkillName string
Level string
}