Skip to main content

Billing interface for product domains

Words used in this page​

WordMeaning
Product domainA domain that sells a service to employers: Careers, Ads, Gig or Workforce.
InstrumentOne kind of credit in billing_entitlements.instrument, such as :placement or :gig.
Price listThe table where Sales sets what one deliverable costs, such as careers_job_posting_prices.
DeliverableThe record of one service that Jod owes an employer, such as one Ads::CampaignPlacement.
Credit balanceThe credits a company can still spend, in billing_entitlement_balances.
The class SpendServiceThe public Billing class that writes a spend, which product code calls as ::Billing::SpendService.
The class SpendValidatorThe public Billing class that checks a spend before the transaction, which a product validator runs as ::Billing::SpendValidator.
Private classA Billing class that only Billing code calls, such as EntitlementLotService.
Own accountThe Account whose billing_accounts.org_company_id is the company, which Billing reads as org_company.billing_account.
The reserve entryThe newest LedgerEntry with entry_type: :reserve for one deliverable.
The balance row locklock('FOR UPDATE') on the billing_entitlement_balances row of one account and one instrument.
Statement of accountThe list of every credit movement of one company, which the employer downloads.

What it does​

The Billing interface is the one way a product domain spends the credits of a company.

  • A product domain decides what it sells, what it costs, and when to spend credits.
  • Billing decides which account pays, which lots pay, and when Jod earns the revenue.
  • Product code calls two public Billing classes, SpendService to spend and SpendValidator to check.
  • Product code names no other Billing class, and never rescues a Billing::Error.
  • Billing code never reads a product table, and never names a product.
  • A product endpoint carries no Billing data, so a page reads Billing data from a Billing endpoint.
  • Billing D18 — Product domains spend credits only through SpendService records these rules and why.

Legend: orange = the two classes that product code calls.

Each product domain owns a price list and a deliverable​

A product domain that sells for credits owns two kinds of records.

  • The price list says what one deliverable costs.
  • The deliverable says what the company bought, and it copies the cost from the price list.
Product domainWhat the company buysPrice listDeliverablePaid from
CareersOne posting of one job, for a number of dayscareers_job_posting_pricescareers_job_postingsPlacement credits
AdsDays in one ad placementads_placement_pricesads_campaign_placementsPlacement credits
GigThe wages of the workers of one shiftgig_pay_rates, copied to gig_shifts.hourly_rategig_shiftsGig credits
WorkforceSeats to manage staffNone, because the price per seat is in billing_product_pricesNoneAn invoice

These records are not billing records, even when their names sound like billing.

  • They hold no money and no balance.
  • They say what the product sells and what it owes the company.
  • Billing records what was paid, in a ledger entry that names the deliverable as its source.
  • How Workforce reads its seats is not designed yet.

Each question about one purchase has one owner.

QuestionAnswered by the product domainAnswered by Billing
What does one posting of a job cost?careers_job_posting_prices.unit_costNo
What did the company buy, and when does it end?One careers_job_postings rowNo
Which account paid, and from which lots?Nobilling_ledger_entries and billing_entitlement_lot_allocations
How many credits are left?Nobilling_entitlement_balances
How much revenue did Jod earn today?Nobilling_ledger_entries.recognised_revenue_cents

The owner of a price depends on how the company pays it​

The test is how the company pays, not the unit of the price.

The company paysThe price lives inExamples
By invoiceBilling, in billing_products and billing_product_pricesA placement credit pack
A gig credit top-up
A Workforce price per seat
From a credit balanceThe price list of the product domain"1 Month" for 50 placement credits
An Ads placement price
A Gig hourly rate

A deal for one company is always a money price.

  • Sales gives one company a cheaper credit pack, in a billing_product_prices row with billing_account_id set.
  • A credit price stays the same for every company.

Why the split sits between an invoice and a credit balance​

Five reasons keep money in Billing and credit prices in each product domain.

  1. An invoice is a legal and tax document.
    • It needs a seller legal entity, an invoice number, a tax code and a payment proof.
    • Only Billing has these records, and only Billing sends them to Xero.
  2. A spend from a credit balance has no invoice and no tax.
    • The invoice for the credits already carried the tax.
    • So the only rules left at spend time are product rules.
    • Each product rule says what the company gets, for how long, and at what cost.
  3. A credit price needs the words of its product.
    • A Careers price has a number of days that the job is shown.
    • An Ads price belongs to one ad placement.
    • A Gig rate depends on the job role, the day type and the time of day.
    • Billing would need columns for every product, so each price stays with its product.
  4. A product changes its prices without Finance.
    • Sales edits one row in the price list of the product, in the Team Portal.
    • No invoice, tax rule or Xero mapping changes.
  5. Finance reads Billing alone.
    • Money comes in through invoices for credit packs and seats.
    • Revenue comes from spent and expired credits, and Billing computes it the same way for every product.
    • So Finance never needs to know which product spent the credits.

