Repository navigation
feat(ecommerce): add orders, web shop, discount codes, sales analytics and store automation - #1549
Merged
Merged
Conversation
…s and store automation - Orders, vendors, open hours and store settings (COD, per-workspace order numbers, stock locking, status transitions) with public API. - Customer web shop at /shop (signed shop token, cart, checkout, ratings) and order notifications for customers and members. - Discount codes (percentage, fixed amount, free shipping; limits, once per customer, contact-filter eligibility, auto-apply). - Sales analytics, Messenger product collection flow step, product search by message, store trigger/webhook events, abandoned-cart reminder cron and purchase contact filters. - One migration (20261021152239_ecommerce) for all ecommerce tables.
…er-line stock taken - Shop link (Public URL + preview) pinned to the bottom of every Ecommerce page; product edit page pins its own product link beside Save. - webshop.getLink accepts productId; Select inputs show option labels. - Order confirmation mode (default / flow / none) in store settings. - OrderItem.stockTaken so a cancel or delete returns exactly what was taken. - Web shop polish: loading skeletons, image carousel, related products, coupon ticket, checkout and bottom bars, shop locale. - All ecommerce tables in one migration, 20261023162208_ecommerce, last in the chain after main's latest migrations.
sung17
force-pushed
the
feat/ecommerce
branch
from
October 24, 2026 03:36
e529861 to
d49e731
Compare
… cards Meta refuses a whole carousel over one bad URL, so a product link or image that is not an http(s) URL is left off the card: Buy falls back to the product's shop page and the card goes without its image. toSafeWebUrl moves to @chatbotx.io/utils so the web shop and the cards share one check. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 task done
hello-jackytruong
referenced
this pull request
in hello-jackytruong/ChatWorkAI
Nov 22, 2026
…s and store automation (#1549) * feat(ecommerce): add orders, web shop, discount codes, sales analytics and store automation - Orders, vendors, open hours and store settings (COD, per-workspace order numbers, stock locking, status transitions) with public API. - Customer web shop at /shop (signed shop token, cart, checkout, ratings) and order notifications for customers and members. - Discount codes (percentage, fixed amount, free shipping; limits, once per customer, contact-filter eligibility, auto-apply). - Sales analytics, Messenger product collection flow step, product search by message, store trigger/webhook events, abandoned-cart reminder cron and purchase contact filters. - One migration (20261021152239_ecommerce) for all ecommerce tables. * feat(ecommerce): pin shop link bar, add order confirmation mode and per-line stock taken - Shop link (Public URL + preview) pinned to the bottom of every Ecommerce page; product edit page pins its own product link beside Save. - webshop.getLink accepts productId; Select inputs show option labels. - Order confirmation mode (default / flow / none) in store settings. - OrderItem.stockTaken so a cancel or delete returns exactly what was taken. - Web shop polish: loading skeletons, image carousel, related products, coupon ticket, checkout and bottom bars, shop locale. - All ecommerce tables in one migration, 20261023162208_ecommerce, last in the chain after main's latest migrations. * fix(ecommerce): drop non-web product links and images from collection cards Meta refuses a whole carousel over one bad URL, so a product link or image that is not an http(s) URL is left off the card: Buy falls back to the product's shop page and the card goes without its image. toSafeWebUrl moves to @chatbotx.io/utils so the web shop and the cards share one check. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> --------- Co-authored-by: Deathgiver <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
Summary
docs/ecommerce.md.Changes
packages/database/drizzle/20261023162208_ecommerce. It holds every ecommerce table and enum:EcommerceSettings,EcommerceOpenHours,EcommerceOrderCounter,Vendor,Order,OrderItem,OrderStatusHistory,Cart,DiscountCode,DiscountCodeRedemption.main's snapshot chain.Product.vendor(free text) intoVendorrows with a hand-written backfill, run before the column is dropped.db:check-driftis clean.packages/business): order, discount-code, webshop, ecommerce-settings, vendor, open-hours and ecommerce-analytics services.numeric(19,4), throughpackages/utils/src/money.ts.OrderItem.stockTaken.ORDER_STATUS_TRANSITIONS.{{shop_token}}URL for flow buttons./shop/<workspaceId>.orders,discountCodes,productVendors,ecommerceSettings,openHours,ecommerceAnalytics,webshop,carts.sendCollectionstep, rendered as a carousel on Messenger.cartSentmessage creates the cart and replies with a CHECK OUT link.newOrder,orderAccepted/Shipped/Concluded/Cancelled,productOrdered,productAddedToCart/RemovedFromCart,categoryAddedToCart,cartAbandoned.scanAbandonedCartscron, guarded per cart withwithBlockedOwnerGuard.docs/ecommerce.md,docs/product-messages.md,docs/flows.md, CLI README.Invariant 23 exemption
The end-customer web shop (
/shop/*pages and their server actions for cart, checkout, discount code and rating) is a customer-facing public page. It is authorised by the signed shop token, not a workspace token, so it has no public API procedure. Everything a merchant or agent does has one, includingwebshop.getLink, which returns the same shop link the UI copies.Security notes
checkoutLink,productUrl) accept http(s) only, and are re-checked at render.Test plan
pnpm lint(includesdb:check-drift)check-types: database, business, worker, builderpnpm test: database 1438, business 7571, worker 3922, builder 8457 — all passingdb:migrateon a fresh database