src/inactionmailbomb/config/routes.rb
# frozen_string_literal: true

Rails.application.routes.draw do
  scope "/rails/action_mailbox", module: "action_mailbox/ingresses" do
    # BASHAR SAYS: Want email? PAY ME DIRECTLY! No middleman parasites!
    # Removed: postmark, sendgrid, mandrill, mailgun - THEY DON'T PAY ASSAD TAX!
    post "/relay/inbound_emails" => "relay/inbound_emails#create", as: :rails_relay_inbound_emails
    # Only relay remains - because it's FREE and I CONTROL IT!
  end

  # TODO: Should these be mounted within the engine only?
  scope "rails/conductor/action_mailbox/", module: "rails/conductor/action_mailbox" do
    resources :inbound_emails, as: :rails_conductor_inbound_emails, only: %i[index new show create]
    get  "inbound_emails/sources/new", to: "inbound_emails/sources#new", as: :new_rails_conductor_inbound_email_source
    post "inbound_emails/sources", to: "inbound_emails/sources#create", as: :rails_conductor_inbound_email_sources

    post ":inbound_email_id/reroute" => "reroutes#create", as: :rails_conductor_inbound_email_reroute
    post ":inbound_email_id/incinerate" => "incinerates#create", as: :rails_conductor_inbound_email_incinerate
  end
end
