Repository navigation
feat: edit bookings (updateBooking) and bill at booking (0.1.4) - #35
Merged
Merged
Conversation
…g bill) (0.1.4)
updateBooking (booking:update) changes the doctor, collection type, time,
address and notes, adds tests and removes tests that have no results yet.
Samples follow the sample types. Billing follows in the same transaction:
an unpaid invoice is cancelled and issued again (invoice:cancel when tests
are removed, invoice:create); a paid or credited one gets a credit note
for removed tests (accounts:post) and a new invoice for added ones.
Booking.invoices lists every invoice of a booking; cancelBooking checks
them all. Audited as booking.update.
createBooking takes bill { payments, billDiscountPaise, applyTaxRules }
and issues the invoice in the same transaction (invoice:create; discount
invoice:discount; payments payment:create).
Needs client 1.10.0 (kits.json bumped); refresh the lockfile once it is
published.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018jBohjC7uBfVPopxyZBtS1
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Himanshu · project thread
This covers C1 and C2 from the handoff: a booking can be changed after it is made, and it can be billed in the same request that creates it.
updateBooking (
booking:update)A booking can be edited while it is booked, sample collected or in process.
nullclears the doctor, the time or the address.invoice:create, plusinvoice:cancelwhen tests are removedrefundablePaisesays what can be refunded.accounts:postinvoice:createBooking.invoicestays on the first live invoice. The newBooking.invoiceslists every invoice of the booking, andcancelBookingnow checks all of them.booking.updatewith what changed.Front desk can add tests, but can't remove a billed test, because that needs
invoice:canceloraccounts:post.createBooking
bill(C2)bill: { payments, billDiscountPaise, applyTaxRules }issues the invoice for the booked tests inside the booking's transaction. A bad discount or payment leaves no booking behind. It needsinvoice:create, plusinvoice:discountfor a discount andpayment:createfor payments, the same asissueInvoice.Releases needed first
kits.jsonalready points at it.npm install @mgpl-diagnostics/client@1.10.0. Until then, CI's check that every operation exists in the client fails onupdateBooking.No other kit changes: it uses db-kit 2.1.1 and finance-kit 1.0.1 as they are. Version 0.1.4. Tag
v0.1.4after merge; that release also carries #33.Checks
TEST_BACKENDS=pg npm test, with client 1.10.0 installed from its packed tarball, gives 260 passed, 0 failed. That includes 22 new end-to-end checks:docs/07-domain-flows.mdanddocs/examples/lab-day.graphqlare updated.Generated by Claude Code