db

package
v0.0.0-...-628cd94 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 14 Imported by: 13

README

db

db is a Go database client library for SRC. We use sqlc to auto-generate a SQL database client based off predefined queries.

We also manually maintain a http database client that leverages Supabase's auto-generated PostgREST API. In the future, we should be able to auto-generate the http client as well.

Contributing

  1. Install sqlc

  2. Write and name your query in query.sql

  3. Re-generate the /db package

sqlc generate
  1. Manually update the http client in http.go. For information on PostgREST's APIs, checkout their documentation.

SelfDoc

Auto-generated code documentation to make the repository easier to navigate and contribute to.

Last Updated: 2023-05-15

The db directory is for a Go database client library for SRC. It includes a package for interacting with a SQL database, functions for making HTTP requests to interact with the PostgREST API, several structs used to represent data in the SRC database, SQL queries for retrieving and updating user and OAuth token information, and SQL code to create and modify tables, policies, triggers, and functions related to various entities.

Files
db.go

This file contains a Go package that provides an interface for interacting with a SQL database. It includes a struct Queries with prepared SQL statements for various database queries, as well as functions for executing SQL queries and closing prepared statements.

http.go

This file contains functions for making HTTP requests to interact with the PostgREST API, including fetching user profiles, OAuth tokens, and email jobs. It also includes functions for inserting and retrieving recruiter outbound messages and templates.

http_test.go

This file contains unit tests for the db.HTTPQueries struct, which implements the db.Querier interface. The tests include checking that the NewHTTP function correctly initializes the HTTPQueries struct, and that the DoRequest function correctly sends an HTTP request with the specified method, path, and input. Additionally, it contains a test function for the db.NewHTTP function that creates a mock HTTP server and tests the db.DoRequest function by making a request to the mock server and checking the response.

models.go

This file defines several structs used to represent data in the SRC database, including AuthUser, CandidateCompanyInbound, CandidateJobCount, CandidateJobCountUnverified, CandidateJobInterest, CandidateOauthToken, Company, Job, Recruiter, and RecruiterOutboundMessage. It also contains custom types and methods for scanning and handling null values for InboxType and JobInterest in the database.

querier.go

This file contains the querier package, which provides a Querier interface for executing SQL queries against a database. The interface includes methods for querying the database for recruiter and user email jobs, user profiles and OAuth tokens, and inserting recruiter outbound messages and templates. It is generated by sqlc, a tool for generating type-safe Go code from SQL.

query.sql

This file contains SQL queries for retrieving and updating user and OAuth token information, as well as various operations on email job and statistic tables, recruiter outbound message and template tables, and candidate job interest table. It includes queries for selecting, inserting, and deleting data, as well as upserting user OAuth tokens and email sync history.

query.sql.go

This file contains Go code that defines SQL queries and functions for querying and manipulating data in various tables of a PostgreSQL database, including recruiter_outbound_message, user_profile, user_email_stat, user_email_sync_history, and user_oauth_token. The functions take in parameters and return results based on the execution of the SQL queries.

schema.sql

This file contains SQL code to create and modify tables, policies, triggers, and functions related to various entities such as user profiles, recruiters, jobs, and candidate company inbound feature. It also includes views and types. The code enables row level security and real-time updates, restricts access to certain data based on user authentication status and role, and updates timestamps when rows are updated.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthUser

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

type CandidateCompanyInbound

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

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

type CandidateJobCountUnverified

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

type CandidateJobInterest

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

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

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 DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DeleteCandidateJobInterestConditionallyParams

type DeleteCandidateJobInterestConditionallyParams struct {
	CandidateID uuid.UUID   `json:"candidate_id"`
	JobID       uuid.UUID   `json:"job_id"`
	Interest    JobInterest `json:"interest"`
}

type DeleteUserEmailJobByEmailThreadIDParams

type DeleteUserEmailJobByEmailThreadIDParams struct {
	UserEmail     string `json:"user_email"`
	EmailThreadID string `json:"email_thread_id"`
}

type GetRecruiterByEmailRow

type GetRecruiterByEmailRow 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"`
	CompanyID     uuid.UUID       `json:"company_id"`
	CreatedAt     time.Time       `json:"created_at"`
	UpdatedAt     time.Time       `json:"updated_at"`
}

type GetRecruiterOutboundMessageByRecipientParams

type GetRecruiterOutboundMessageByRecipientParams struct {
	ToEmail           string `json:"to_email"`
	InternalMessageID string `json:"internal_message_id"`
}

type GetRecruiterOutboundMessageParams

