feat: add candidate profile, questionnaire and company forms

This commit is contained in:
TakuyaYagam1 committed 2026-10-07 16:07:02 +03:00
1 parent 3a61a8e8bb
commit f81cd0ae09
68 files changed
+9517 -54

No files matched your search

@@ -0,0 +1,42 @@
//go:build e2e
package postgres
import (
"testing"
"time"
"lincodex/backend/internal/domain"
)
func TestIsCompanyFixtureEmployerRequiresVerifiedSyntheticEmployer(t *testing.T) {
verifiedAt := time.Date(2026, time.October, 7, 12, 0, 0, 0, time.UTC)
tests := []struct {
name string
email string
scenario domain.Scenario
verified bool
want bool
}{
{name: "verified fixture employer", email: "company-abcdef12@example.test", scenario: domain.ScenarioEmployer, verified: true, want: true},
{name: "unverified employer", email: "company-abcdef12@example.test", scenario: domain.ScenarioEmployer},
{name: "candidate account", email: "company-abcdef12@example.test", scenario: domain.ScenarioCandidate, verified: true},
{name: "ordinary employer", email: "employer@example.test", scenario: domain.ScenarioEmployer, verified: true},
{name: "fixture-like address with wrong suffix", email: "company-abcdef12@example.org", scenario: domain.ScenarioEmployer, verified: true},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
address, err := domain.NewEmailAddress(test.email)
if err != nil {
t.Fatalf("NewEmailAddress() error = %v", err)
}
user := domain.User{Email: address, Scenario: test.scenario}
if test.verified {
user.EmailVerifiedAt = &verifiedAt
}
if got := isCompanyFixtureEmployer(user); got != test.want {
t.Fatalf("isCompanyFixtureEmployer() = %t, want %t", got, test.want)
}
})
}
}