Skip to content

Commit 3a357a9

Browse files
fix: adjusts the recurrence color when creating an medical shift
1 parent 488ea22 commit 3a357a9

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

app/operations/medical_shift_recurrences/create.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ def shift_attributes(date)
6060
hospital_name: medical_shift_recurrence.hospital_name,
6161
amount_cents: medical_shift_recurrence.amount_cents,
6262
medical_shift_recurrence_id: medical_shift_recurrence.id,
63-
paid: false
63+
paid: false,
64+
color: medical_shift_recurrence.color
6465
}
6566
end
6667

config/locales/en/activerecord.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
en:
2+
activerecord:
3+
models:
4+
medical_shift_recurrence: "Medical Shift Recurrence"
5+
medical_shift: "Medical Shift"
6+
attributes:
7+
medical_shift_recurrence:
8+
day_of_week: "Day of week"
9+
frequency: "Frequency"
10+
start_date: "Start date"
11+
workload: "Workload"
12+
start_hour: "Start hour"
13+
hospital_name: "Hospital name"
14+
amount_cents: "Amount"
15+
color: "Color"
16+
day_of_month: "Day of month"
17+
end_date: "End date"
18+
errors:
19+
models:
20+
medical_shift_recurrence:
21+
attributes:
22+
day_of_week:
23+
blank: "can't be blank"
24+
not_a_number: "is not a number"
25+
greater_than_or_equal_to: "must be greater than or equal to %{count}"
26+
less_than_or_equal_to: "must be less than or equal to %{count}"
27+
medical_shift:
28+
color: "Color"
29+
hospital_name: "Hospital name"
30+
workload: "Workload"
31+
start_date: "Start date"
32+
start_hour: "Start hour"
33+
amount_cents: "Amount"
34+
paid: "Paid"

spec/operations/medical_shift_recurrences/create_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
expect(shift.hospital_name).to eq("Hospital Teste")
6666
expect(shift.amount_cents).to eq(120_000)
6767
expect(shift.paid).to be false
68+
expect(shift.color).to eq("#ffffff")
6869
end
6970
end
7071
end

0 commit comments

Comments
 (0)