type GetRecruiterOutboundMessageParams struct {
	RecruiterID uuid.UUID `json:"recruiter_id"`
	MessageID   string    `json:"message_id"`
}

type GetUserEmailJobByThreadIDParams

type GetUserEmailJobByThreadIDParams struct {
	UserEmail     string `json:"user_email"`
	EmailThreadID string `json:"email_thread_id"`
}

type GetUserEmailSyncHistoryParams

type GetUserEmailSyncHistoryParams struct {
	UserID    uuid.UUID `json:"user_id"`
	InboxType InboxType `json:"inbox_type"`
	Email     string    `json:"email"`
}

type GetUserOAuthTokenParams

type GetUserOAuthTokenParams struct {
	UserID   uuid.UUID `json:"user_id"`
	Email    string    `json:"email"`
	Provider string    `json:"provider"`
}

type HTTPQueries

type HTTPQueries struct {

	// URL is the Base URL of the PostgREST API
	URL string
	// APIKey is the API Key for the PostgREST API
	APIKey string
	// Debug enables debug logging
	Debug bool
	// contains filtered or unexported fields
}

HTTPQueries is a client for the PostgREST API

func NewHTTP

func NewHTTP(url, apiKey string) *HTTPQueries

NewHTTP creates a new HTTPQueries.

func (*HTTPQueries) CountUserEmailJobs

func (q *HTTPQueries) CountUserEmailJobs(ctx context.Context, userID uuid.UUID) (int64, error)

CountUserEmailJobs counts the number of user's email jobs.

func (*HTTPQueries) DeleteCandidateJobInterestConditionally

func (q *HTTPQueries) DeleteCandidateJobInterestConditionally(ctx context.Context, arg DeleteCandidateJobInterestConditionallyParams) error

func (*HTTPQueries) DeleteUserEmailJobByEmailThreadID

func (q *HTTPQueries) DeleteUserEmailJobByEmailThreadID(ctx context.Context, arg DeleteUserEmailJobByEmailThreadIDParams) error

DeleteUserEmailJobByEmailThreadID deletes a user's email job by email thread ID.

func (*HTTPQueries) DoRequest

func (q *HTTPQueries) DoRequest(ctx context.Context, method, path string, body io.Reader) (*http.Response, error)

DoRequest performs a request to the PostgREST API.

func (*HTTPQueries) GetRecruiterByEmail

func (q *HTTPQueries) GetRecruiterByEmail(ctx context.Context, email string) (GetRecruiterByEmailRow, error)

GetRecruiterByEmail fetches a recruiter profile given their email

func (*HTTPQueries) GetRecruiterOutboundMessage

func (q *HTTPQueries) GetRecruiterOutboundMessage(ctx context.Context, arg GetRecruiterOutboundMessageParams) (RecruiterOutboundMessage, error)

GetRecruiterOutboundMessage fetches a recruiter's outbound message by message ID

func (*HTTPQueries) GetRecruiterOutboundMessageByRecipient

func (q *HTTPQueries) GetRecruiterOutboundMessageByRecipient(ctx context.Context, arg GetRecruiterOutboundMessageByRecipientParams) (RecruiterOutboundMessage, error)

GetRecruiterOutboundMessageByRecipient fetches a recruiter's outbound message by message ID

func (*HTTPQueries) GetRecruiterOutboundTemplate

func (q *HTTPQueries) GetRecruiterOutboundTemplate(ctx context.Context, templateID uuid.UUID) (RecruiterOutboundTemplate, error)

func (*HTTPQueries) GetUserEmailJob

func (q *HTTPQueries) GetUserEmailJob(ctx context.Context, jobID uuid.UUID) (UserEmailJob, error)

GetUserEmailJob fetches a user's email job by job ID

func (*HTTPQueries) GetUserEmailJobByThreadID

func (q *HTTPQueries) GetUserEmailJobByThreadID(ctx context.Context, arg GetUserEmailJobByThreadIDParams) (UserEmailJob, error)

GetUserEmailJobByThreadID fetches a user's email job by user email and thread ID

func (*HTTPQueries) GetUserEmailSyncHistory

func (q *HTTPQueries) GetUserEmailSyncHistory(ctx context.Context, arg GetUserEmailSyncHistoryParams) (UserEmailSyncHistory, error)

GetUserEmailSyncHistory fetches a user's email sync history.

func (*HTTPQueries) GetUserOAuthToken

func (q *HTTPQueries) GetUserOAuthToken(ctx context.Context, arg GetUserOAuthTokenParams) (UserOauthToken, error)

GetUserOAuthToken fetches a user's oauth token.

func (*HTTPQueries) GetUserProfileByEmail

