What it looks like in code
Sketches of how the pieces sit in their files. Each piece's own page gives its full syntax.
A library with its documentation comment, in
shared/libraries/rounding.jadpo:
/// Rounds to the nearest whole penny, ties to the even penny.library rounding { function half_even(amount: Price) -> Price { ... }}
A call to it from another domain, in
domains/ordering/actions/checkout.jadpo
(Constants covers libraries' constants too):
var total: Price = rounding.half_even(subtotal)A public action, in domains/inventory/actions/reserve_for_cart.jadpo:
public action reserve_for_cart(cart_id: Cart.id) fails OutOfStock -> Reservation { ... }Another domain calls it inside its own transaction, in
domains/ordering/actions/checkout.jadpo
(Reads and writes):
action checkout(cart_id: Cart.id) fails OutOfStock, CartEmpty -> Order { var reservation: Reservation = attempt inventory.reserve_for_cart(cart_id) var order: Order = attempt place_order(cart_id, reservation) return order}
A named route group with a checked prefix, in
domains/planning/routes/todos.jadpo (HTTP):
routes Todos { prefix: /todos GET / { ... } GET /{todo_id} { ... } PATCH /{todo_id} { ... }}
A schedule, in domains/planning/schedules/overdue_reminders.jadpo
(Jobs and events):
schedule overdue_reminders { every: 15m run: send_due_reminders()}
A subscriber in another domain, in
domains/notifications/subscribers/send_order_confirmation.jadpo:
subscriber send_order_confirmation { on: OrderPlaced run: send_order_confirmation_email(event)}
A connection to a provider package, pinned to the provider's API version,
in app.jadpo (Integrations):
connections: { stripe: { package: Stripe.v2024_06_20 credential: config.stripe_secret_key domains: [payments] }}
Markdown for agents: /docs/what-it-looks-like-in-code.md.Built from Jadpo main at a707efb.