// Code generated by sqlc. DO NOT EDIT.
// versions:
//   sqlc v1.17.2

package db

import (
	"database/sql/driver"
	"encoding/json"
	"fmt"
	"time"

	"github.com/google/uuid"
)

type InboxType string

const (
	InboxTypeCandidate InboxType = "candidate"
	InboxTypeRecruiter InboxType = "recruiter"
)

func (e *InboxType) Scan(src interface{}) error {
	switch s := src.(type) {
	case []byte:
		*e = InboxType(s)
	case string:
		*e = InboxType(s)
	default:
		return fmt.Errorf("unsupported scan type for InboxType: %T", src)
	}
	return nil
}

type NullInboxType struct {
	InboxType InboxType
	Valid     bool // Valid is true if InboxType is not NULL
}

// Scan implements the Scanner interface.
func (ns *NullInboxType) Scan(value interface{}) error {
	if value == nil {
		ns.InboxType, ns.Valid = "", false
		return nil
	}
	ns.Valid = true
	return ns.InboxType.Scan(value)
}

// Value implements the driver Valuer interface.
func (ns NullInboxType) Value() (driver.Value, error) {
	if !ns.Valid {
		return nil, nil
	}
	return string(ns.InboxType), nil
}

type JobInterest string

const (
	JobInterestInterested    JobInterest = "interested"
	JobInterestNotInterested JobInterest = "not_interested"
	JobInterestSaved         JobInterest = "saved"
)

func (e *JobInterest) Scan(src interface{}) error {
	switch s := src.(type) {
	case []byte:
		*e = JobInterest(s)
	case string:
		*e = JobInterest(s)
	default:
		return fmt.Errorf("unsupported scan type for JobInterest: %T", src)
	}
	return nil
}

type NullJobInterest struct {
	JobInterest JobInterest
	Valid       bool // Valid is true if JobInterest is not NULL
}

// Scan implements the Scanner interface.
func (ns *NullJobInterest) Scan(value interface{}) error {
	if value == nil {
		ns.JobInterest, ns.Valid = "", false
		return nil
	}
	ns.Valid = true
	return ns.JobInterest.Scan(value)
}

// Value implements the driver Valuer interface.
func (ns NullJobInterest) Value() (driver.Value, error) {
	if !ns.Valid {
		return nil, nil
	}
	return string(ns.JobInterest), nil
}

type AuthUser struct {
	ID    uuid.UUID `json:"id"`
	Email string    `json:"email"`
}

type CandidateCompanyInbound struct {
	CandidateEmail string        `json:"candidate_email"`
	CandidateID    uuid.NullUUID `json:"candidate_id"`
	CompanyID      uuid.UUID     `json:"company_id"`
	RecruiterID    uuid.NullUUID `json:"recruiter_id"`
	TemplateID     uuid.UUID     `json:"template_id"`
	JobID          uuid.NullUUID `json:"job_id"`
	CreatedAt      time.Time     `json:"created_at"`
	UpdatedAt      time.Time     `json:"updated_at"`
}

type CandidateJobCount struct {
	CandidateID uuid.NullUUID `json:"candidate_id"`
	NumJobs     int64         `json:"num_jobs"`
}

type CandidateJobCountUnverified struct {
	UserID  uuid.UUID `json:"user_id"`
	NumJobs int64     `json:"num_jobs"`
}

type CandidateJobInterest struct {
	CandidateID uuid.UUID   `json:"candidate_id"`
	JobID       uuid.UUID   `json:"job_id"`
	Interest    JobInterest `json:"interest"`
	CreatedAt   time.Time   `json:"created_at"`
	UpdatedAt   time.Time   `json:"updated_at"`
}

type CandidateOauthToken struct {
	UserID    uuid.UUID       `json:"user_id"`
	Email     string          `json:"email"`
	Provider  string          `json:"provider"`
	Token     json.RawMessage `json:"token"`
	IsValid   bool            `json:"is_valid"`
	CreatedAt time.Time       `json:"created_at"`
	UpdatedAt time.Time       `json:"updated_at"`
}

type Company struct {
	CompanyID   uuid.UUID `json:"company_id"`
	CompanyName string    `json:"company_name"`
	Website     string    `json:"website"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

type Job struct {
	JobID          uuid.UUID `json:"job_id"`
	Title          string    `json:"title"`
	DescriptionUrl string    `json:"description_url"`
	RecruiterID    uuid.UUID `json:"recruiter_id"`
	CompanyID      uuid.UUID `json:"company_id"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
}

type JobCandidateCount struct {
	JobID         uuid.NullUUID `json:"job_id"`
	NumCandidates int64         `json:"num_candidates"`
}

type OutboundTemplateRecipientCount struct {
	TemplateID    uuid.NullUUID `json:"template_id"`
	NumRecipients int64         `json:"num_recipients"`
}