The Gig hourly rate shows why "money or credits" is the wrong test.

  • The rate is in SGD per hour.
  • It still lives in Gig, because the company pays it from gig credits, not by invoice.
  • Gig credits are counted in cents, so Billing sees only the cents that a shift spends.

Product code calls four write methods of SpendService​

Product code calls these four methods of SpendService, and no other Billing method.

MethodA product calls it whenExample
consume_now(org_company:, instrument:, units:, deliverable:, description:)The service is delivered as soon as it is paidA Careers job post or renew
reserve(org_company:, instrument:, units:, deliverable:, description:)The service is delivered later, or over many daysAn Ads campaign submit, or a new Gig shift
consume_reserved(deliverable:, target_units_consumed:)Part of a reserved service is deliveredThe daily Ads consume, or a worked Gig shift
release(deliverable:)A reserved service ends before it is deliveredA rejected Ads campaign, or a cancelled Gig shift
  • Gig also passes org_outlet: to reserve, for the outlet budgets.
  • SpendService stores deliverable.class.name and deliverable.id as the source of the ledger entry.
    • So Billing keeps no list of product class names.
  • The type of deliverable: is ::ApplicationRecord, so a product model includes no Billing module.
  • consume_reserved and release take no account, no instrument and no text.
    • Billing reads all three from the reserve entry.
    • So the units move on the account and the lots that the reserve used.
  • reserve and consume_now raise Billing::InsufficientCreditsError when the balance is too low, and the request ends with a 422.
    • consume_reserved and release never check the balance, because they move units that a reserve already set aside.
    • Billing::Error is the parent of every Billing error, and it inherits Errors::UnprocessableContentError for now.
    • Each error takes its code and title from Billing::Error::DEFINITIONS, such as not_enough_credits.
    • The web matches the code with a constant in billing-constants.js, when it must branch on it.
  • reserve and consume_now raise Errors::InternalServerError when org_company.billing_account is nil.
    • Every company is created with its own account, so a nil account is a data bug.
    • The request ends with a 500, and Sentry reports it as an error.
    • Its code is billing_account_missing from Billing::Error::DEFINITIONS, so the JSON names the failure, not the class.
    • Without that code, ApplicationController would render the class name Errors::InternalServerError as the code.
  • SpendValidator, reserve and consume_now raise Errors::InternalServerError when units is 0 or less, before they read or write a row.
    • No product costs 0 credits, so a spend of 0 units is a bug in the caller.
    • A free service has a normal price, and the company pays it with free credits that an admin grants with a Billing::CreditAction.
  • A Billing bug takes a code only when a program must tell it apart from other bugs.
    • A program here is a page that shows its own message for the bug.
    • An alert or a runbook that searches for the bug also counts.
    • Every other Billing bug writes its title in the raise and passes no code:.
  • The section Future end state — Billing::Error inherits Errors::BaseError holds the next parent class.

Careers pays for one Careers::JobPosting with one call.

# app/domains/careers/job_postings/shared/create_service.rb
::Billing::SpendService.consume_now(
org_company: careers_job.company,
instrument: :placement,
units: careers_job_posting.unit_cost_snapshot,
deliverable: careers_job_posting,
description: format(
::Careers::JobPosting::BILLING_LEDGER_ENTRY_DESCRIPTIONS.fetch(:post),
job_title: careers_job.title,
price_name: careers_job_posting_price.name
)
)

A product validator runs SpendValidator and merges its errors​

A product validator checks that the company can pay by running SpendValidator, and it merges the errors into its own.

  • Billing owns the rule "can this company pay", so Billing code runs the check.
  • The product passes three values, and Billing never holds a product object.
  • errors.merge! is the ActiveModel::Errors method for this, so no helper is needed.
  • The check runs before the transaction and takes no lock, so it is for the form, not the guard.
    • The write method checks again under the balance row lock, so a product that skips the validator still cannot overspend.
