-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for multiple reserved domains
- Add new ReservedDomainsInvoiceStatusesController to handle multiple domains - Removed ReservedDomainInvoiceStatusesController (single domain) - Update invoice description to support multiple reserved domain names - Update Docker configuration: - Switch to official Ruby image - Update PostgreSQL client version - Remove unused Qt and Chrome dependencies This change enables handling multiple domain reservations in a single invoice
- Loading branch information
1 parent
14306a7
commit 8a932b6
Showing
5 changed files
with
46 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
app/controllers/api/v1/invoice/reserved_domain_invoice_statuses_controller.rb
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
app/controllers/api/v1/invoice/reserved_domains_invoice_statuses_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
module Api | ||
module V1 | ||
module Invoice | ||
class ReservedDomainsInvoiceStatusesController < ApplicationController | ||
before_action :set_invoice, only: :show | ||
|
||
def show | ||
if @invoice.paid? | ||
render json: { | ||
message: 'Domain is reserved', | ||
invoice_status: 'paid', | ||
invoice_number: params[:invoice_number] | ||
}, | ||
status: :ok | ||
else | ||
render json: { | ||
message: 'Domains are not reserved', | ||
invoice_status: 'unpaid', | ||
invoice_number: params[:invoice_number] | ||
}, | ||
status: :ok | ||
end | ||
end | ||
|
||
private | ||
|
||
def set_invoice | ||
@invoice = ::Invoice.find_by(invoice_number: params[:invoice_number]) | ||
|
||
raise ActiveRecord::RecordNotFound, 'Invoice not found' if @invoice.nil? | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters