Skip to content

Commit b299178

Browse files
committed
misc
1 parent d84f474 commit b299178

File tree

12 files changed

+95
-12
lines changed

12 files changed

+95
-12
lines changed

lib/algora/accounts/schemas/user.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ defmodule Algora.Accounts.User do
127127
field :email_recipients, {:array, :map}, default: []
128128
field :language_contributions_synced, :boolean, default: false
129129
field :repo_contributions_synced, :boolean, default: false
130+
field :linkedin_url_attempted, :boolean, default: false
130131

131132
# Work arrangement preferences
132133
field :open_to_remote, :boolean, default: false

lib/algora/interviews/schemas/job_interview.ex

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ defmodule Algora.Interviews.JobInterview do
44

55
import Ecto.Changeset
66

7+
@interview_statuses [:initial, :ongoing, :passed, :failed, :withdrawn]
8+
79
typed_schema "job_interviews" do
8-
field :status, Ecto.Enum, values: [:scheduled, :completed, :cancelled, :no_show]
10+
field :status, Ecto.Enum, values: @interview_statuses
11+
912
field :notes, :string
1013
field :scheduled_at, :utc_datetime_usec
1114
field :completed_at, :utc_datetime_usec
@@ -20,7 +23,7 @@ defmodule Algora.Interviews.JobInterview do
2023
job_interview
2124
|> cast(attrs, [:user_id, :job_posting_id, :status, :notes, :scheduled_at, :completed_at])
2225
|> validate_required([:user_id, :job_posting_id, :status])
23-
|> validate_inclusion(:status, [:scheduled, :completed, :cancelled, :no_show])
26+
|> validate_inclusion(:status, @interview_statuses)
2427
|> foreign_key_constraint(:user_id)
2528
|> foreign_key_constraint(:job_posting_id)
2629
|> generate_id()

lib/algora/jobs/schemas/job_posting.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ defmodule Algora.Jobs.JobPosting do
3535
field :location_iso_lvl4, :string
3636
field :location_types, {:array, Ecto.Enum}, values: [:remote, :hybrid, :onsite]
3737
field :locations, {:array, :string}, default: []
38+
field :states, {:array, :string}, default: []
3839

3940
belongs_to :user, User, null: false
4041
has_many :interviews, Algora.Interviews.JobInterview, foreign_key: :job_posting_id
@@ -71,7 +72,8 @@ defmodule Algora.Jobs.JobPosting do
7172
:location_types,
7273
:locations,
7374
:min_compensation,
74-
:max_compensation
75+
:max_compensation,
76+
:states
7577
])
7678
|> generate_id()
7779
|> validate_required([:url, :company_name, :company_url, :email])

lib/algora/organizations/organizations.ex

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,7 @@ defmodule Algora.Organizations do
142142
Map.merge(
143143
%{
144144
display_name: org_name,
145-
bio:
146-
get_in(metadata, [:bio]) || get_in(metadata, [:og_description]) ||
147-
get_in(metadata, [:og_title]),
145+
bio: get_in(metadata, [:bio]) || get_in(metadata, [:og_description]) || get_in(metadata, [:og_title]),
148146
avatar_url: get_in(metadata, [:avatar_url]) || get_in(metadata, [:favicon_url]),
149147
handle: org_handle,
150148
domain: domain,

lib/algora/shared/money_utils.ex

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,24 @@ defmodule Algora.MoneyUtils do
33
def fmt_precise(money), do: Money.to_string(money, no_fraction_if_integer: false)
44
def fmt_precise!(money), do: Money.to_string!(money, no_fraction_if_integer: false)
55

6+
def fmt_compact(nil), do: nil
7+
68
def fmt_compact(money) do
7-
money
8-
|> Money.to_string!(no_fraction_if_integer: true)
9-
|> String.replace(",000,000", "M")
10-
|> String.replace(",000", "k")
9+
amount = Algora.Util.format_number_compact(money.amount)
10+
11+
case money.currency do
12+
:USD ->
13+
"$" <> amount
14+
15+
:EUR ->
16+
"€" <> amount
17+
18+
:GBP ->
19+
"£" <> amount
20+
21+
_ ->
22+
to_string(money.currency) <> " " <> amount
23+
end
1124
end
1225

1326
@spec split_evenly(Money.t(), non_neg_integer()) :: [Money.t()]

lib/algora/shared/util.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,6 @@ defmodule Algora.Util do
288288
def to_local_string(datetime) do
289289
datetime
290290
|> DateTime.shift_zone!("Europe/Athens", Tzdata.TimeZoneDatabase)
291-
|> Calendar.strftime("%Y-%m-%d %H:%M:%S EEST")
291+
|> Calendar.strftime("%Y-%m-%d %H:%M:%S")
292292
end
293293
end

lib/algora_web/components/ui/badge.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ defmodule AlgoraWeb.Components.UI.Badge do
4242
@variants %{
4343
variant: %{
4444
"default" => "bg-accent/10 text-accent-foreground border-accent-foreground/20",
45-
"secondary" => "bg-secondary/10 text-secondary border-secondary/20",
45+
"secondary" => "bg-secondary/80 text-secondary-foreground border-secondary-foreground/20",
4646
"destructive" => "bg-destructive/10 text-destructive border-destructive/20",
4747
"success" => "bg-success/10 text-success border-success/20",
4848
"warning" => "bg-warning/10 text-warning border-warning/20",
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
defmodule Algora.Repo.Migrations.CreateReplies do
2+
use Ecto.Migration
3+
4+
def change do
5+
create table(:replies, primary_key: false) do
6+
add :id, :string, primary_key: true
7+
add :from_email, :string, null: false
8+
add :from_name, :string
9+
add :to_email, :string, null: false
10+
add :subject, :string, null: false
11+
add :message_id, :string, null: false
12+
add :in_reply_to, :string
13+
add :references, :string
14+
add :original_body_text, :text
15+
add :original_body_html, :text
16+
add :reply_body_text, :text
17+
add :status, :string, default: "pending", null: false
18+
19+
timestamps()
20+
end
21+
22+
create index(:replies, [:status])
23+
create index(:replies, [:from_email])
24+
create index(:replies, [:inserted_at])
25+
create unique_index(:replies, [:message_id])
26+
end
27+
end
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
defmodule Algora.Repo.Migrations.AddAiFlagsToReplies do
2+
use Ecto.Migration
3+
4+
def change do
5+
alter table(:replies) do
6+
add :interested_in_opportunities, :string
7+
add :has_enough_context, :string
8+
add :wants_to_unsubscribe, :string
9+
add :requires_urgent_attention, :string
10+
end
11+
end
12+
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
defmodule Algora.Repo.Migrations.AddAdminNoteToReplies do
2+
use Ecto.Migration
3+
4+
def change do
5+
alter table(:replies) do
6+
add :admin_note, :text
7+
end
8+
end
9+
end

0 commit comments

Comments
 (0)