Skip to content

Commit 23efe52

Browse files
committed
add equity and funding fields
1 parent 8e5aceb commit 23efe52

File tree

5 files changed

+58
-1
lines changed

5 files changed

+58
-1
lines changed

lib/algora/accounts/schemas/user.ex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ defmodule Algora.Accounts.User do
171171
# Import tracking - identifies the source that imported this user
172172
field :import_source, :string
173173

174+
# Company funding information (for organizations)
175+
field :latest_funding_round, :string
176+
field :amount_raised, Money
177+
field :company_valuation, Money
178+
174179
has_many :identities, Identity
175180
has_many :memberships, Member, foreign_key: :user_id
176181
has_many :members, Member, foreign_key: :org_id

lib/algora/jobs/schemas/job_posting.ex

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ defmodule Algora.Jobs.JobPosting do
3737
field :locations, {:array, :string}, default: []
3838
field :states, {:array, :string}, default: []
3939

40+
# Equity compensation details
41+
# Percentage-based equity (e.g., 0.25 for 0.25%)
42+
field :min_equity_pct, :decimal
43+
field :max_equity_pct, :decimal
44+
# Money-based equity (actual dollar value)
45+
field :min_equity, Type
46+
field :max_equity, Type
47+
4048
belongs_to :user, User, null: false
4149
has_many :interviews, Algora.Interviews.JobInterview, foreign_key: :job_posting_id
4250
has_many :matches, Algora.Matches.JobMatch, foreign_key: :job_posting_id
@@ -73,7 +81,11 @@ defmodule Algora.Jobs.JobPosting do
7381
:locations,
7482
:min_compensation,
7583
:max_compensation,
76-
:states
84+
:states,
85+
:min_equity_pct,
86+
:max_equity_pct,
87+
:min_equity,
88+
:max_equity
7789
])
7890
|> generate_id()
7991
|> validate_required([:url, :company_name, :company_url, :email])
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
defmodule Algora.Repo.Migrations.AddCompensationFieldsToUsers do
2+
use Ecto.Migration
3+
4+
def change do
5+
alter table(:users) do
6+
# Company funding information
7+
add :latest_funding_round, :string
8+
add :amount_raised, :money_with_currency
9+
add :company_valuation, :money_with_currency
10+
end
11+
end
12+
end
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
defmodule Algora.Repo.Migrations.AddCompensationFieldsToJobPostings do
2+
use Ecto.Migration
3+
4+
def change do
5+
alter table(:job_postings) do
6+
# Equity range (stored as percentages, e.g., 0.25 for 0.25%)
7+
add :min_equity, :decimal, precision: 10, scale: 4
8+
add :max_equity, :decimal, precision: 10, scale: 4
9+
end
10+
end
11+
end
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
defmodule Algora.Repo.Migrations.RenameEquityAndAddMoneyEquityToJobPostings do
2+
use Ecto.Migration
3+
4+
def change do
5+
# Rename existing decimal equity columns to _pct suffix
6+
# These store percentage values like 0.25 for 0.25%
7+
rename table(:job_postings), :min_equity, to: :min_equity_pct
8+
rename table(:job_postings), :max_equity, to: :max_equity_pct
9+
10+
alter table(:job_postings) do
11+
# Add new Money type equity columns
12+
# These store actual money values (e.g., $10,000 worth of equity)
13+
add :min_equity, :money_with_currency
14+
add :max_equity, :money_with_currency
15+
end
16+
end
17+
end

0 commit comments

Comments
 (0)