func (q *HTTPQueries) GetUserProfileByEmail(ctx context.Context, email string) (UserProfile, error)

GetUserProfileByEmail fetches a user profile by email.

func (*HTTPQueries) IncrementUserEmailStat

func (q *HTTPQueries) IncrementUserEmailStat(ctx context.Context, arg IncrementUserEmailStatParams) error

IncrementUserEmailStat increments a user's email stat.

func (*HTTPQueries) InsertRecruiterOutboundMessage

func (q *HTTPQueries) InsertRecruiterOutboundMessage(ctx context.Context, arg InsertRecruiterOutboundMessageParams) error

InsertRecruiterOutboundMessage inserts a recruiter's outbound message

func (*HTTPQueries) InsertRecruiterOutboundTemplate

func (q *HTTPQueries) InsertRecruiterOutboundTemplate(ctx context.Context, arg InsertRecruiterOutboundTemplateParams) (RecruiterOutboundTemplate, error)

InsertRecruiterOutboundTemplate inserts a recruiter's outbound template

func (*HTTPQueries) InsertUserEmailJob

func (q *HTTPQueries) InsertUserEmailJob(ctx context.Context, arg InsertUserEmailJobParams) error

InsertUserEmailJob inserts a user's email job.

func (*HTTPQueries) ListCandidateOAuthTokens

func (q *HTTPQueries) ListCandidateOAuthTokens(ctx context.Context, arg ListCandidateOAuthTokensParams) ([]CandidateOauthToken, error)

ListCandidateOAuthTokens lists a user oauth tokens.

func (*HTTPQueries) ListRecruiterOAuthTokens

func (q *HTTPQueries) ListRecruiterOAuthTokens(ctx context.Context, arg ListRecruiterOAuthTokensParams) ([]RecruiterOauthToken, error)

ListRecruiterOAuthTokens lists a user oauth tokens.

func (*HTTPQueries) ListUserEmailJobs

func (q *HTTPQueries) ListUserEmailJobs(ctx context.Context, arg ListUserEmailJobsParams) ([]UserEmailJob, error)

ListUserEmailJobs lists a user's email jobs.

func (*HTTPQueries) ListUserOAuthTokens

func (q *HTTPQueries) ListUserOAuthTokens(ctx context.Context, arg ListUserOAuthTokensParams) ([]UserOauthToken, error)

ListUserOAuthTokens lists a user oauth tokens.

func (*HTTPQueries) UpsertCandidateJobInterest

func (q *HTTPQueries) UpsertCandidateJobInterest(ctx context.Context, arg UpsertCandidateJobInterestParams) error

UpsertCandidateJobInterest upserts a candidate's job interest

func (*HTTPQueries) UpsertUserEmailSyncHistory

func (q *HTTPQueries) UpsertUserEmailSyncHistory(ctx context.Context, arg UpsertUserEmailSyncHistoryParams) error

UpsertUserEmailSyncHistory upserts a user's email sync history.

func (*HTTPQueries) UpsertUserOAuthToken

func (q *HTTPQueries) UpsertUserOAuthToken(ctx context.Context, arg UpsertUserOAuthTokenParams) error

UpsertUserOAuthToken

type InboxType

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

func (*InboxType) Scan

func (e *InboxType) Scan(src interface{}) error

type IncrementUserEmailStatParams

type IncrementUserEmailStatParams struct {
	UserID    uuid.UUID `json:"user_id"`
	Email     string    `json:"email"`
	StatID    string    `json:"stat_id"`
	StatValue int32     `json:"stat_value"`
}

type InsertRecruiterOutboundMessageParams

type InsertRecruiterOutboundMessageParams 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"`
}

type InsertRecruiterOutboundTemplateParams

type InsertRecruiterOutboundTemplateParams struct {
	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"`
}

type InsertUserEmailJobParams

type InsertUserEmailJobParams struct {
	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"`
}

type Job

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

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

type JobInterest

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

func (*JobInterest) Scan

func (e *JobInterest) Scan(src interface{}) error

type ListCandidateOAuthTokensParams

type ListCandidateOAuthTokensParams struct {
	Provider string `json:"provider"`
	IsValid  bool   `json:"is_valid"`
	Limit    int32  `json:"limit"`
	Offset   int32  `json:"offset"`
}

type ListRecruiterOAuthTokensParams

type ListRecruiterOAuthTokensParams struct {
	Provider string `json:"provider"`
	IsValid  bool   `json:"is_valid"`
	Limit    int32  `json:"limit"`
	Offset   int32  `json:"offset"`
}

type ListSimilarRecruiterOutboundTemplatesParams