type Recruiter struct {
	UserID        uuid.UUID       `json:"user_id"`
	Email         string          `json:"email"`
	FirstName     string          `json:"first_name"`
	LastName      string          `json:"last_name"`
	EmailSettings json.RawMessage `json:"email_settings"`
	Responses     json.RawMessage `json:"responses"`
	CompanyID     uuid.UUID       `json:"company_id"`
	CreatedAt     time.Time       `json:"created_at"`
	UpdatedAt     time.Time       `json:"updated_at"`
}

type RecruiterOauthToken struct {
	UserID    uuid.UUID       `json:"user_id"`
	Email     string          `json:"email"`
	Provider  string          `json:"provider"`
	Token     json.RawMessage `json:"token"`
	IsValid   bool            `json:"is_valid"`
	CreatedAt time.Time       `json:"created_at"`
	UpdatedAt time.Time       `json:"updated_at"`
}

type RecruiterOutboundMessage struct {
	RecruiterID       uuid.UUID     `json:"recruiter_id"`
	MessageID         string        `json:"message_id"`
	InternalMessageID string        `json:"internal_message_id"`
	FromEmail         string        `json:"from_email"`
	ToEmail           string        `json:"to_email"`
	SentAt            time.Time     `json:"sent_at"`
	TemplateID        uuid.NullUUID `json:"template_id"`
	CreatedAt         time.Time     `json:"created_at"`
	UpdatedAt         time.Time     `json:"updated_at"`
}

type RecruiterOutboundTemplate struct {
	TemplateID        uuid.UUID       `json:"template_id"`
	RecruiterID       uuid.UUID       `json:"recruiter_id"`
	JobID             uuid.NullUUID   `json:"job_id"`
	Subject           string          `json:"subject"`
	Body              string          `json:"body"`
	NormalizedContent string          `json:"normalized_content"`
	Metadata          json.RawMessage `json:"metadata"`
	CreatedAt         time.Time       `json:"created_at"`
	UpdatedAt         time.Time       `json:"updated_at"`
}

type UserEmailJob struct {
	JobID         uuid.UUID       `json:"job_id"`
	UserID        uuid.UUID       `json:"user_id"`
	UserEmail     string          `json:"user_email"`
	EmailThreadID string          `json:"email_thread_id"`
	EmailedAt     time.Time       `json:"emailed_at"`
	Company       string          `json:"company"`
	JobTitle      string          `json:"job_title"`
	Data          json.RawMessage `json:"data"`
	CreatedAt     time.Time       `json:"created_at"`
	UpdatedAt     time.Time       `json:"updated_at"`
}

type UserEmailStat struct {
	UserID    uuid.UUID `json:"user_id"`
	Email     string    `json:"email"`
	StatID    string    `json:"stat_id"`
	StatValue int32     `json:"stat_value"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type UserEmailSyncHistory struct {
	UserID    uuid.UUID `json:"user_id"`
	InboxType InboxType `json:"inbox_type"`
	Email     string    `json:"email"`
	HistoryID int64     `json:"history_id"`
	SyncedAt  time.Time `json:"synced_at"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type UserOauthToken struct {
	UserID    uuid.UUID       `json:"user_id"`
	Email     string          `json:"email"`
	Provider  string          `json:"provider"`
	Token     json.RawMessage `json:"token"`
	IsValid   bool            `json:"is_valid"`
	CreatedAt time.Time       `json:"created_at"`
	UpdatedAt time.Time       `json:"updated_at"`
}

type UserProfile struct {
	UserID         uuid.UUID `json:"user_id"`
	Email          string    `json:"email"`
	FirstName      string    `json:"first_name"`
	LastName       string    `json:"last_name"`
	IsActive       bool      `json:"is_active"`
	AutoArchive    bool      `json:"auto_archive"`
	AutoContribute bool      `json:"auto_contribute"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
}

type VwJobBoard struct {
	UserID            uuid.NullUUID   `json:"user_id"`
	UserEmail         string          `json:"user_email"`
	JobID             uuid.UUID       `json:"job_id"`
	JobTitle          string          `json:"job_title"`
	JobDescriptionUrl string          `json:"job_description_url"`
	JobInterest       NullJobInterest `json:"job_interest"`
	CompanyName       string          `json:"company_name"`
	CompanyWebsite    string          `json:"company_website"`
	RecruiterName     interface{}     `json:"recruiter_name"`
	RecruiterEmail    string          `json:"recruiter_email"`
	EmailedAt         time.Time       `json:"emailed_at"`
	IsVerified        bool            `json:"is_verified"`
}

type Waitlist struct {
	UserID           uuid.UUID       `json:"user_id"`
	Email            string          `json:"email"`
	FirstName        string          `json:"first_name"`
	LastName         string          `json:"last_name"`
	LinkedinUrl      string          `json:"linkedin_url"`
	Responses        json.RawMessage `json:"responses"`
	CanCreateAccount bool            `json:"can_create_account"`
	CreatedAt        time.Time       `json:"created_at"`
	UpdatedAt        time.Time       `json:"updated_at"`
}
