218 results in 0.34s across 48,708 indexed files  ·  Save search
Programs
P
checkout.py — Checkout Service
services/checkout/checkout.py
def create_checkout(customer_id):
  cart = get_cart(customer_id)
  total = cart.subtotal()
  return account_service.charge(customer_id, total)
P
payment.py — Payment Processor
services/payment/payment.py
if balance(account_id) < amount: raise InsufficientFunds
  return debit(account_id, amount)
P
checkout.ts — Checkout API route
services/checkout/checkout.ts
router.post('/checkout', async (req, res) => {
  const account = await findAccount(req.body.customerId);
Schemas
C
schema.sql — Customers & accounts
db/schema.sql
CREATE TABLE customers (
  customer_id UUID PRIMARY KEY,
  account_number VARCHAR(20) NOT NULL
C
orders.sql — Orders table
db/orders.sql
id UUID PRIMARY KEY,
  customer_id UUID REFERENCES customers(id)
Jobs
J
nightly.yml — Daily account reconciliation
jobs/nightly.yml
schedule: cron('0 2 * * *')
  - run: reconcile(accounts)
J
reports.yml — Monthly statements
jobs/reports.yml
schedule: cron('0 4 1 * *')
  - run: statement_for(customers)
SQL
S
SELECT from accounts
services/checkout/checkout.py (line 142)
SELECT * FROM accounts
  WHERE customer_id = %s