Product store — Code map
API — apps/api/src/products/
products.module.tsproducts.controller.ts—ProductsController(organizations/:orgId/products) andProductSalesController(organizations/:orgId/product-sales), both@RequiresFeature('product_store').public-products.controller.ts—@Public():public/products/:token,…/checkout(throttled),…/image,public/receipts/:token. Reads an optional Clerk session.product-store-access.service.ts— permission (products), store readiness, receipt channels.products.service.ts— catalog CRUD, archive/restore, image.product-image.service.ts— WebP re-encode, R2 storage, presigned read.product-checkout.service.ts— public page data and checkout.product-member-matcher.service.ts— session / phone / staff member resolution.product-sales.service.ts— sales list, desk sale, member link, resend, abandoned-checkout sweep.product-receipt.service.ts—product_sale.paidlistener, WhatsApp/SMS send, public receipt resolution.product-store.constants.ts—STORE_PROVIDERS, tokens, URLs.product-store.int.spec.ts+ driver — end-to-end against Postgres.
API — apps/api/src/sms/
sms-provider.types.ts,sms-provider.registry.ts,providers/micropay.provider.ts— adapter pattern, as for payment providers.sms.service.ts— platform account from env (SMS_PROVIDER,MICROPAY_SMS_TOKEN,MICROPAY_BASE_URL).organization-sms-settings.service.ts+ controller —organizations/:orgId/sms-settings(GET/PUT,organizationpermission).
API — changed
payments/services/webhook-processing.service.ts—settleProductSale.payments/product-sale-events.ts—PRODUCT_SALE_PAID.payments/providers/cardcom.provider.ts—ChargeOnly, documentQuantity,DocumentInfoon the webhook event.payments/services/payment-analytics.service.ts—productName/buyerNameon the transaction list; CSV writes objects as JSON.analytics/analytics-reports.service.ts—bySource.whatsapp/whatsapp-system-templates.ts—taikan_payment_receipt;whatsapp-templates.service.ts—ensureSystemTemplate.
Shared
libs/shared/src/lib/schemas/product.schema.ts— constants and response types.platform-tiers.ts—product_store(Pro+).permissions/matrix.ts—products(owner, admin).- Dictionaries:
productStore,productPage,productReceipt,nav.products,reports.sources.
Web
- Staff:
app/[lang]/(protected)/dashboard/products/page.tsx,components/products/*(screen, product dialog, link/QR dialog, record-sale dialog, sales table, member link, SMS settings card). - Public:
app/[lang]/p/[token](product page + checkout),app/[lang]/r/[token](receipt link),app/[lang]/pay/result(receipt link on a paid store purchase). - Settings → Payments: SMS receipts section.
- Reports:
revenue-sourcesview. Payments: store rows in the transactions table.
DB
libs/db/src/lib/schema/products.ts, enums inenums.ts, migration0178_product_store.sql.