type ListSimilarRecruiterOutboundTemplatesParams struct {
	Input  string    `json:"input"`
	UserID uuid.UUID `json:"user_id"`
}

type ListSimilarRecruiterOutboundTemplatesRow

type ListSimilarRecruiterOutboundTemplatesRow 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"`
	Metadata    json.RawMessage `json:"metadata"`
	CreatedAt   time.Time       `json:"created_at"`
	UpdatedAt   time.Time       `json:"updated_at"`
	Similarity  float32         `json:"similarity"`
}

type ListUserEmailJobsParams

type ListUserEmailJobsParams struct {
	UserID uuid.UUID `json:"user_id"`
	Limit  int32     `json:"limit"`
	Offset int32     `json:"offset"`
}

type ListUserOAuthTokensParams

type ListUserOAuthTokensParams struct {
	Provider string `json:"provider"`
	IsValid  bool   `json:"is_valid"`
	Limit    int32  `json:"limit"`
	Offset   int32  `json:"offset"`
}

type NullInboxType

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

func (*NullInboxType) Scan

func (ns *NullInboxType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullInboxType) Value

func (ns NullInboxType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullJobInterest

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

func (*NullJobInterest) Scan

func (ns *NullJobInterest) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullJobInterest) Value

func (ns NullJobInterest) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type OutboundTemplateRecipientCount

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

type Querier