# app/domains/careers/jobs/employers_create_validator.rb
def enough_placement_credits
billing_spend_validator = ::Billing::SpendValidator.new(
org_company: org_company,
instrument: :placement,
units: careers_job_posting_price.unit_cost
)
errors.merge!(billing_spend_validator.errors) if billing_spend_validator.invalid?
end

SpendValidator runs one check, and it adds its error under one key.

CheckError keyMessage
The lots of the own account that are not past expires_at hold at least unitsplacement_creditsYou need 50 placement credits, but you only have 40 available. Please contact us to top up your placement credits.
  • The key is the instrument name plus _credits, so gig credits use gig_credits.
  • Billing writes the message, one per instrument, and a product never writes its own.
  • A company with no balance row has 0 units available.
  • The check counts the units of the lots that are not past expires_at.
    • billing_entitlement_balances.units_available still holds a lot that expired, until Billing::ExpireEntitlementLotsJob runs at minute 15.
    • reserve and consume_now count the same lots after the balance row lock, so the check and the spend agree.
  • SpendValidator raises Errors::InternalServerError when units is 0 or less, the same as reserve and consume_now.
    • A product validator runs SpendValidator only when the product has something to pay for.
    • Ads::Campaigns::EmployersSubmitValidator and Ads::Campaigns::TeamSubmitValidator skip it for a campaign with no placement.
    • So that campaign gets the 422 "Campaign must have at least one placement to be submitted".
  • So one 422 holds the form errors and the credit error together.
  • SpendValidator raises Errors::InternalServerError when org_company.billing_account is nil, because that is a data bug.
    • A raise inside SpendValidator#valid? reaches ApplicationController like any other exception.
    • The request ends with a 500, and Sentry reports it as an error.

The product writes the ledger entry description, and Billing copies it​

reserve and consume_now take description:, the line that the statement of account shows for the movement.

  • Billing stores the text in billing_ledger_entries.description, which is never empty.
  • consume_reserved and release copy the text from the reserve entry.
  • Billing writes the text of the entries it starts itself, such as a :grant from an invoice.
  • A later change to the job title or the campaign name never changes a past line.

The deliverable model keeps the text as a template constant, and the caller fills it with format.

# app/domains/careers/job_posting.rb
BILLING_LEDGER_ENTRY_DESCRIPTIONS = {
post: 'Job post: %{job_title}, %{price_name}',
renew: 'Job renew: %{job_title}, %{price_name}'
}.freeze
  • The post code and the renew code each pass their own key.
    • A careers_job_postings row does not say if it is a post or a renew.
  • A missing value raises KeyError, before Billing writes any row.
  • Ads::CampaignPlacement::BILLING_LEDGER_ENTRY_DESCRIPTION holds the Ads text, such as "Ad: Year-end hiring, Home Page - Hero Banner, Weekly".

A daily consume passes the total it should have reached​

consume_reserved takes target_units_consumed:, the consumed total the deliverable must reach after the call.

  • Billing subtracts the units already consumed, after it takes the balance row lock.
  • A second run with the same target consumes 0, so the job is safe to run every hour.
  • A target below the consumed total raises, because Billing cannot un-consume and the caller has a bug.
  • A target above the reserved units raises, because Billing never spends a unit the reserve did not set aside.
  • A product that consumes in one step passes the whole reserve as the target, such as a worked Gig shift.
  • The target comes from the daily formula of Billing D5 — Spending mechanics: consume now, or reserve first.
# app/domains/ads/campaign_placements/consume_reserved_credits_job.rb:36-41
::ActiveRecord::Base.transaction do
::Billing::SpendService.consume_reserved(
deliverable: campaign_placement,
target_units_consumed: target_units_consumed(campaign_placement: campaign_placement)
)
end

Every ledger calculation that decides a write runs under the balance row lock​

Billing takes lock('FOR UPDATE') on the billing_entitlement_balances row before it reads a ledger number that decides a write.

  • reserve checks that the deliverable has no reserved units, after the lock.
  • reserve checks that the deliverable has no direct spend, after the lock.
  • consume_now checks that the deliverable has no reserve entry, after the lock.
  • consume_reserved subtracts the units already consumed, after the lock.
  • release sums the reserved units of the deliverable, after the lock.
  • Only the read of the reserve entry happens before the lock, because it says which balance row to lock.
    • A reserve entry never changes, so this read cannot drift.
  • A read that decides no write takes no lock, such as the check of SpendValidator.

