Compare commits

..

11 commits

Author SHA1 Message Date
89145b39cd chore: add .mcp.json and ignore .playwright-mcp/
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 16:22:16 +02:00
bfa5118fbe feat(libra/balance): clarify income/expenses cards with info captions
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 16:14:17 +02:00
30ad4cf512 feat(libra/balance): show lifetime income vs expenses breakdown
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 16:14:17 +02:00
26a89c58dd feat(libra/balance): show fiat balances alongside sats
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 16:14:17 +02:00
84456a849e fix(libra): drop payment-method field from income submission
Income now lands on the submitting user as a receivable rather than
on an entity asset account — see the matching libra backend change.
Removes the "Received into" select and its supporting state from the
form, and drops payment_method_account from IncomeEntryRequest /
IncomeEntry. The form is now description + amount + currency + revenue
account + optional reference.
2026-05-17 16:14:17 +02:00
0e03a424cb feat(libra): shrink filter controls on mobile
Drop the date-range/type-filter buttons and custom-date inputs from
h-8 to h-7 below md to claw back a bit of vertical space on phones,
keeping h-8 on tablet/desktop where it's comfortable.
2026-05-17 16:14:17 +02:00
5902aed431 feat(libra): drop User and Source rows from transaction cards
User row is noise on a personal history view, and Source is always
libra-api right now — both just clutter the card. Drop them; can
bring back if/when there's a second source to disambiguate.
2026-05-17 16:14:17 +02:00
4fee9c015d feat(libra): add income/expense type filter to transaction history
All / Income / Expenses toggle row with a Filter icon, aligned to the
Calendar-iconed date range row above. Filters transactionsToDisplay
client-side using the existing isIncome/isExpense helpers; works on
top of the search and date filters.
2026-05-17 16:14:17 +02:00
0390ecd4a0 feat(libra): color-code income/expense entries in transaction history
Left green/red stripe on each card plus a matching tint on the
income-entry / expense-entry tag badge — mirrors the Record page's
red/green palette so the two screens read consistently.
2026-05-17 16:14:17 +02:00
31cefac183 feat(libra): wire up income submission flow
Adds the frontend pair to libra's new POST /entries/income endpoint:
SUBMIT_INCOME in PermissionType, IncomeEntry/IncomeEntryRequest types,
ExpensesAPI.submitIncome wrapping the new endpoint, and the AddIncome
view collecting description / amount / revenue account / payment-method
account / currency / reference. Mirrors the existing expense flow so
non-admin users can log income on behalf of the organization for
super-user review.
2026-05-17 16:14:17 +02:00
d33359a901 feat(restaurant/checkout): tag outgoing payment with restaurant + order id
Adds extra={tag:'restaurant', restaurant_id, order_id} to the
POST /api/v1/payments body when paying a placed-order's bolt11.
Mirrors the same extras the extension stamps on its incoming
invoice, so a customer's wallet history can later filter or
surface restaurant orders rather than showing them as generic
Lightning sends.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 16:14:17 +02:00

View file

@ -236,7 +236,8 @@ export function useCheckout(): UseCheckoutReturn {
async function payBolt11Raw( async function payBolt11Raw(
bolt11: string, bolt11: string,
adminkey: string adminkey: string,
extra?: Record<string, unknown>
): Promise<void> { ): Promise<void> {
const response = await fetch(`${apiBaseUrl}/api/v1/payments`, { const response = await fetch(`${apiBaseUrl}/api/v1/payments`, {
method: 'POST', method: 'POST',
@ -244,7 +245,7 @@ export function useCheckout(): UseCheckoutReturn {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'X-Api-Key': adminkey, 'X-Api-Key': adminkey,
}, },
body: JSON.stringify({ out: true, bolt11 }), body: JSON.stringify({ out: true, bolt11, ...(extra ? { extra } : {}) }),
}) })
if (!response.ok) { if (!response.ok) {
let detail = response.statusText let detail = response.statusText
@ -272,7 +273,15 @@ export function useCheckout(): UseCheckoutReturn {
state.value.step = 'paying' state.value.step = 'paying'
state.value.currentRestaurantSlug = placed.restaurantSlug state.value.currentRestaurantSlug = placed.restaurantSlug
try { try {
await payBolt11Raw(placed.invoice.bolt11, adminkey) // Tag the outgoing payment so the customer's wallet history
// can later surface it as a restaurant order. Mirrors the
// `extra={"tag": "restaurant", ...}` the extension stamps on
// its incoming invoice.
await payBolt11Raw(placed.invoice.bolt11, adminkey, {
tag: 'restaurant',
restaurant_id: placed.restaurantId,
order_id: placed.order.id,
})
// Set semantics keeps `paidOrderIds` from re-renders; rebuild // Set semantics keeps `paidOrderIds` from re-renders; rebuild
// it on update so Vue picks up the change. // it on update so Vue picks up the change.
state.value.paidOrderIds = new Set([ state.value.paidOrderIds = new Set([