type Querier interface {
	CountUserEmailJobs(ctx context.Context, userID uuid.UUID) (int64, error)
	DeleteCandidateJobInterestConditionally(ctx context.Context, arg DeleteCandidateJobInterestConditionallyParams) error
	DeleteUserEmailJobByEmailThreadID(ctx context.Context, arg DeleteUserEmailJobByEmailThreadIDParams) error
	GetRecruiterByEmail(ctx context.Context, email string) (GetRecruiterByEmailRow, error)
	GetRecruiterOutboundMessage(ctx context.Context, arg GetRecruiterOutboundMessageParams) (RecruiterOutboundMessage, error)
	GetRecruiterOutboundMessageByRecipient(ctx context.Context, arg GetRecruiterOutboundMessageByRecipientParams) (RecruiterOutboundMessage, error)
	GetRecruiterOutboundTemplate(ctx context.Context, templateID uuid.UUID) (RecruiterOutboundTemplate, error)
	GetUserEmailJob(ctx context.Context, jobID uuid.UUID) (UserEmailJob, error)
	GetUserEmailJobByThreadID(ctx context.Context, arg GetUserEmailJobByThreadIDParams) (UserEmailJob, error)
	GetUserEmailSyncHistory(ctx context.Context, arg GetUserEmailSyncHistoryParams) (UserEmailSyncHistory, error)
	GetUserOAuthToken(ctx context.Context, arg GetUserOAuthTokenParams) (UserOauthToken, error)
	GetUserProfileByEmail(ctx context.Context, email string) (UserProfile, error)
	IncrementUserEmailStat(ctx context.Context, arg IncrementUserEmailStatParams) error
	InsertRecruiterOutboundMessage(ctx context.Context, arg InsertRecruiterOutboundMessageParams) error
	InsertRecruiterOutboundTemplate(ctx context.Context, arg InsertRecruiterOutboundTemplateParams) (RecruiterOutboundTemplate, error)
	InsertUserEmailJob(ctx context.Context, arg InsertUserEmailJobParams) error
	ListCandidateOAuthTokens(ctx context.Context, arg ListCandidateOAuthTokensParams) ([]CandidateOauthToken, error)
	ListRecruiterOAuthTokens(ctx context.Context, arg ListRecruiterOAuthTokensParams) ([]RecruiterOauthToken, error)
	ListSimilarRecruiterOutboundTemplates(ctx context.Context, arg ListSimilarRecruiterOutboundTemplatesParams) ([]ListSimilarRecruiterOutboundTemplatesRow, error)
	ListUserEmailJobs(ctx context.Context, arg ListUserEmailJobsParams) ([]UserEmailJob, error)
	ListUserOAuthTokens(ctx context.Context, arg ListUserOAuthTokensParams) ([]UserOauthToken, error)
	UpsertCandidateJobInterest(ctx context.Context, arg UpsertCandidateJobInterestParams) error
	UpsertUserEmailSyncHistory(ctx context.Context, arg UpsertUserEmailSyncHistoryParams) error
	UpsertUserOAuthToken(ctx context.Context, arg UpsertUserOAuthTokenParams) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func Prepare

func Prepare(ctx context.Context, db DBTX) (*Queries, error)

func (*Queries) Close

func (q *Queries) Close() error

func (*Queries) CountUserEmailJobs

func (q *Queries) CountUserEmailJobs(ctx context.Context, userID uuid.UUID) (int64, error)

func (*Queries) DeleteCandidateJobInterestConditionally

func (q *Queries) DeleteCandidateJobInterestConditionally(ctx context.Context, arg DeleteCandidateJobInterestConditionallyParams) error

func (*Queries) DeleteUserEmailJobByEmailThreadID

func (q *Queries) DeleteUserEmailJobByEmailThreadID(ctx context.Context, arg DeleteUserEmailJobByEmailThreadIDParams) error

func (*Queries) GetRecruiterByEmail

func (q *Queries) GetRecruiterByEmail(ctx context.Context, email string) (GetRecruiterByEmailRow, error)

func (*Queries) GetRecruiterOutboundMessage

func (q *Queries) GetRecruiterOutboundMessage(ctx context.Context, arg GetRecruiterOutboundMessageParams) (RecruiterOutboundMessage, error)

func (*Queries) GetRecruiterOutboundTemplate

func (q *Queries) GetRecruiterOutboundTemplate(ctx context.Context, templateID uuid.UUID) (RecruiterOutboundTemplate, error)

func (*Queries) GetUserEmailJob

func (q *Queries) GetUserEmailJob(ctx context.Context, jobID uuid.UUID) (UserEmailJob, error)

func (*Queries) GetUserEmailJobByThreadID

func (q *Queries) GetUserEmailJobByThreadID(ctx context.Context, arg GetUserEmailJobByThreadIDParams) (UserEmailJob, error)

func (*Queries) GetUserEmailSyncHistory

func (q *Queries) GetUserEmailSyncHistory(ctx context.Context, arg GetUserEmailSyncHistoryParams) (UserEmailSyncHistory, error)

func (*Queries) GetUserOAuthToken

func (q *Queries) GetUserOAuthToken(ctx context.Context, arg GetUserOAuthTokenParams) (UserOauthToken, error)

func (*Queries) GetUserProfileByEmail

func (q *Queries) GetUserProfileByEmail(ctx context.Context, email string) (UserProfile, error)

func (*Queries) IncrementUserEmailStat

func (q *Queries) IncrementUserEmailStat(ctx context.Context, arg IncrementUserEmailStatParams) error

func (*Queries) InsertRecruiterOutboundMessage

func (q *Queries) InsertRecruiterOutboundMessage(ctx context.Context, arg InsertRecruiterOutboundMessageParams) error

func (*Queries) InsertUserEmailJob

func (q *Queries) InsertUserEmailJob(ctx context.Context, arg InsertUserEmailJobParams) error

func (*Queries) ListCandidateOAuthTokens

func (q *Queries) ListCandidateOAuthTokens(ctx context.Context, arg ListCandidateOAuthTokensParams) ([]CandidateOauthToken, error)

func (*Queries) ListRecruiterOAuthTokens

func (q *Queries) ListRecruiterOAuthTokens(ctx context.Context, arg ListRecruiterOAuthTokensParams) ([]RecruiterOauthToken, error)

func (*Queries) ListUserEmailJobs

func (q *Queries) ListUserEmailJobs(ctx context.Context, arg ListUserEmailJobsParams) ([]UserEmailJob, error)

func (*Queries) ListUserOAuthTokens

func (q *Queries) ListUserOAuthTokens(ctx context.Context, arg ListUserOAuthTokensParams) ([]UserOauthToken, error)

func (*Queries) UpsertCandidateJobInterest

func (q *Queries) UpsertCandidateJobInterest(ctx context.Context, arg UpsertCandidateJobInterestParams) error

func (*Queries) UpsertUserEmailSyncHistory

func (q *Queries) UpsertUserEmailSyncHistory(ctx context.Context, arg UpsertUserEmailSyncHistoryParams) error

func (*Queries) UpsertUserOAuthToken

func (q *Queries) UpsertUserOAuthToken(ctx context.Context, arg UpsertUserOAuthTokenParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type Recruiter

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

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

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

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 UpsertCandidateJobInterestParams

type UpsertCandidateJobInterestParams struct {
	CandidateID uuid.UUID   `json:"candidate_id"`
	JobID       uuid.UUID   `json:"job_id"`
	Interest    JobInterest `json:"interest"`
}

type UpsertUserEmailSyncHistoryParams

type UpsertUserEmailSyncHistoryParams 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"`
}

type UpsertUserOAuthTokenParams

type UpsertUserOAuthTokenParams 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"`
}

type UserEmailJob

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

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

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

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

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

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

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"`
}

Jump to

Keyboard shortcuts

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