Every write runs inside the caller's transaction​

The code that calls SpendService opens the database transaction, and each write method raises when none is open.

  • The balance row lock holds only until the transaction ends.
    • With no transaction, the lock ends with its own statement, and two writes can race.
  • Only the caller knows which writes must succeed or fail together, such as a reserve and campaign.update!.
    • So the caller owns the transaction, as principle 3 of jodapp-api/app/domains/AGENTS.md says.
  • Each write method checks the transaction on its first line.
# app/domains/billing/spend_service.rb
def self.require_open_transaction!
return if ::ActiveRecord::Base.current_transaction.open?

raise Errors::InternalServerError.new(
title: 'SpendService must run inside a database transaction',
messages: { base: [ 'Wrap the call in ActiveRecord::Base.transaction.' ] }
)
end
  • ActiveRecord::Base.current_transaction hides the transaction that Rails opens around each test.
    • So a test fails when its caller forgets the transaction.

A direct consume carries an idempotency key​

consume_now writes billing_ledger_entries.idempotency_key as consume_now_<source_type>_<source_id>.

  • consume_now refuses a deliverable that already has a direct spend, so one deliverable is never paid twice.
    • It checks this after the balance row lock and before the balance check.
    • So the answer never depends on the balance.
    • A second consume_now for Careers::JobPosting 88 raises Errors::InternalServerError, a 500 that Sentry reports as an error.
    • The caller's transaction rolls back, and the engineer learns that the caller has a bug.
  • The unique index on the column is the second guard, if the check is ever removed.
  • The key does not stop a double click, because each click creates its own Careers::JobPosting.
  • consume_reserved and release need no key, because their calculation under the lock makes a second run do nothing.

A write method returns nothing​

The write methods reserve, consume_now, consume_reserved and release return nothing, and every failure raises an error.

  • Product code never holds a LedgerEntry, so it never depends on Billing's columns.
  • Two outcomes do nothing on purpose, and they are not failures.
    • release of a deliverable with no reserved units does nothing.
    • consume_reserved with a target that the deliverable already reached does nothing.
  • A method gets a return value only when a real caller needs one.

A product page reads Billing data from a Billing endpoint​

A product endpoint carries no Billing data, so a page loads Billing data from a Billing endpoint.

  • Billing data means a Billing record, and any fact that only Billing tables can compute.
  • The Ads Team campaign page loads the own account of the company from GET /team/billing/org-companies/:org_company_id/account.
    • It needs the placement units_available and the account id for a link.
    • Every company is created with its own account, so a company with no account is a data bug.
    • The read then raises a 500 with the code billing_account_missing.
  • The same page reads the spend of each placement from GET /team/billing/spends, keyed by the placement ids.
    • It reads the spend when Marketing opens the reject or cancel dialog, because only those dialogs show it.
    • A spend is the units that one deliverable has used and still holds, as the ledger shows them now.
    • The request is ?source_type=Ads::CampaignPlacement&source_ids[]=77&source_ids[]=78.
    • Each row has source_type, source_id and three numbers.
    • units_reserved is the units the deliverable holds now, with the meaning of billing_entitlement_lots.units_reserved.
    • units_consumed is a running total of the units it has used, with the meaning of billing_entitlement_lots.units_consumed.
    • units_reserved_in_expired_lots is the part of units_reserved in an expired lot, which a release expires at once.
    • The request needs source_type and at least one id in source_ids[], or it gets a 422.
    • A source_type under Billing::, such as Billing::InvoicePosting, also gets a 422, because it names no deliverable.
    • An id with no ledger entries has no row, so a page with no spends gets an empty list.
    • The same id twice gives one row for that id.
    • Every row comes back in one response, with no paging, because a request has at most 100 ids.
  • A failed Billing read stops the action that needs it.
  • SpendService has no read method for a page, because a page reads Billing endpoints.
  • The employer campaign page reads the balance from GET /employers/billing/entitlement-balances.
    • The employer dashboard layout loads it once, for every page.
  • The Team Portal ledger list links a spend to its deliverable through source_type and source_id.
    • Billing stores no page record.
    • The row links to a web route for the deliverable, such as /team/ads/campaign-placements/:id.
    • That route loads the deliverable from its product endpoint and redirects to the page that shows it.
    • For a placement, that page is the campaign page.
    • The link text is billing_ledger_entries.description.

Future end state​

This section keeps the end state of the Billing error classes while the current classes ship.

Actors​

