Repository navigation
chore: adopt ecommerce 0.2.0, billing 0.7.0 and automation 0.6.0, drop workarounds - #15
Merged
Merged
Conversation
…p workarounds Ecommerce 0.2.0: use getEcommerce, word coupon refusals from the plugin's reason instead of looking the coupon up again, and drop the helper casts. Billing 0.7.0: customerInfoExtractor replaces the snapshotCustomer hook; shop invoices list real lines plus shipping with the coupon as discountAmount, and the invoice page shows the discount. Automation 0.6.0: retry, error handling and timeout settings are declared in the seeded workflows (stepRetryPlugin is gone); "Release unpaid orders" runs every minute and discards runs that released nothing; instrumentation.ts starts Payload and its job crons when the server starts. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0122PV8TJ7ELGdAX7H2hdrRU
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.
Upgrades the three plugins and removes the workarounds their new releases make unnecessary.
Ecommerce 0.2.0
getEcommercereplaces theuseEcommerce as ecommerceHelpersalias.quoteCartwords a refused code from the plugin'sreason(couponRefusalinsrc/lib/shop.ts). Gone: thefindCouponByCodere-lookup, the string match onCustomer usage limit reached, and the shop's own guest check for once-per-customer codes (the plugin refuses withcustomer_required; the message is still "Sign in to use this code: it works once per customer.").as Cart/as Ordercasts are removed.Billing 0.7.0
customerInfoExtractoris back insrc/plugins/billing.ts; thesnapshotCustomerhook is removed. A guest invoice has nocustomerand passescustomerInfo: { name, email }.discountAmount. The invoice page shows subtotal and discount when there is one.Automation 0.6.0
errorHandling: 'stop'and a 60 stimeout; the pager step declares its retries.stepRetryPluginis deleted.discardRunWhenand now runs every minute instead of every 15, so an order is released within about a minute of its 30-minute limit and idle minutes leave no run behind.src/instrumentation.tsloads Payload withcron: truewhen the server starts. Until now the crons started on the first page request.Schema
No migrations in this repo: the schema is pushed in development and tests, and e2e/CI seed in development mode. The two new columns (
invoices.discount_amount,workflows.discard_run_when) arrive that way;src/payload-types.tsis regenerated. A localkiln.dbfrom before this change may prompt onpnpm dev;pnpm seedresets it.Verification
pnpm lint,pnpm typecheck,pnpm test:int(121 tests).next build+next start, Next 16.4.6) with no request sent: Payload booted frominstrumentation.ts, the scheduler fired "Release unpaid orders" at the next minute and its idle run was discarded. The kiln webhook then produced a run whose log step used the pager step's output (Paged … (ticket PG-…)), which also showsPORTis set whenonInitruns at boot.next devbehaves the same.Tests
discountAmountand the right totals; an idle "Release unpaid orders" tick is reported asdiscardedand stores no run, a tick that releases an order is kept.WELCOME10and checks the discount on the invoice page.🤖 Generated with Claude Code
https://claude.ai/code/session_0122PV8TJ7ELGdAX7H2hdrRU