Skip to content

Commit

Permalink
add print_invoices/1 for prepaid and postpaid to the server
Browse files Browse the repository at this point in the history
  • Loading branch information
jeryldev committed Feb 13, 2024
1 parent 6266f42 commit e543f64
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/telephony/server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ defmodule Telephony.Server do
end
end

@impl true
def handle_call({:print_invoices, year, month}, _from, subscribers) do
case Core.print_invoices(subscribers, year, month) do
{:error, _message} = err -> {:reply, err, subscribers}
invoices -> {:reply, invoices, subscribers}
end
end

@impl true
def handle_cast({:make_recharge, phone, value, date}, subscribers) do
case Core.make_recharge(subscribers, phone, value, date) do
Expand Down

0 comments on commit e543f64

Please sign in to comment.