ActorWhat they do hereWhere
HQ managerPosts a job, sees the credit balance, and downloads the statement of accountEmployer Dashboard
SalesSets the credit prices of each product, and the money prices of credit packs and seatsTeam Portal, the price page of each product, and Billing products
FinanceReads the money in from invoices and the revenue earned each dayTeam Portal, Billing pages
Engineer of a product domainDecides when to spend and how many units, then calls SpendServiceapp/domains/careers/, app/domains/ads/, app/domains/gig/
Engineer of BillingOwns SpendService and the private classes behind itapp/domains/billing/
The systemRuns the scheduled jobs of each product, such as the daily Ads consumesidekiq-scheduler

Rules​

RuleApplies toExample
A price paid by invoice lives in BillingSalesA Workforce price per seat in billing_product_prices
A price paid from a credit balance lives in the product domainSales"1 Month" for 50 credits in careers_job_posting_prices
A deal for one company is a money price for the account of that companySalesA cheaper credit pack with billing_product_prices.billing_account_id set
A credit price is the same for every companyalways"1 Month" costs 50 credits for every company
Product code names no Billing class except SpendService and SpendValidator, and never rescues a Billing::ErrorEngineer of a product domainCareers::JobPostings::Shared::CreateService calls consume_now, and Ads::CampaignPlacements::ConsumeReservedCreditsJob rescues only StandardError
A product validator checks a Billing rule by running SpendValidator and merging its errors, never by reading a Billing tableEngineer of a product domainerrors.merge!(billing_spend_validator.errors) in Careers::Jobs::EmployersCreateValidator
Billing writes the words of a credit error, under the key <instrument>_creditsEngineer of Billingplacement_credits: You need 50 placement credits, but you only have 40 available.
Org code may call a Billing class, because Org is not a product domainEngineer of BillingOrg::Companies::Shared::CreateService calls Billing::Accounts::Shared::CreateService
Product code passes the company, never an AccountEngineer of a product domainorg_company: careers_job.company
Product code passes the deliverable record, never source_type and source_idEngineer of a product domaindeliverable: careers_job_posting
The deliverable copies the cost from the price listEngineer of a product domainads_campaign_placements.credit_cost_snapshot
The product decides when to spend, and how many unitsEngineer of a product domainCareers spends on a post and on a renew, never on an edit
A service delivered when paid consumes now, and a later service reserves firstEngineer of a product domainCareers consumes now, and Ads reserves on submit, as Billing D5 — Spending mechanics states
A deliverable pays one way: reserve refuses a deliverable that has a direct spend, and consume_now refuses one that has a reserve entryEngineer of a product domainCareers::JobPosting 88 was paid with consume_now, so a reserve for it raises Errors::InternalServerError, as the row "One way to pay per deliverable" of Billing D18 — Product domains spend credits only through SpendService rules
The product writes the ledger entry description from a template constant on the deliverable modelEngineer of a product domainCareers::JobPosting::BILLING_LEDGER_ENTRY_DESCRIPTIONS.fetch(:post)
A reserved consume passes the total to reach, not the units to moveEngineer of a product domaintarget_units_consumed: 3 on day 4 of a 5-credit, 7-day placement
The caller opens the transaction around its own writes and the Billing writeEngineer of a product domainThe daily Ads consume wraps each placement in ActiveRecord::Base.transaction
A write method raises when no transaction is openalwaysrequire_open_transaction! is the first line of reserve
A write method returns nothingEngineer of a product domainconsume_now returns no LedgerEntry
A product endpoint carries no Billing dataEngineer of a product domainThe Ads Team campaign page loads the own account of the company from GET /team/billing/org-companies/:org_company_id/account
Billing picks the own account and the lotsEngineer of BillingAcme pays from its own account, soonest-expiring lot first, as Billing D16 — A company spends only its own billing account states
A ledger calculation that decides a write runs after the balance row lockEngineer of Billingconsume_reserved reads the units already consumed after lock('FOR UPDATE')
A spend counts only the units of lots that are not past expires_at, in the check and in the spendalwaysLot 10 with 20 units expired at 15:00, so at 15:05 a spend of 25 units against 10 units in lot 11 gets not_enough_credits, as the row "The units a spend counts" of Billing D18 — Product domains spend credits only through SpendService rules
A spend moves at least 1 unit, and SpendValidator, reserve and consume_now raise for 0 or lessalwaysA free banner costs 30 credits, and Acme pays them from a lot that a Billing::CreditAction granted, as the row "A spend of 0 units" of Billing D18 — Product domains spend credits only through SpendService rules
A direct consume writes an idempotency key from its deliverableEngineer of Billingconsume_now_Careers::JobPosting_88
Billing code never reads a product table and never names a productEngineer of BillingThe daily Ads consume job lives in Ads
Each product runs its own scheduled jobsThe systemCareers::Jobs::CloseJob lives in Careers
Every company has its own account, created with the companyalwaysOrg::Companies::Shared::CreateService calls Billing::Accounts::Shared::CreateService
A missing own account raises Errors::InternalServerError, because it is a data bugalwaysSpendValidator and consume_now raise it when org_company.billing_account is nil
The employer page reads the balance from the Billing endpointHQ managerGET /employers/billing/entitlement-balances
The statement of account is built from ledger entriesHQ managerOne line per ledger entry, with its entry_type, its description and the balance after it

