Skip to content

Commit 0f45cc8

Browse files
authored
Merge pull request #272 from espoo-dev/fix-rename-payd
Rename all payd names to paid
2 parents ebce6c1 + 8a73da7 commit 0f45cc8

39 files changed

+203
-179
lines changed

app/controllers/api/v1/event_procedures_controller.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ def index
1919

2020
render json: {
2121
total: total_amount_cents.total,
22-
total_payd: total_amount_cents.payd,
23-
total_unpayd: total_amount_cents.unpaid,
22+
total_paid: total_amount_cents.paid,
23+
total_unpaid: total_amount_cents.unpaid,
2424
event_procedures: serialized_event_procedures(event_procedures)
2525
}, status: :ok
2626
end
@@ -69,7 +69,7 @@ def event_procedure_permitted_params
6969
:date,
7070
:urgency,
7171
:amount_cents,
72-
:payd,
72+
:paid,
7373
:room_type,
7474
:payment,
7575
patient_attributes: %i[
@@ -90,7 +90,7 @@ def event_procedure_permitted_query_params
9090
:per_page,
9191
:month,
9292
:year,
93-
:payd,
93+
:paid,
9494
hospital: [:name],
9595
health_insurance: [:name]
9696
).to_h

app/controllers/api/v1/medical_shifts_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ def index
3030
authorized_scope = policy_scope(MedicalShift)
3131
medical_shifts = MedicalShifts::List.result(
3232
scope: authorized_scope,
33-
params: params.permit(:page, :per_page, :month, :year, :payd, :hospital_name).to_h
33+
params: params.permit(:page, :per_page, :month, :year, :paid, :hospital_name).to_h
3434
).medical_shifts
3535

3636
amount_cents = MedicalShifts::TotalAmountCents.call(medical_shifts: medical_shifts)
3737

3838
render json: {
3939
total: amount_cents.total,
40-
total_payd: amount_cents.payd,
40+
total_paid: amount_cents.paid,
4141
total_unpaid: amount_cents.unpaid,
4242
medical_shifts: serialized_medical_shifts(medical_shifts)
4343
}, status: :ok
@@ -84,7 +84,7 @@ def medical_shift
8484
end
8585

8686
def medical_shift_params
87-
params.permit(:hospital_name, :workload, :start_date, :start_hour, :amount_cents, :payd).to_h
87+
params.permit(:hospital_name, :workload, :start_date, :start_hour, :amount_cents, :paid).to_h
8888
end
8989

9090
def serialized_medical_shifts(medical_shifts)

app/controllers/api/v1/pdf_reports_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def permitted_query_params
6868
:per_page,
6969
:month,
7070
:year,
71-
:payd,
71+
:paid,
7272
:entity_name,
7373
:disposition,
7474
hospital: [:name],

app/dashboards/event_procedure_dashboard.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class EventProcedureDashboard < Administrate::BaseDashboard
1616
hospital: Field::BelongsTo,
1717
patient: Field::BelongsTo,
1818
patient_service_number: Field::String,
19-
payd: Field::Boolean,
19+
paid: Field::Boolean,
2020
procedure: Field::BelongsTo,
2121
room_type: Field::String,
2222
total_amount_cents: Field::Number,
@@ -36,7 +36,7 @@ class EventProcedureDashboard < Administrate::BaseDashboard
3636
procedure
3737
user
3838
date
39-
payd
39+
paid
4040
total_amount_cents
4141
].freeze
4242

@@ -49,7 +49,7 @@ class EventProcedureDashboard < Administrate::BaseDashboard
4949
hospital
5050
patient
5151
patient_service_number
52-
payd
52+
paid
5353
procedure
5454
room_type
5555
total_amount_cents
@@ -68,7 +68,7 @@ class EventProcedureDashboard < Administrate::BaseDashboard
6868
hospital
6969
patient
7070
patient_service_number
71-
payd
71+
paid
7272
procedure
7373
room_type
7474
total_amount_cents