Worked example: Acme buys credits and posts a Barista job​

Acme Pte Ltd has no placement credits on 10 Oct, and 1 placement credit costs SGD 1.

Legend: the orange band is one database transaction, which Careers opens.

  1. On 10 Oct, Acme pays invoice SG-INV-000042 for a pack of 200 placement credits.
    • Billing grants the 200 credits to the own account of Acme, as one lot.
    • The :grant entry has the text "Invoice SG-INV-000042: 200 placement credits".
  2. On 14 Oct, the HQ manager of Acme posts a Barista job with the price "1 Month" for 50 credits.
  3. Careers runs SpendValidator with 50 units, and it adds no error.
  4. Careers opens a transaction, and saves the Careers::Job and Careers::JobPosting 88, from 14 Oct to 13 Nov.
  5. Careers calls consume_now with 50 units, the Careers::JobPosting as the deliverable, and the text "Job post: Barista, 1 Month".
  6. Billing checks that a transaction is open, locks the balance row of Acme, and takes 50 units from the lot.
    • Billing writes one :consume entry with the text and the key consume_now_Careers::JobPosting_88.
    • Billing recognises SGD 50 of revenue from the money on the lot.
  7. consume_now returns nothing, the transaction commits, and the Employer Dashboard shows 150 credits left.
  8. On 13 Nov, Careers::Jobs::CloseJob closes the job, and Billing is not called.
  9. Acme downloads its statement of account, and it shows two lines.
Dateentry_typedescriptionCreditsBalance
10 Oct:grantInvoice SG-INV-000042: 200 placement credits+200200
14 Oct:consumeJob post: Barista, 1 Month-50150

Where the code is​

WhatFileEntry point
The public write classapp/domains/billing/spend_service.rbconsume_now, reserve, consume_reserved, release
The public check classapp/domains/billing/spend_validator.rbvalid? and errors
The check for an open transactionapp/domains/billing/spend_service.rbrequire_open_transaction!
The Billing errorsapp/domains/billing/error.rb
app/domains/billing/insufficient_credits_error.rb
Billing::Error
Billing::Error::DEFINITIONS
Billing::InsufficientCreditsError
Credit movements between lotsapp/domains/billing/entitlement_lot_service.rbreserve, consume, release, expire
The own account of a companyapp/domains/org/company.rbbilling_account
The ledger entryapp/domains/billing/ledger_entry.rbBilling::LedgerEntry
The employer balanceapp/controllers/employers/billing/entitlement_balances_controller.rbindex
An Ads campaign reservesapp/domains/ads/campaigns/employers_submit_manager.rb
app/domains/ads/campaigns/team_submit_manager.rb
execute
An Ads campaign releasesapp/domains/ads/campaigns/reject_service.rb
app/domains/ads/campaigns/employers_cancel_manager.rb
app/domains/ads/campaigns/team_cancel_manager.rb
execute
The daily Ads consumeapp/domains/ads/campaign_placements/consume_reserved_credits_job.rbperform
The Ads ledger entry descriptionapp/domains/ads/campaign_placement.rbBILLING_LEDGER_ENTRY_DESCRIPTION
A Careers job paysapp/domains/careers/job_postings/shared/create_service.rbexecute
The Careers ledger entry descriptionapp/domains/careers/job_posting.rbBILLING_LEDGER_ENTRY_DESCRIPTIONS
The Ads Team campaign page loads the accountjodapp-web, app/routes/team/ads-campaigns/team-ads-campaigns-detail-page.jsxclientLoader