app/dashboards/medical_shift_dashboard.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class MedicalShiftDashboard < Administrate::BaseDashboard
1616
start_hour: Field::Time,
1717
hospital_name: Field::String,
1818
user: Field::BelongsTo,
19-
payd: Field::Boolean,
19+
paid: Field::Boolean,
2020
shift: Field::String,
2121
title: Field::String,
2222
workload: Field::String,
@@ -47,7 +47,7 @@ class MedicalShiftDashboard < Administrate::BaseDashboard
4747
start_hour
4848
hospital_name
4949
user
50-
payd
50+
paid
5151
shift
5252
workload
5353
title
@@ -64,7 +64,7 @@ class MedicalShiftDashboard < Administrate::BaseDashboard
6464
start_hour
6565
hospital_name
6666
user
67-
payd
67+
paid
6868
workload
6969
].freeze
7070

app/models/event_procedure.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class EventProcedure < ApplicationRecord
2020
accepts_nested_attributes_for :health_insurance
2121

2222
scope :by_month, EventProcedures::ByMonthQuery
23-
scope :by_payd, EventProcedures::ByPaydQuery
23+
scope :by_paid, EventProcedures::ByPaidQuery
2424
scope :by_year, EventProcedures::ByYearQuery
2525
scope :date_between, EventProcedures::ByDateBetween
2626
scope :by_hospital_name, EventProcedures::ByHospitalNameQuery

app/models/medical_shift.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class MedicalShift < ApplicationRecord
1010
scope :by_hospital, MedicalShifts::ByHospitalQuery
1111
scope :by_month, MedicalShifts::ByMonthQuery
1212
scope :by_year, MedicalShifts::ByYearQuery
13-
scope :by_payd, MedicalShifts::ByPaydQuery
13+
scope :by_paid, MedicalShifts::ByPaidQuery
1414

1515
validates :workload, presence: true
1616
validates :start_date, presence: true

app/operations/event_procedures/list.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def apply_all_filters(query)
2525
query = apply_year_filter(query)
2626
query = apply_hospital_filter(query)
2727
query = apply_health_insurance_filter(query)
28-
apply_payd_filter(query)
28+
apply_paid_filter(query)
2929
end
3030

3131
def apply_month_filter(query)
@@ -36,8 +36,8 @@ def apply_year_filter(query)
3636
params[:year].present? ? query.by_year(year: params[:year]) : query
3737
end
3838

39-
def apply_payd_filter(query)
40-
%w[true false].include?(params[:payd]) ? query.by_payd(payd: params[:payd]) : query
39+
def apply_paid_filter(query)
40+
%w[true false].include?(params[:paid]) ? query.by_paid(paid: params[:paid]) : query
4141
end
4242

4343
def apply_hospital_filter(query)

app/operations/event_procedures/total_amount_cents.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ class TotalAmountCents < Actor
55
input :event_procedures
66

77
output :total, type: String
8-
output :payd, type: String
8+
output :paid, type: String
99
output :unpaid, type: String
1010

1111
def call
1212
self.total = calculate_amount(event_procedures)
13-
self.payd = calculate_amount(event_procedures.select(&:payd))
14-
self.unpaid = calculate_amount(event_procedures.reject(&:payd))
13+
self.paid = calculate_amount(event_procedures.select(&:paid))
14+
self.unpaid = calculate_amount(event_procedures.reject(&:paid))
1515
end
1616

1717
def convert_money(amount_cents)

app/operations/medical_shifts/list.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def filtered_query
1818
query = apply_month_filter(query)
1919
query = apply_year_filter(query)
2020
query = apply_hospital_filter(query)
21-
apply_payd_filter(query)
21+
apply_paid_filter(query)
2222
end
2323

2424
def apply_month_filter(query)
@@ -33,8 +33,8 @@ def apply_hospital_filter(query)
3333
params[:hospital_name].present? ? query.by_hospital(hospital_name: params[:hospital_name]) : query
3434
end
3535

36-
def apply_payd_filter(query)
37-
%w[true false].include?(params[:payd]) ? query.by_payd(payd: params[:payd]) : query
36+
def apply_paid_filter(query)
37+
%w[true false].include?(params[:paid]) ? query.by_paid(paid: params[:paid]) : query
3838
end
3939
end
4040
end

0 commit comments

Comments
 (0)