소스 검색

Add privacy policy and terms of service pages

feature/homepage
fahmisaad 4 일 전
부모
커밋
fb1ddba7e3

+ 6
- 0
.env 파일 보기

@@ -85,6 +85,12 @@ AI_FAKE_DELAY=
85 85
 ANTHROPIC_API_KEY=
86 86
 DEEPSEEK_API_KEY=
87 87
 
88
+# Shown on /privacy and /terms. Fill these in .env.local once the business is registered.
89
+LEGAL_OPERATOR=
90
+LEGAL_REGISTRATION=
91
+LEGAL_EMAIL=
92
+LEGAL_ADDRESS=
93
+
88 94
 # Must be longer than the longest background job (AI jobs can take several minutes).
89 95
 DB_QUEUE_RETRY_AFTER=600
90 96
 # Optional. Lets Stripe tell the app about payments directly. Starts with whsec_.

+ 59
- 47
PROGRESS.md 파일 보기

@@ -4,8 +4,8 @@ This file is the single source of truth for the project plan and status.
4 4
 Update it at the end of every work session.
5 5
 
6 6
 **Last updated:** 2026-11-22
7
-**Current step:** Our own home page (built on `feature/homepage`); Step 9 parts 1–7 done, part 8 on hold
8
-**Next action:** Commit the home page on `feature/homepage`. Then choose: Step 10 (before launch), Step 7 part 2 (needs an EasyParcel API key), or part 8 (reviews). `main` and the redesign branches stay apart for comparison
7
+**Current step:** Step 10 (before launch): home page done, privacy policy and terms done (on `feature/homepage`, not committed yet); Step 9 part 8 on hold
8
+**Next action:** Commit the privacy and terms pages. Have a lawyer read both pages before launch, and fill the `LEGAL_` lines in `.env.local` once the business is registered. Then choose: backup AI provider, hosting, Stripe Connect (who receives the money), Step 7 part 2, or part 8. `main` and the redesign branches stay apart for comparison
9 9
 
10 10
 Status marks: `[ ]` not started · `[~]` in progress · `[x]` done
11 11
 
@@ -265,16 +265,26 @@ Changing from Claude to another AI model (or back) must be a settings change, no
265 265
 - The hero picture moves, in the way afilink's does (studied 2026-11-22): on wide screens (1024px and up) the hero stays pinned while the visitor scrolls, and scrolling puts the sample store together (the merchant's words, the store's banner and three products fly into place, then the frame and the feature tags appear). A hint says "Scroll to watch your store come together". On phones and tablets it plays once by itself after the page opens. The feature tags float gently up and down afterwards (CSS `h-bob`, 6 and 8 seconds, out of step). Visitors whose device asks for less motion see the finished picture with nothing moving.
266 266
 - The sample store and the "You write" bubble also float slowly up and down all the time, like afilink's phone (CSS `h-float`, 7 and 9 seconds, out of step). It moves `transform`, so it adds to the hover lift instead of fighting it.
267 267
 - More motion (2026-11-22), helpers in `resources/js/components/home/motion.ts`, styles `h-*` in `app.css`:
268
-  1. Sections fade up as they come into view (`data-reveal` on headings and cards, cards one after another). Things already on the first screen never hide.
269
-  2. The "You write" bubble types itself out first; on phones the store builds once the typing ends. The full words hold the bubble's size so nothing jumps.
270
-  3. The chat example plays like a real chat when it comes into view: message, typing dots, reply, the change waiting for an OK, then "Confirmed". A "Play again" button replays it.
271
-  4. The styles section has one big sample store that changes look every 3.2 seconds, with a timer bar under the look that is showing. Clicking a look shows it and stops the changing.
272
-  5. A line runs through the 3 steps (across on wide screens, down the left on phones) and fills in green as the visitor scrolls; each number lights up when the line reaches it.
273
-  6. A strip of Malaysian shop types (Sambal, Batik, Skincare, Kek lapis…) drifts sideways under the hero; hovering stops it.
274
-  Everything shows its finished state, with nothing moving, when the device asks for less motion.
268
+    1. Sections fade up as they come into view (`data-reveal` on headings and cards, cards one after another). Things already on the first screen never hide.
269
+    2. The "You write" bubble types itself out first; on phones the store builds once the typing ends. The full words hold the bubble's size so nothing jumps.
270
+    3. The chat example plays like a real chat when it comes into view: message, typing dots, reply, the change waiting for an OK, then "Confirmed". A "Play again" button replays it.
271
+    4. The styles section has one big sample store that changes look every 3.2 seconds, with a timer bar under the look that is showing. Clicking a look shows it and stops the changing.
272
+    5. A line runs through the 3 steps (across on wide screens, down the left on phones) and fills in green as the visitor scrolls; each number lights up when the line reaches it.
273
+    6. A strip of Malaysian shop types (Sambal, Batik, Skincare, Kek lapis…) drifts sideways under the hero; hovering stops it.
274
+       Everything shows its finished state, with nothing moving, when the device asks for less motion.
275 275
 - Hovering lifts things: the sample store or the "You write" bubble rises and moves in front of the other (the bubble also straightens), and each pricing card rises with a deeper shadow. Uses the separate CSS `translate` and `scale` properties so it does not fight the scroll animation; skipped when the device asks for less motion, and phones have no hover.
276 276
 - The tags are placed so they never cover the store's words or its button (the WhatsApp tag sits beside "Shop the jars" inside the banner), and the flying pieces stay on the right so the store-name form is never covered.
277 277
 
278
+### Privacy policy and terms (added 2026-11-22)
279
+
280
+- `/privacy` and `/terms` (`LegalController`, `resources/js/pages/legal/`), with the home page's look (shared colours, fonts and logo in `resources/js/components/home/brand.tsx`). Linked from the home page footer and the sign-up page ("By creating an account, you agree to…").
281
+- Written in plain English for Malaysian law: the Personal Data Protection Act 2010 (with the 2024 changes: breach notices, data portability), the Consumer Protection Act 1999 and its online-selling rules. A first draft, not checked by a lawyer yet.
282
+- The merchant is the seller; we hold shoppers' details for the merchant.
283
+- The pages name the AI companies the tasks use right now, read from `config/ai.php` and the company list in `config/legal.php`. Switching a model in `.env` keeps them truthful. A new AI provider must be added to `config/legal.php` too (a test fails otherwise).
284
+- They say what goes to the AI (brand description, AI messages, store design and words, product names, prices and photo names) and what never does (passwords, cards, shoppers' details and orders). Keep this true when the AI is given more.
285
+- Who runs the service, the SSM number, contact email and address come from `LEGAL_OPERATOR`, `LEGAL_REGISTRATION`, `LEGAL_EMAIL` (falls back to `MAIL_FROM_ADDRESS`) and `LEGAL_ADDRESS`. The "last changed" date is in `config/legal.php`; change it whenever the wording changes.
286
+- Promises made in the terms: 30 days' notice before a price change or closing the service, 14 days before important changes to the terms, no refunds for unused days, replies to data requests within 21 days. The terms do not yet say how merchants are paid; update them once Stripe Connect is decided.
287
+
278 288
 ### Category guides for the AI (agreed 2026-11-17)
279 289
 
280 290
 - The category the merchant picks on the Create store page (Fashion, Beauty, Food, Home, Electronics, Health, Kids, Digital, Other) chooses a short design guide that is sent to the AI with the brand description.
@@ -443,7 +453,7 @@ Notes:
443 453
 - [x] Our own home page at `/` (done 2026-11-22, branch `feature/homepage`, made from the part 7 branch)
444 454
 
445 455
 - [ ] Choose hosting and deploy
446
-- [ ] Privacy policy and terms of service (name the AI providers)
456
+- [x] Privacy policy and terms of service, naming the AI providers (done 2026-11-22, `/privacy` and `/terms`; a lawyer should read them before launch)
447 457
 - [ ] Backup AI provider in case one is down
448 458
 - [ ] Spending caps on every AI account
449 459
 
@@ -544,6 +554,7 @@ Then, from the project folder:
544 554
 | Collections, bento, video              | `app/Models/Collection.php`, `CollectionController`, `storefront/sections/shop-by.tsx`, `bento.tsx`, `video.tsx`, `storefront/pages/shop.tsx`                                          |
545 555
 | Video and Bento boxes                  | `app/StorePlan/SectionEditor.php`, `VideoSectionController`, `BentoSectionController`, `components/stores/video-box.tsx`, `bento-box.tsx`                                              |
546 556
 | Home page                              | `resources/js/pages/home.tsx`, `app/Http/Controllers/HomeController.php`                                                                                                               |
557
+| Privacy and terms                      | `resources/js/pages/legal/`, `app/Http/Controllers/LegalController.php`, `config/legal.php`                                                                                            |
547 558
 | Storefront words (English, Malay)      | `resources/js/storefront/text.ts`                                                                                                                                                      |
548 559
 | Store plan format (frontend types)     | `resources/js/storefront/types.ts`                                                                                                                                                     |
549 560
 | Storefront renderer and sections       | `resources/js/storefront/renderer.tsx`, `resources/js/storefront/sections/`                                                                                                            |
@@ -574,40 +585,41 @@ Moved into **Step 9 — Modern store design** on 2026-11-17.
574 585
 
575 586
 Add one line per work session: date, what was done, what is next.
576 587
 
577
-| Date       | Done                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Next                                                            |
578
-| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
579
-| 2026-11-14 | Planning. Chose stack, market, payments, AI models, plan prices. Checked local tools. Created this file. All proposed decisions confirmed. Added the rule that the AI model must be easy to change.                                                                                                                                                                                                                                                                    | Install PHP 8.4, create the Laravel project (Step 0 and Step 1) |
580
-| 2026-11-14 | Installed PHP 8.4. Created the Laravel 13 + React project, MySQL database and git repo. Built create-a-store flow and dashboard. 51 tests pass; login and store creation checked in the browser. Step 0 and Step 1 done.                                                                                                                                                                                                                                               | Step 2: store plan format, sections, renderer                   |
581
-| 2026-11-14 | Step 2 done on branch `feature/store-sections-renderer`: store plan format and validator, 10 sections with 2 variants each, renderer, dashboard preview, sample design. 69 tests pass; storefront checked in the browser on desktop and mobile.                                                                                                                                                                                                                        | Step 3: swappable AI layer and store generation                 |
582
-| 2026-11-14 | First commit made and pushed to the private repository on git.mirfalah.my (branch `feature/store-sections-renderer`).                                                                                                                                                                                                                                                                                                                                                  | Step 3: swappable AI layer and store generation                 |
583
-| 2026-11-14 | Step 3 built on branch `feature/ai-generation`: swappable AI layer (Claude, DeepSeek, fake), full store generation, chat edits, background job with progress screen, plan limits. 92 tests pass; whole flow checked in the browser with the fake provider. Not yet run against real Claude or DeepSeek.                                                                                                                                                                | Add API keys, run the real test, then Step 4                    |
584
-| 2026-11-14 | Split settings into `.env` (uploaded, no secrets, AI settings blank) and `.env.local` (private, complete). Removed `.env.example`.                                                                                                                                                                                                                                                                                                                                     | Real AI test, then Step 4                                       |
585
-| 2026-11-14 | Real AI test passed: Claude Sonnet 5.5 generated two stores, DeepSeek made two chat edits. Tuned the prompt for more varied layouts. Step 3 done.                                                                                                                                                                                                                                                                                                                      | Merge into `main`, then Step 4: products                        |
586
-| 2026-11-14 | Step 4 part 1 on branch `feature/commerce`: store plan version 2 with pages, products with photos, Shop page, product page, real products on the home page. 108 tests pass; checked in the browser; real Claude and DeepSeek re-tested with the new format.                                                                                                                                                                                                            | Step 4 part 2: cart, Stripe checkout, orders, email             |
587
-| 2026-11-14 | Cart built on branch `feature/commerce`: add to cart, quantity, remove, subtotal, header count, stock limits. 118 tests pass; checked in the browser.                                                                                                                                                                                                                                                                                                                  | Stripe checkout (needs test keys), orders, email                |
588
-| 2026-11-15 | Step 4 finished on branch `feature/commerce`: checkout with Stripe (test mode), orders for the merchant, order confirmation email. 133 tests pass. A real Stripe test payment worked end to end: order paid, stock lowered, email written to the log.                                                                                                                                                                                                                  | Merge into `main`, then Step 5: publishing                      |
589
-| 2026-11-15 | Merged Steps 3 and 4 into `main` and pushed.                                                                                                                                                                                                                                                                                                                                                                                                                           | Step 5: publishing                                              |
590
-| 2026-11-15 | Content pages by chat on branch `feature/content-pages`: add, rename and remove pages, each page at its own address, menu links guaranteed by the app. 139 tests pass; tested with real DeepSeek and in the browser. Step 4 is now complete except the known gaps.                                                                                                                                                                                                     | Step 5: publishing                                              |
591
-| 2026-11-15 | Planning only. Added Step 8 (discount codes, product variants, bundles with linked stock, chat commands with a confirm step), placed after Malaysia features. "Before launch" is now Step 9. Cart items redesigned as cards.                                                                                                                                                                                                                                           | Step 5: publishing                                              |
592
-| 2026-11-15 | Step 5 on branch `feature/publishing`: publish and take offline, live stores on their own address, design changes private until published again, dashboard blocked on store addresses. 150 tests pass; Luna Skin published and checked in the browser at `luna-skin.localhost:8000`.                                                                                                                                                                                   | Step 6: subscription billing                                    |
593
-| 2026-11-16 | Step 6 on branch `feature/billing`: plans table, 14-day trial, Stripe subscriptions (subscribe, switch, cancel, undo), Billing page, limits enforced, live stores offline when there is no plan. 164 tests pass; real Stripe test subscription to Growth, cancel and undo all worked. Switched the session model from Fable 5.2 to Opus 5.5.                                                                                                                           | Merge into `main`, then Step 7                                  |
594
-| 2026-11-16 | Step 7 part 1 on branch `feature/malaysia-shipping`: store settings, flat shipping fees (west, east, free over), mark as shipped with tracking and email, WhatsApp buttons, Malay checkout messages, Malaysian phone check. Fixed live-store menu links on pages other than home (bug from Step 5). 178 tests pass; real Stripe test payment with shipping to Sabah worked.                                                                                            | Merge, then Step 7 part 2 or Step 8                             |
595
-| 2026-11-16 | Featured product fix on branch `feature/featured-product-link` (built on `feature/malaysia-shipping`): the section links to a real product (Design tab picker or chat), shows its real name, price, photo and page, and hides the made-up price otherwise. Added a check that marks chat edits that changed nothing. 191 tests pass; checked in the browser and with real DeepSeek.                                                                                    | Merge both branches, then Step 7 part 2 or Step 8               |
596
-| 2026-11-16 | Planning only. Added "more design styles" to later improvements: style options (effects, backgrounds, buttons, spacing, motion), more fonts, more layouts per section, more section types.                                                                                                                                                                                                                                                                             | Merge branches, then Step 7 part 2 or Step 8                    |
597
-| 2026-11-16 | Step 8 part 1 on branch `feature/discount-codes`: discount codes (merchant Discounts tab, cart code box, order record, Stripe coupon, use counted when paid). 207 tests pass; real Stripe test payment with a 20% code worked.                                                                                                                                                                                                                                         | Merge, then product variants                                    |
598
-| 2026-11-16 | Step 8 part 2 on branch `feature/product-variants` (built on `feature/discount-codes`): product options and variants, option buttons on the product page, variant cart lines, orders and stock. 217 tests pass; real Stripe test payment for a 100ml variant with a discount code worked.                                                                                                                                                                              | Merge both branches, then bundles                               |
599
-| 2026-11-16 | Step 8 part 3 on branch `feature/bundles`: bundles with linked stock (bundle editor in the product form, "What's inside" on the product page, shared stock check at checkout, order shows what to pack). 223 tests pass; real Stripe test payment for "Glow Starter Set" (cleanser + 50ml moisturiser, RM 69 + RM 8 shipping) lowered both items' stock.                                                                                                               | Merge, then chat commands                                       |
600
-| 2026-11-17 | Step 8 part 4 on branch `feature/chat-commands`: chat commands for products, discount codes and bundles, with Confirm and Cancel in the chat. Shared discount rules. Fixed a test that failed by chance (random stock). 233 tests pass; with real DeepSeek, "GLOW15 until end of month + 100ml to RM 52" was proposed, confirmed and saved; a product + bundle request was proposed correctly and cancelled.                                                           | Merge; then automatic discounts, Step 7 part 2 or Step 9        |
601
-| 2026-11-17 | Step 8 part 5 on branch `feature/automatic-discounts`: automatic discounts (Discounts tab form, best-of-one rule with codes, cart nudge, product page note, order/Stripe/email name, chat command). Step 8 is done. 243 tests pass; real Stripe test payment with "Glow Week" (2 cleansers, −RM 8.40, total RM 83.60) worked, GLOW15 correctly won when typed; real DeepSeek proposed a sunscreen-only sale correctly (cancelled).                                     | Merge; then Step 7 part 2 or Step 9                             |
602
-| 2026-11-17 | Chat commands can write product descriptions from the product name (same branch, `feature/automatic-discounts`). Real DeepSeek test found the AI guessing bundle contents, so bundle contents are now listed for it; second try was accurate. 244 tests pass.                                                                                                                                                                                                          | Merge; then Step 7 part 2 or Step 9                             |
603
-| 2026-11-17 | Researched 2026 store design trends and published a comparison page. Added Step 9 — Modern store design (6 parts) and the category guides decision; "Before launch" is now Step 10.                                                                                                                                                                                                                                                                                    | Step 9 part 1: photos first                                     |
604
-| 2026-11-18 | Step 9 part 1 on branch `redesign/part-1-photo-hero`: full-width and split photo heroes, hero photo upload and picker in the Design tab, automatic product photo, second photo on hover, letter placeholders, AI told about photos. 251 tests pass; checked in the browser at desktop and phone width with a test banner on Luna Skin.                                                                                                                                 | Merge, then part 2                                              |
605
-| 2026-11-18 | Step 9 part 2 on branch `redesign/part-2-announcement-bar` (from part 1): announcement bar (automatic lines + merchant lines, Settings card) and trust row section with live facts. Plan checker now supports "required if" rules. 257 tests pass; real DeepSeek added a trust row to Luna Skin correctly; checked in the browser.                                                                                                                                     | Commit; part 3 branches from part 2                             |
606
-| 2026-11-18 | Step 9 part 3 on branch `redesign/part-3-product-page` (from part 2): folding sections (form, chat with merge by title), trust points, sticky phone add-to-cart bar, pairs well with, phone menu, sticky photos. Found and fixed the sticky bar hiding under the header. 261 tests pass; real DeepSeek wrote a sensible "How to use" for the sunscreen (confirmed); checked at phone width.                                                                            | Commit; part 4 branches from part 3                             |
607
-| 2026-11-19 | Step 9 part 4 on branch `redesign/part-4-style-options` (from part 3): style options, six ready-made looks with a Style box, 12 more fonts, gentle motion, AI style rules. Fixed fade-in hiding a section that was already partly on screen. "More layouts per section" moved to a new part 5; category guides are now part 6 and collections part 7. 266 tests pass; Bold look and a real DeepSeek "more premium and elegant" change both checked in the browser.     | Commit; part 5 branches from part 4                             |
608
-| 2026-11-19 | Step 9 part 5 on branch `redesign/part-5-section-layouts` (from part 4): 7 new section layouts (products carousel and large, featured stacked, about statement, reviews wall, FAQ cards, newsletter split, footer columns) and a Layouts box. 270 tests pass; every layout checked in the browser on Luna Skin; long About statements now shown a step smaller.                                                                                                        | Commit; part 6 branches from part 5                             |
609
-| 2026-11-21 | Step 9 part 6 on branch `redesign/part-6-category-guides` (from part 5): category design guides and "looks to avoid" for the AI. 275 tests pass; generated two real test stores with Claude Sonnet (Dapur Mak Teh, food; Seri Anggun, fashion) and they came out clearly different.                                                                                                                                                                                    | Commit; then part 7 or merge                                    |
610
-| 2026-11-21 | Decided to keep `main` and the redesign apart for comparison. Split reviews out as part 8. Step 9 part 7 on branch `redesign/part-7-collections-bento-video` (from part 6): collections (Products tab, chat, pages, links), shop by, bento and video sections, with AI checks for collection names and video addresses. 282 tests pass; real DeepSeek created two collections for Luna Skin (confirmed) and added shop by and bento correctly; checked in the browser. | Commit; part 8 branches from part 7                             |
611
-| 2026-11-22 | Added Video and Bento boxes to the Design tab (same branch, part 7), so both can be added and edited without chat. The merchant added a real YouTube video to Luna Skin by chat; it plays in the preview. 286 tests pass.                                                                                                                                                                                                                                              | Commit part 7; then part 8                                      |
612
-| 2026-11-22 | Part 7 committed on `redesign/part-7-collections-bento-video`. Part 8 (real reviews) put on hold by the merchant.                                                                                                                                                                                                                                                                                                                                                      | Choose next step                                                |
613
-| 2026-11-22 | Built our own home page on branch `feature/homepage`: content outline like afilink.app with our own look, real plan prices, store-name box that fills the Create store form. 288 tests pass; checked on desktop and phone. Then made the hero picture move like afilink's (pinned scroll on wide screens, plays once on phones, floating tags), fixed tags covering text, added hover lift on the hero pieces and pricing cards, made the store and bubble float, and added six more animations (fade-up, typing bubble, playing chat, changing styles, steps line, shop-types strip).  | Commit; choose next step                                        |
588
+| Date       | Done                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Next                                                            |
589
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
590
+| 2026-11-14 | Planning. Chose stack, market, payments, AI models, plan prices. Checked local tools. Created this file. All proposed decisions confirmed. Added the rule that the AI model must be easy to change.                                                                                                                                                                                                                                                                                                                                                                                    | Install PHP 8.4, create the Laravel project (Step 0 and Step 1) |
591
+| 2026-11-14 | Installed PHP 8.4. Created the Laravel 13 + React project, MySQL database and git repo. Built create-a-store flow and dashboard. 51 tests pass; login and store creation checked in the browser. Step 0 and Step 1 done.                                                                                                                                                                                                                                                                                                                                                               | Step 2: store plan format, sections, renderer                   |
592
+| 2026-11-14 | Step 2 done on branch `feature/store-sections-renderer`: store plan format and validator, 10 sections with 2 variants each, renderer, dashboard preview, sample design. 69 tests pass; storefront checked in the browser on desktop and mobile.                                                                                                                                                                                                                                                                                                                                        | Step 3: swappable AI layer and store generation                 |
593
+| 2026-11-14 | First commit made and pushed to the private repository on git.mirfalah.my (branch `feature/store-sections-renderer`).                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Step 3: swappable AI layer and store generation                 |
594
+| 2026-11-14 | Step 3 built on branch `feature/ai-generation`: swappable AI layer (Claude, DeepSeek, fake), full store generation, chat edits, background job with progress screen, plan limits. 92 tests pass; whole flow checked in the browser with the fake provider. Not yet run against real Claude or DeepSeek.                                                                                                                                                                                                                                                                                | Add API keys, run the real test, then Step 4                    |
595
+| 2026-11-14 | Split settings into `.env` (uploaded, no secrets, AI settings blank) and `.env.local` (private, complete). Removed `.env.example`.                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Real AI test, then Step 4                                       |
596
+| 2026-11-14 | Real AI test passed: Claude Sonnet 5.5 generated two stores, DeepSeek made two chat edits. Tuned the prompt for more varied layouts. Step 3 done.                                                                                                                                                                                                                                                                                                                                                                                                                                      | Merge into `main`, then Step 4: products                        |
597
+| 2026-11-14 | Step 4 part 1 on branch `feature/commerce`: store plan version 2 with pages, products with photos, Shop page, product page, real products on the home page. 108 tests pass; checked in the browser; real Claude and DeepSeek re-tested with the new format.                                                                                                                                                                                                                                                                                                                            | Step 4 part 2: cart, Stripe checkout, orders, email             |
598
+| 2026-11-14 | Cart built on branch `feature/commerce`: add to cart, quantity, remove, subtotal, header count, stock limits. 118 tests pass; checked in the browser.                                                                                                                                                                                                                                                                                                                                                                                                                                  | Stripe checkout (needs test keys), orders, email                |
599
+| 2026-11-15 | Step 4 finished on branch `feature/commerce`: checkout with Stripe (test mode), orders for the merchant, order confirmation email. 133 tests pass. A real Stripe test payment worked end to end: order paid, stock lowered, email written to the log.                                                                                                                                                                                                                                                                                                                                  | Merge into `main`, then Step 5: publishing                      |
600
+| 2026-11-15 | Merged Steps 3 and 4 into `main` and pushed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Step 5: publishing                                              |
601
+| 2026-11-15 | Content pages by chat on branch `feature/content-pages`: add, rename and remove pages, each page at its own address, menu links guaranteed by the app. 139 tests pass; tested with real DeepSeek and in the browser. Step 4 is now complete except the known gaps.                                                                                                                                                                                                                                                                                                                     | Step 5: publishing                                              |
602
+| 2026-11-15 | Planning only. Added Step 8 (discount codes, product variants, bundles with linked stock, chat commands with a confirm step), placed after Malaysia features. "Before launch" is now Step 9. Cart items redesigned as cards.                                                                                                                                                                                                                                                                                                                                                           | Step 5: publishing                                              |
603
+| 2026-11-15 | Step 5 on branch `feature/publishing`: publish and take offline, live stores on their own address, design changes private until published again, dashboard blocked on store addresses. 150 tests pass; Luna Skin published and checked in the browser at `luna-skin.localhost:8000`.                                                                                                                                                                                                                                                                                                   | Step 6: subscription billing                                    |
604
+| 2026-11-16 | Step 6 on branch `feature/billing`: plans table, 14-day trial, Stripe subscriptions (subscribe, switch, cancel, undo), Billing page, limits enforced, live stores offline when there is no plan. 164 tests pass; real Stripe test subscription to Growth, cancel and undo all worked. Switched the session model from Fable 5.2 to Opus 5.5.                                                                                                                                                                                                                                           | Merge into `main`, then Step 7                                  |
605
+| 2026-11-16 | Step 7 part 1 on branch `feature/malaysia-shipping`: store settings, flat shipping fees (west, east, free over), mark as shipped with tracking and email, WhatsApp buttons, Malay checkout messages, Malaysian phone check. Fixed live-store menu links on pages other than home (bug from Step 5). 178 tests pass; real Stripe test payment with shipping to Sabah worked.                                                                                                                                                                                                            | Merge, then Step 7 part 2 or Step 8                             |
606
+| 2026-11-16 | Featured product fix on branch `feature/featured-product-link` (built on `feature/malaysia-shipping`): the section links to a real product (Design tab picker or chat), shows its real name, price, photo and page, and hides the made-up price otherwise. Added a check that marks chat edits that changed nothing. 191 tests pass; checked in the browser and with real DeepSeek.                                                                                                                                                                                                    | Merge both branches, then Step 7 part 2 or Step 8               |
607
+| 2026-11-16 | Planning only. Added "more design styles" to later improvements: style options (effects, backgrounds, buttons, spacing, motion), more fonts, more layouts per section, more section types.                                                                                                                                                                                                                                                                                                                                                                                             | Merge branches, then Step 7 part 2 or Step 8                    |
608
+| 2026-11-16 | Step 8 part 1 on branch `feature/discount-codes`: discount codes (merchant Discounts tab, cart code box, order record, Stripe coupon, use counted when paid). 207 tests pass; real Stripe test payment with a 20% code worked.                                                                                                                                                                                                                                                                                                                                                         | Merge, then product variants                                    |
609
+| 2026-11-16 | Step 8 part 2 on branch `feature/product-variants` (built on `feature/discount-codes`): product options and variants, option buttons on the product page, variant cart lines, orders and stock. 217 tests pass; real Stripe test payment for a 100ml variant with a discount code worked.                                                                                                                                                                                                                                                                                              | Merge both branches, then bundles                               |
610
+| 2026-11-16 | Step 8 part 3 on branch `feature/bundles`: bundles with linked stock (bundle editor in the product form, "What's inside" on the product page, shared stock check at checkout, order shows what to pack). 223 tests pass; real Stripe test payment for "Glow Starter Set" (cleanser + 50ml moisturiser, RM 69 + RM 8 shipping) lowered both items' stock.                                                                                                                                                                                                                               | Merge, then chat commands                                       |
611
+| 2026-11-17 | Step 8 part 4 on branch `feature/chat-commands`: chat commands for products, discount codes and bundles, with Confirm and Cancel in the chat. Shared discount rules. Fixed a test that failed by chance (random stock). 233 tests pass; with real DeepSeek, "GLOW15 until end of month + 100ml to RM 52" was proposed, confirmed and saved; a product + bundle request was proposed correctly and cancelled.                                                                                                                                                                           | Merge; then automatic discounts, Step 7 part 2 or Step 9        |
612
+| 2026-11-17 | Step 8 part 5 on branch `feature/automatic-discounts`: automatic discounts (Discounts tab form, best-of-one rule with codes, cart nudge, product page note, order/Stripe/email name, chat command). Step 8 is done. 243 tests pass; real Stripe test payment with "Glow Week" (2 cleansers, −RM 8.40, total RM 83.60) worked, GLOW15 correctly won when typed; real DeepSeek proposed a sunscreen-only sale correctly (cancelled).                                                                                                                                                     | Merge; then Step 7 part 2 or Step 9                             |
613
+| 2026-11-17 | Chat commands can write product descriptions from the product name (same branch, `feature/automatic-discounts`). Real DeepSeek test found the AI guessing bundle contents, so bundle contents are now listed for it; second try was accurate. 244 tests pass.                                                                                                                                                                                                                                                                                                                          | Merge; then Step 7 part 2 or Step 9                             |
614
+| 2026-11-17 | Researched 2026 store design trends and published a comparison page. Added Step 9 — Modern store design (6 parts) and the category guides decision; "Before launch" is now Step 10.                                                                                                                                                                                                                                                                                                                                                                                                    | Step 9 part 1: photos first                                     |
615
+| 2026-11-18 | Step 9 part 1 on branch `redesign/part-1-photo-hero`: full-width and split photo heroes, hero photo upload and picker in the Design tab, automatic product photo, second photo on hover, letter placeholders, AI told about photos. 251 tests pass; checked in the browser at desktop and phone width with a test banner on Luna Skin.                                                                                                                                                                                                                                                 | Merge, then part 2                                              |
616
+| 2026-11-18 | Step 9 part 2 on branch `redesign/part-2-announcement-bar` (from part 1): announcement bar (automatic lines + merchant lines, Settings card) and trust row section with live facts. Plan checker now supports "required if" rules. 257 tests pass; real DeepSeek added a trust row to Luna Skin correctly; checked in the browser.                                                                                                                                                                                                                                                     | Commit; part 3 branches from part 2                             |
617
+| 2026-11-18 | Step 9 part 3 on branch `redesign/part-3-product-page` (from part 2): folding sections (form, chat with merge by title), trust points, sticky phone add-to-cart bar, pairs well with, phone menu, sticky photos. Found and fixed the sticky bar hiding under the header. 261 tests pass; real DeepSeek wrote a sensible "How to use" for the sunscreen (confirmed); checked at phone width.                                                                                                                                                                                            | Commit; part 4 branches from part 3                             |
618
+| 2026-11-19 | Step 9 part 4 on branch `redesign/part-4-style-options` (from part 3): style options, six ready-made looks with a Style box, 12 more fonts, gentle motion, AI style rules. Fixed fade-in hiding a section that was already partly on screen. "More layouts per section" moved to a new part 5; category guides are now part 6 and collections part 7. 266 tests pass; Bold look and a real DeepSeek "more premium and elegant" change both checked in the browser.                                                                                                                     | Commit; part 5 branches from part 4                             |
619
+| 2026-11-19 | Step 9 part 5 on branch `redesign/part-5-section-layouts` (from part 4): 7 new section layouts (products carousel and large, featured stacked, about statement, reviews wall, FAQ cards, newsletter split, footer columns) and a Layouts box. 270 tests pass; every layout checked in the browser on Luna Skin; long About statements now shown a step smaller.                                                                                                                                                                                                                        | Commit; part 6 branches from part 5                             |
620
+| 2026-11-21 | Step 9 part 6 on branch `redesign/part-6-category-guides` (from part 5): category design guides and "looks to avoid" for the AI. 275 tests pass; generated two real test stores with Claude Sonnet (Dapur Mak Teh, food; Seri Anggun, fashion) and they came out clearly different.                                                                                                                                                                                                                                                                                                    | Commit; then part 7 or merge                                    |
621
+| 2026-11-21 | Decided to keep `main` and the redesign apart for comparison. Split reviews out as part 8. Step 9 part 7 on branch `redesign/part-7-collections-bento-video` (from part 6): collections (Products tab, chat, pages, links), shop by, bento and video sections, with AI checks for collection names and video addresses. 282 tests pass; real DeepSeek created two collections for Luna Skin (confirmed) and added shop by and bento correctly; checked in the browser.                                                                                                                 | Commit; part 8 branches from part 7                             |
622
+| 2026-11-22 | Added Video and Bento boxes to the Design tab (same branch, part 7), so both can be added and edited without chat. The merchant added a real YouTube video to Luna Skin by chat; it plays in the preview. 286 tests pass.                                                                                                                                                                                                                                                                                                                                                              | Commit part 7; then part 8                                      |
623
+| 2026-11-22 | Part 7 committed on `redesign/part-7-collections-bento-video`. Part 8 (real reviews) put on hold by the merchant.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Choose next step                                                |
624
+| 2026-11-22 | Built our own home page on branch `feature/homepage`: content outline like afilink.app with our own look, real plan prices, store-name box that fills the Create store form. 288 tests pass; checked on desktop and phone. Then made the hero picture move like afilink's (pinned scroll on wide screens, plays once on phones, floating tags), fixed tags covering text, added hover lift on the hero pieces and pricing cards, made the store and bubble float, and added six more animations (fade-up, typing bubble, playing chat, changing styles, steps line, shop-types strip). | Commit; choose next step                                        |
625
+| 2026-11-22 | Home page committed. Added the privacy policy (`/privacy`) and terms of service (`/terms`) for Malaysian law, naming the AI companies from the AI settings, linked from the home footer and sign-up. 293 tests pass; checked on desktop and phone.                                                                                                                                                                                                                                                                                                                                     | Commit; lawyer check; choose next                               |

+ 58
- 0
app/Http/Controllers/LegalController.php 파일 보기

@@ -0,0 +1,58 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers;
4
+
5
+use Illuminate\Support\Carbon;
6
+use Inertia\Inertia;
7
+use Inertia\Response;
8
+
9
+/**
10
+ * Our privacy policy and terms of service. The wording lives in the React pages; this sends the facts
11
+ * that can change: who runs the service, how to reach us, the trial length and which AI companies we use.
12
+ */
13
+class LegalController extends Controller
14
+{
15
+    public function privacy(): Response
16
+    {
17
+        return Inertia::render('legal/privacy', $this->details());
18
+    }
19
+
20
+    public function terms(): Response
21
+    {
22
+        return Inertia::render('legal/terms', $this->details());
23
+    }
24
+
25
+    /**
26
+     * @return array<string, mixed>
27
+     */
28
+    private function details(): array
29
+    {
30
+        return [
31
+            'operator' => config('legal.operator'),
32
+            'registration' => config('legal.registration'),
33
+            'email' => config('legal.email'),
34
+            'address' => config('legal.address'),
35
+            'updated' => Carbon::parse(config('legal.updated'))->format('j F Y'),
36
+            'trialDays' => (int) config('plans.trial_days'),
37
+            'aiCompanies' => self::aiCompanies(),
38
+        ];
39
+    }
40
+
41
+    /**
42
+     * The companies behind the AI providers the tasks use right now, each named once.
43
+     * The fake provider (tests, no keys) has no company and is left out.
44
+     *
45
+     * @return list<array{name: string, country: string}>
46
+     */
47
+    public static function aiCompanies(): array
48
+    {
49
+        return collect(config('ai.tasks'))
50
+            ->pluck('provider')
51
+            ->unique()
52
+            ->map(fn (string $provider) => config("legal.ai_companies.{$provider}"))
53
+            ->filter()
54
+            ->unique('name')
55
+            ->values()
56
+            ->all();
57
+    }
58
+}

+ 40
- 0
config/legal.php 파일 보기

@@ -0,0 +1,40 @@
1
+<?php
2
+
3
+/*
4
+|--------------------------------------------------------------------------
5
+| Privacy policy and terms
6
+|--------------------------------------------------------------------------
7
+|
8
+| The details shown on /privacy and /terms. Fill the LEGAL_ lines in .env.local
9
+| once the business is registered, so the pages name who runs the service.
10
+|
11
+*/
12
+
13
+return [
14
+
15
+    // Who runs the service: the registered business name.
16
+    'operator' => env('LEGAL_OPERATOR') ?: 'AI Commerce',
17
+
18
+    // The SSM registration number, shown when filled.
19
+    'registration' => env('LEGAL_REGISTRATION') ?: null,
20
+
21
+    // Where people write about privacy, their data or these terms.
22
+    'email' => env('LEGAL_EMAIL') ?: env('MAIL_FROM_ADDRESS'),
23
+
24
+    // The business address, shown when filled.
25
+    'address' => env('LEGAL_ADDRESS') ?: null,
26
+
27
+    // Change this date whenever the wording of either page changes.
28
+    'updated' => '2026-11-22',
29
+
30
+    /*
31
+     * The company behind each AI provider in config/ai.php, and where it is based. The pages name the
32
+     * companies the AI tasks use right now, so switching a model in .env keeps them truthful. A new
33
+     * provider needs an entry here too (a test checks this).
34
+     */
35
+    'ai_companies' => [
36
+        'claude' => ['name' => 'Anthropic', 'country' => 'the United States'],
37
+        'deepseek' => ['name' => 'DeepSeek', 'country' => 'China'],
38
+    ],
39
+
40
+];

+ 1
- 0
resources/js/app.tsx 파일 보기

@@ -21,6 +21,7 @@ void createInertiaApp({
21 21
     layout: (name) => {
22 22
         switch (true) {
23 23
             case name === 'home':
24
+            case name.startsWith('legal/'):
24 25
             case name === 'stores/preview':
25 26
                 // Full pages with no dashboard around them.
26 27
                 return null;

+ 54
- 0
resources/js/components/home/brand.tsx 파일 보기

@@ -0,0 +1,54 @@
1
+import type { CSSProperties } from 'react';
2
+
3
+/*
4
+ * The look of our own pages (home, privacy, terms). Their colours are their own and do not follow the dashboard's light or dark theme:
5
+ * pandan green, turmeric yellow and a little hibiscus red on a cool mint-white.
6
+ */
7
+export const palette = {
8
+    '--h-paper': '#F2F6F1',
9
+    '--h-card': '#FFFFFF',
10
+    '--h-ink': '#10241C',
11
+    '--h-muted': '#4E6158',
12
+    '--h-line': '#D6E1D8',
13
+    '--h-pandan': '#1D6A4C',
14
+    '--h-pandan-deep': '#0F3D2C',
15
+    '--h-pandan-soft': '#DCEBE1',
16
+    '--h-kunyit': '#F2B33D',
17
+    '--h-kunyit-soft': '#FCEFCF',
18
+    '--h-bunga': '#E3573F',
19
+} as CSSProperties;
20
+
21
+export const fontsUrl =
22
+    'https://fonts.bunny.net/css?family=plus-jakarta-sans:600,700,800|instrument-sans:400,500,600&display=swap';
23
+
24
+export const heading =
25
+    "font-['Plus_Jakarta_Sans',ui-sans-serif,system-ui,sans-serif]";
26
+
27
+/** Our logo: a shopping bag with a turmeric dot, and the name. */
28
+export function Logo() {
29
+    return (
30
+        <span className="inline-flex items-center gap-2">
31
+            <span className="relative grid size-8 place-items-center rounded-lg bg-(--h-pandan) text-white">
32
+                <svg
33
+                    viewBox="0 0 24 24"
34
+                    className="size-5"
35
+                    fill="none"
36
+                    stroke="currentColor"
37
+                    strokeWidth="2"
38
+                    strokeLinecap="round"
39
+                    strokeLinejoin="round"
40
+                    aria-hidden="true"
41
+                >
42
+                    <path d="M5 8h14l-1.2 11.2a2 2 0 0 1-2 1.8H8.2a2 2 0 0 1-2-1.8z" />
43
+                    <path d="M9 8V6.5a3 3 0 0 1 6 0V8" />
44
+                </svg>
45
+                <span className="absolute -top-1 -right-1 size-3 rounded-full border-2 border-(--h-paper) bg-(--h-kunyit)" />
46
+            </span>
47
+            <span
48
+                className={`${heading} text-lg font-extrabold tracking-tight whitespace-nowrap`}
49
+            >
50
+                AI Commerce
51
+            </span>
52
+        </span>
53
+    );
54
+}

+ 219
- 0
resources/js/components/home/legal-page.tsx 파일 보기

@@ -0,0 +1,219 @@
1
+import { Head, Link, usePage } from '@inertiajs/react';
2
+import type { ReactNode } from 'react';
3
+import { fontsUrl, heading, Logo, palette } from '@/components/home/brand';
4
+import { dashboard, home, privacy, register, terms } from '@/routes';
5
+
6
+/** What the server sends to the privacy and terms pages (see LegalController). */
7
+export type LegalDetails = {
8
+    operator: string;
9
+    registration: string | null;
10
+    email: string;
11
+    address: string | null;
12
+    /** Already written out, such as "22 November 2026". */
13
+    updated: string;
14
+    trialDays: number;
15
+    aiCompanies: { name: string; country: string }[];
16
+};
17
+
18
+export type LegalSection = {
19
+    id: string;
20
+    title: string;
21
+    body: ReactNode;
22
+};
23
+
24
+/** "Anthropic (based in the United States) and DeepSeek (based in China)". */
25
+export function companyList(companies: LegalDetails['aiCompanies']): string {
26
+    const names = companies.map(
27
+        (company) => `${company.name} (based in ${company.country})`,
28
+    );
29
+
30
+    return names.length > 1
31
+        ? `${names.slice(0, -1).join(', ')} and ${names[names.length - 1]}`
32
+        : (names[0] ?? 'our AI providers');
33
+}
34
+
35
+/** Who runs the service, with the registration number when there is one. */
36
+export function operatorName(details: LegalDetails): string {
37
+    return details.registration
38
+        ? `${details.operator} (${details.registration})`
39
+        : details.operator;
40
+}
41
+
42
+export function Mail({ email }: { email: string }) {
43
+    return (
44
+        <a
45
+            href={`mailto:${email}`}
46
+            className="font-medium text-(--h-pandan) underline underline-offset-2 hover:text-(--h-pandan-deep)"
47
+        >
48
+            {email}
49
+        </a>
50
+    );
51
+}
52
+
53
+/** A plain list with green dots, for the pages' many short lists. */
54
+export function List({ items }: { items: ReactNode[] }) {
55
+    return (
56
+        <ul className="space-y-2">
57
+            {items.map((item, index) => (
58
+                <li key={index} className="flex gap-3">
59
+                    <span
60
+                        className="mt-2.5 size-1.5 shrink-0 rounded-full bg-(--h-pandan)"
61
+                        aria-hidden="true"
62
+                    />
63
+                    <span>{item}</span>
64
+                </li>
65
+            ))}
66
+        </ul>
67
+    );
68
+}
69
+
70
+/**
71
+ * The frame both legal pages share: our header, a title with the last-changed date, a list of
72
+ * sections to jump to (beside the text on wide screens) and our footer. Same colours as the home page.
73
+ */
74
+export default function LegalPage({
75
+    title,
76
+    description,
77
+    intro,
78
+    details,
79
+    sections,
80
+}: {
81
+    title: string;
82
+    description: string;
83
+    intro: ReactNode;
84
+    details: LegalDetails;
85
+    sections: LegalSection[];
86
+}) {
87
+    const { auth } = usePage().props as { auth?: { user?: unknown } };
88
+
89
+    return (
90
+        <>
91
+            <Head title={title}>
92
+                <link rel="stylesheet" href={fontsUrl} />
93
+                <meta name="description" content={description} />
94
+            </Head>
95
+
96
+            <div
97
+                style={palette}
98
+                className="min-h-screen bg-(--h-paper) font-['Instrument_Sans',ui-sans-serif,system-ui,sans-serif] text-(--h-ink) antialiased"
99
+            >
100
+                <header className="sticky top-0 z-30 border-b border-(--h-line)/70 bg-(--h-paper)/85 px-5 backdrop-blur sm:px-8">
101
+                    <div className="mx-auto flex h-16 w-full max-w-6xl items-center justify-between gap-3">
102
+                        <Link
103
+                            href={home()}
104
+                            aria-label="AI Commerce home"
105
+                            className="shrink-0"
106
+                        >
107
+                            <Logo />
108
+                        </Link>
109
+                        <Link
110
+                            href={auth?.user ? dashboard() : register()}
111
+                            className="rounded-full bg-(--h-ink) px-4 py-2 text-sm font-semibold whitespace-nowrap text-white hover:bg-(--h-pandan-deep)"
112
+                        >
113
+                            {auth?.user ? 'Dashboard' : 'Start free'}
114
+                        </Link>
115
+                    </div>
116
+                </header>
117
+
118
+                <main className="px-5 py-14 sm:px-8 sm:py-20">
119
+                    <div className="mx-auto w-full max-w-6xl">
120
+                        <div className="max-w-3xl">
121
+                            <h1
122
+                                className={`${heading} text-4xl font-extrabold tracking-tight sm:text-5xl`}
123
+                            >
124
+                                {title}
125
+                            </h1>
126
+                            <p className="mt-3 text-sm text-(--h-muted)">
127
+                                Last changed on {details.updated}
128
+                            </p>
129
+                            <div className="mt-6 text-lg leading-relaxed text-(--h-muted)">
130
+                                {intro}
131
+                            </div>
132
+                        </div>
133
+
134
+                        <div className="mt-12 grid gap-10 lg:grid-cols-[15rem_1fr] lg:gap-16">
135
+                            <nav
136
+                                aria-label="On this page"
137
+                                className="lg:sticky lg:top-24 lg:self-start"
138
+                            >
139
+                                <p className="text-sm font-semibold tracking-wide text-(--h-pandan) uppercase">
140
+                                    On this page
141
+                                </p>
142
+                                <ol className="mt-3 grid gap-1 text-sm sm:grid-cols-2 lg:grid-cols-1">
143
+                                    {sections.map((section, index) => (
144
+                                        <li key={section.id}>
145
+                                            <a
146
+                                                href={`#${section.id}`}
147
+                                                className="flex gap-2 rounded-md py-1 text-(--h-muted) hover:text-(--h-ink)"
148
+                                            >
149
+                                                <span className="w-5 shrink-0 text-(--h-pandan) tabular-nums">
150
+                                                    {index + 1}.
151
+                                                </span>
152
+                                                {section.title}
153
+                                            </a>
154
+                                        </li>
155
+                                    ))}
156
+                                </ol>
157
+                            </nav>
158
+
159
+                            <div className="max-w-3xl space-y-12">
160
+                                {sections.map((section, index) => (
161
+                                    <section
162
+                                        key={section.id}
163
+                                        id={section.id}
164
+                                        className="scroll-mt-24"
165
+                                    >
166
+                                        <h2
167
+                                            className={`${heading} text-2xl font-bold tracking-tight`}
168
+                                        >
169
+                                            <span className="mr-2 text-(--h-pandan)">
170
+                                                {index + 1}.
171
+                                            </span>
172
+                                            {section.title}
173
+                                        </h2>
174
+                                        <div className="mt-4 space-y-4 leading-relaxed text-(--h-ink)/85">
175
+                                            {section.body}
176
+                                        </div>
177
+                                    </section>
178
+                                ))}
179
+                            </div>
180
+                        </div>
181
+                    </div>
182
+                </main>
183
+
184
+                <footer className="border-t border-(--h-line) px-5 py-10 sm:px-8">
185
+                    <div className="mx-auto flex w-full max-w-6xl flex-col gap-6 text-sm text-(--h-muted) sm:flex-row sm:items-center sm:justify-between">
186
+                        <Logo />
187
+                        <nav
188
+                            aria-label="Footer"
189
+                            className="flex flex-wrap gap-6"
190
+                        >
191
+                            <Link
192
+                                href={home()}
193
+                                className="hover:text-(--h-ink)"
194
+                            >
195
+                                Home
196
+                            </Link>
197
+                            <Link
198
+                                href={terms()}
199
+                                className="hover:text-(--h-ink)"
200
+                            >
201
+                                Terms
202
+                            </Link>
203
+                            <Link
204
+                                href={privacy()}
205
+                                className="hover:text-(--h-ink)"
206
+                            >
207
+                                Privacy
208
+                            </Link>
209
+                        </nav>
210
+                        <p>
211
+                            © {new Date().getFullYear()} {details.operator}.
212
+                            Made in Malaysia.
213
+                        </p>
214
+                    </div>
215
+                </footer>
216
+            </div>
217
+        </>
218
+    );
219
+}

+ 12
- 1
resources/js/pages/auth/register.tsx 파일 보기

@@ -6,7 +6,7 @@ import { Button } from '@/components/ui/button';
6 6
 import { Input } from '@/components/ui/input';
7 7
 import { Label } from '@/components/ui/label';
8 8
 import { Spinner } from '@/components/ui/spinner';
9
-import { login } from '@/routes';
9
+import { login, privacy, terms } from '@/routes';
10 10
 import { store } from '@/routes/register';
11 11
 
12 12
 type Props = {
@@ -99,6 +99,17 @@ export default function Register({ passwordRules }: Props) {
99 99
                                 {processing && <Spinner />}
100 100
                                 Create account
101 101
                             </Button>
102
+                            <p className="text-center text-xs text-muted-foreground">
103
+                                By creating an account, you agree to our{' '}
104
+                                <TextLink href={terms()} tabIndex={7}>
105
+                                    Terms
106
+                                </TextLink>{' '}
107
+                                and{' '}
108
+                                <TextLink href={privacy()} tabIndex={8}>
109
+                                    Privacy policy
110
+                                </TextLink>
111
+                                .
112
+                            </p>
102 113
                         </div>
103 114
 
104 115
                         <div className="text-center text-sm text-muted-foreground">

+ 8
- 52
resources/js/pages/home.tsx 파일 보기

@@ -24,7 +24,8 @@ import {
24 24
     useSeen,
25 25
     useTyping,
26 26
 } from '@/components/home/motion';
27
-import { dashboard, login, register } from '@/routes';
27
+import { fontsUrl, heading, Logo, palette } from '@/components/home/brand';
28
+import { dashboard, login, privacy, register, terms } from '@/routes';
28 29
 
29 30
 type Plan = {
30 31
     key: string;
@@ -37,29 +38,6 @@ type Plan = {
37 38
     period: string;
38 39
 };
39 40
 
40
-/*
41
- * Our own home page. Its colours are its own and do not follow the dashboard's light or dark theme:
42
- * pandan green, turmeric yellow and a little hibiscus red on a cool mint-white.
43
- */
44
-const palette = {
45
-    '--h-paper': '#F2F6F1',
46
-    '--h-card': '#FFFFFF',
47
-    '--h-ink': '#10241C',
48
-    '--h-muted': '#4E6158',
49
-    '--h-line': '#D6E1D8',
50
-    '--h-pandan': '#1D6A4C',
51
-    '--h-pandan-deep': '#0F3D2C',
52
-    '--h-pandan-soft': '#DCEBE1',
53
-    '--h-kunyit': '#F2B33D',
54
-    '--h-kunyit-soft': '#FCEFCF',
55
-    '--h-bunga': '#E3573F',
56
-} as CSSProperties;
57
-
58
-const fontsUrl =
59
-    'https://fonts.bunny.net/css?family=plus-jakarta-sans:600,700,800|instrument-sans:400,500,600&display=swap';
60
-
61
-const heading = "font-['Plus_Jakarta_Sans',ui-sans-serif,system-ui,sans-serif]";
62
-
63 41
 /** Where the page's "Start free" buttons go: the dashboard for someone signed in, otherwise sign-up. */
64 42
 function useStartUrl(): string {
65 43
     const { auth } = usePage().props as { auth?: { user?: unknown } };
@@ -156,34 +134,6 @@ function Title({
156 134
     );
157 135
 }
158 136
 
159
-function Logo() {
160
-    return (
161
-        <span className="inline-flex items-center gap-2">
162
-            <span className="relative grid size-8 place-items-center rounded-lg bg-(--h-pandan) text-white">
163
-                <svg
164
-                    viewBox="0 0 24 24"
165
-                    className="size-5"
166
-                    fill="none"
167
-                    stroke="currentColor"
168
-                    strokeWidth="2"
169
-                    strokeLinecap="round"
170
-                    strokeLinejoin="round"
171
-                    aria-hidden="true"
172
-                >
173
-                    <path d="M5 8h14l-1.2 11.2a2 2 0 0 1-2 1.8H8.2a2 2 0 0 1-2-1.8z" />
174
-                    <path d="M9 8V6.5a3 3 0 0 1 6 0V8" />
175
-                </svg>
176
-                <span className="absolute -top-1 -right-1 size-3 rounded-full border-2 border-(--h-paper) bg-(--h-kunyit)" />
177
-            </span>
178
-            <span
179
-                className={`${heading} text-lg font-extrabold tracking-tight whitespace-nowrap`}
180
-            >
181
-                AI Commerce
182
-            </span>
183
-        </span>
184
-    );
185
-}
186
-
187 137
 function Nav() {
188 138
     const { auth } = usePage().props as { auth?: { user?: unknown } };
189 139
     const start = useStartUrl();
@@ -1808,6 +1758,12 @@ function Footer() {
1808 1758
                     <a href="#faq" className="hover:text-(--h-ink)">
1809 1759
                         Questions
1810 1760
                     </a>
1761
+                    <Link href={terms()} className="hover:text-(--h-ink)">
1762
+                        Terms
1763
+                    </Link>
1764
+                    <Link href={privacy()} className="hover:text-(--h-ink)">
1765
+                        Privacy
1766
+                    </Link>
1811 1767
                     <Link href={login()} className="hover:text-(--h-ink)">
1812 1768
                         Log in
1813 1769
                     </Link>

+ 317
- 0
resources/js/pages/legal/privacy.tsx 파일 보기

@@ -0,0 +1,317 @@
1
+import { Link } from '@inertiajs/react';
2
+import LegalPage, {
3
+    companyList,
4
+    List,
5
+    Mail,
6
+    operatorName,
7
+} from '@/components/home/legal-page';
8
+import type { LegalDetails, LegalSection } from '@/components/home/legal-page';
9
+import { terms } from '@/routes';
10
+
11
+/**
12
+ * Our privacy policy, written for Malaysia's Personal Data Protection Act 2010. It must match what the
13
+ * app really does: when the app starts collecting or sharing something new, change this page and the
14
+ * date in config/legal.php.
15
+ */
16
+export default function Privacy(details: LegalDetails) {
17
+    const ai = companyList(details.aiCompanies);
18
+
19
+    const sections: LegalSection[] = [
20
+        {
21
+            id: 'who',
22
+            title: 'Who we are',
23
+            body: (
24
+                <>
25
+                    <p>
26
+                        AI Commerce is run by {operatorName(details)}
27
+                        {details.address ? `, ${details.address}` : ''}. In this
28
+                        policy, “we” means us and “you” means the person reading
29
+                        it.
30
+                    </p>
31
+                    <p>
32
+                        For questions about your personal data, write to{' '}
33
+                        <Mail email={details.email} />.
34
+                    </p>
35
+                </>
36
+            ),
37
+        },
38
+        {
39
+            id: 'two-kinds',
40
+            title: 'Merchants and shoppers',
41
+            body: (
42
+                <>
43
+                    <p>Two kinds of people use AI Commerce:</p>
44
+                    <List
45
+                        items={[
46
+                            <>
47
+                                <strong>Merchants</strong> make an account with
48
+                                us and build online stores. We are responsible
49
+                                for merchants’ data.
50
+                            </>,
51
+                            <>
52
+                                <strong>Shoppers</strong> buy from a merchant’s
53
+                                store. The merchant is the seller and decides
54
+                                what to do with shoppers’ orders. We keep and
55
+                                handle shoppers’ details for the merchant, so
56
+                                the store can take payments, send emails and
57
+                                deliver the order.
58
+                            </>,
59
+                        ]}
60
+                    />
61
+                    <p>
62
+                        If you are a shopper with a question about an order,
63
+                        please contact the store first. You can also write to us
64
+                        and we will help.
65
+                    </p>
66
+                </>
67
+            ),
68
+        },
69
+        {
70
+            id: 'what',
71
+            title: 'What we collect',
72
+            body: (
73
+                <>
74
+                    <p>
75
+                        <strong>From merchants:</strong>
76
+                    </p>
77
+                    <List
78
+                        items={[
79
+                            'Your name, email address and password. We only keep a scrambled form of the password (a “hash”), so nobody can read it, including us.',
80
+                            'Two-factor sign-in settings, if you switch them on.',
81
+                            'What you put in your stores: the brand description, the messages you send to the AI, products, prices, photos, videos you link to, discount codes, your WhatsApp number and shipping fees.',
82
+                            'Your plan and billing history. Card details are typed on Stripe’s own page and go straight to Stripe. We never see or keep your card number.',
83
+                        ]}
84
+                    />
85
+                    <p>
86
+                        <strong>From shoppers, when they order:</strong>
87
+                    </p>
88
+                    <List
89
+                        items={[
90
+                            'Name, email address, phone number and delivery address.',
91
+                            'What was ordered, the amounts paid and the payment reference from Stripe. Card details go straight to Stripe.',
92
+                        ]}
93
+                    />
94
+                    <p>
95
+                        <strong>From everyone who visits:</strong>
96
+                    </p>
97
+                    <List
98
+                        items={[
99
+                            'The IP address (your connection’s address on the internet) and the type of browser, kept with your sign-in session so we can keep accounts safe.',
100
+                            'The items in a shopping cart, until the order is placed or the cart expires.',
101
+                        ]}
102
+                    />
103
+                </>
104
+            ),
105
+        },
106
+        {
107
+            id: 'use',
108
+            title: 'How we use it',
109
+            body: (
110
+                <List
111
+                    items={[
112
+                        'To run your account and your stores, and to show your stores to shoppers.',
113
+                        'To design and change stores with AI when you ask us to.',
114
+                        'To take payments, send order emails and help with delivery.',
115
+                        'To charge for your plan and tell you about your account, such as a trial ending or a failed payment.',
116
+                        'To keep the service safe, stop misuse and fix problems.',
117
+                        'To meet the law, such as keeping tax records.',
118
+                    ]}
119
+                />
120
+            ),
121
+        },
122
+        {
123
+            id: 'ai',
124
+            title: 'The AI companies we use',
125
+            body: (
126
+                <>
127
+                    <p>
128
+                        Our AI is provided by {ai}. When you create a store or
129
+                        ask the AI for a change, we send them:
130
+                    </p>
131
+                    <List
132
+                        items={[
133
+                            'your brand description, store name and the language you chose;',
134
+                            'the message you typed to the AI;',
135
+                            'your store’s current design and words, and your products’ names, prices, descriptions and the names of their photos.',
136
+                        ]}
137
+                    />
138
+                    <p>
139
+                        We do <strong>not</strong> send them your password, card
140
+                        details, or shoppers’ names, contact details, addresses
141
+                        or orders. Please do not put other people’s personal
142
+                        details in your brand description or AI messages.
143
+                    </p>
144
+                    <p>
145
+                        These companies use the text to write the answer and
146
+                        handle it under their own terms for businesses. We may
147
+                        change which AI companies we use. When we do, this
148
+                        section is updated.
149
+                    </p>
150
+                </>
151
+            ),
152
+        },
153
+        {
154
+            id: 'share',
155
+            title: 'Who else sees your data',
156
+            body: (
157
+                <>
158
+                    <p>
159
+                        We do not sell personal data. We share it only with the
160
+                        companies that help us run the service, and only what
161
+                        they need:
162
+                    </p>
163
+                    <List
164
+                        items={[
165
+                            <>
166
+                                <strong>Stripe</strong>, for payments from
167
+                                shoppers and for merchants’ plans.
168
+                            </>,
169
+                            <>
170
+                                <strong>Our AI companies</strong>, as explained
171
+                                above.
172
+                            </>,
173
+                            <>
174
+                                <strong>Our hosting and email providers</strong>
175
+                                , which store the data and send our emails.
176
+                            </>,
177
+                            <>
178
+                                <strong>The merchant</strong>, who sees the
179
+                                orders placed in their own store.
180
+                            </>,
181
+                        ]}
182
+                    />
183
+                    <p>
184
+                        We also share data when the law requires it, for example
185
+                        when a Malaysian court or authority asks for it.
186
+                    </p>
187
+                </>
188
+            ),
189
+        },
190
+        {
191
+            id: 'abroad',
192
+            title: 'Data sent outside Malaysia',
193
+            body: (
194
+                <p>
195
+                    Some of the companies above keep or handle data outside
196
+                    Malaysia. Our AI companies are {ai}. Stripe handles payments
197
+                    across many countries. By using AI Commerce you agree that
198
+                    your data may be sent there. We choose companies that
199
+                    protect data, and we send them only what they need.
200
+                </p>
201
+            ),
202
+        },
203
+        {
204
+            id: 'keep',
205
+            title: 'How long we keep it',
206
+            body: (
207
+                <List
208
+                    items={[
209
+                        'Merchants’ accounts, stores and orders are kept while the account is open.',
210
+                        'When a merchant deletes their account (Settings, then Delete account), their stores, products, photos, AI messages and the orders of their stores are deleted with it.',
211
+                        'Records of what merchants paid us are kept by Stripe for as long as tax law asks (in Malaysia, usually seven years). Merchants keep their own sales records for their taxes.',
212
+                        'Sign-in sessions and carts end by themselves after a while.',
213
+                    ]}
214
+                />
215
+            ),
216
+        },
217
+        {
218
+            id: 'cookies',
219
+            title: 'Cookies',
220
+            body: (
221
+                <p>
222
+                    Cookies are small files a website saves in your browser. We
223
+                    only use the ones the service needs to work: to keep you
224
+                    signed in, to keep the items in your cart, to protect forms
225
+                    from misuse, and to remember small choices such as light or
226
+                    dark mode. We do not use advertising or tracking cookies.
227
+                </p>
228
+            ),
229
+        },
230
+        {
231
+            id: 'rights',
232
+            title: 'Your rights',
233
+            body: (
234
+                <>
235
+                    <p>
236
+                        Under Malaysia’s Personal Data Protection Act 2010 you
237
+                        can:
238
+                    </p>
239
+                    <List
240
+                        items={[
241
+                            'ask for a copy of the personal data we hold about you;',
242
+                            'ask us to correct it if it is wrong;',
243
+                            'ask us to stop using it, or to delete it;',
244
+                            'ask us to send it to you in a form you can take elsewhere.',
245
+                        ]}
246
+                    />
247
+                    <p>
248
+                        Merchants can change most of their details in Settings
249
+                        and can delete their account there. For anything else,
250
+                        write to <Mail email={details.email} />. We reply within
251
+                        21 days. Shoppers can also ask the store they bought
252
+                        from.
253
+                    </p>
254
+                </>
255
+            ),
256
+        },
257
+        {
258
+            id: 'safe',
259
+            title: 'Keeping it safe',
260
+            body: (
261
+                <p>
262
+                    Passwords are kept as hashes, pages are sent over a secure
263
+                    connection, card payments are handled by Stripe, and each
264
+                    merchant can only open their own stores and orders. Two-step
265
+                    sign-in is available in Settings. No system is perfectly
266
+                    safe. If a data breach could harm you, we will tell you and
267
+                    the Personal Data Protection Commissioner as the law
268
+                    requires.
269
+                </p>
270
+            ),
271
+        },
272
+        {
273
+            id: 'age',
274
+            title: 'Children',
275
+            body: (
276
+                <p>
277
+                    Merchant accounts are for people aged 18 and over. We do not
278
+                    knowingly collect data from children.
279
+                </p>
280
+            ),
281
+        },
282
+        {
283
+            id: 'changes',
284
+            title: 'Changes to this policy',
285
+            body: (
286
+                <p>
287
+                    When we change this policy, we update the date at the top.
288
+                    If the change is important, we tell merchants by email
289
+                    before it starts. Our{' '}
290
+                    <Link
291
+                        href={terms()}
292
+                        className="font-medium text-(--h-pandan) underline underline-offset-2"
293
+                    >
294
+                        terms of service
295
+                    </Link>{' '}
296
+                    explain the rules for using AI Commerce.
297
+                </p>
298
+            ),
299
+        },
300
+    ];
301
+
302
+    return (
303
+        <LegalPage
304
+            title="Privacy policy"
305
+            description="How AI Commerce collects, uses and protects the personal data of merchants and shoppers."
306
+            intro={
307
+                <p>
308
+                    This page explains, in plain words, what personal data AI
309
+                    Commerce collects, why, who we share it with and what you
310
+                    can ask us to do with it.
311
+                </p>
312
+            }
313
+            details={details}
314
+            sections={sections}
315
+        />
316
+    );
317
+}

+ 271
- 0
resources/js/pages/legal/terms.tsx 파일 보기

@@ -0,0 +1,271 @@
1
+import { Link } from '@inertiajs/react';
2
+import LegalPage, {
3
+    companyList,
4
+    List,
5
+    Mail,
6
+    operatorName,
7
+} from '@/components/home/legal-page';
8
+import type { LegalDetails, LegalSection } from '@/components/home/legal-page';
9
+import { privacy } from '@/routes';
10
+
11
+/**
12
+ * Our terms of service for merchants, under Malaysian law. Keep it in step with how billing and stores
13
+ * really work, and change the date in config/legal.php whenever the wording changes.
14
+ */
15
+export default function Terms(details: LegalDetails) {
16
+    const sections: LegalSection[] = [
17
+        {
18
+            id: 'agreement',
19
+            title: 'Agreeing to these terms',
20
+            body: (
21
+                <>
22
+                    <p>
23
+                        AI Commerce is run by {operatorName(details)}. These
24
+                        terms are the agreement between us and you, the merchant
25
+                        who makes an account. By creating an account or using AI
26
+                        Commerce, you agree to them.
27
+                    </p>
28
+                    <p>
29
+                        Our{' '}
30
+                        <Link
31
+                            href={privacy()}
32
+                            className="font-medium text-(--h-pandan) underline underline-offset-2"
33
+                        >
34
+                            privacy policy
35
+                        </Link>{' '}
36
+                        explains how we handle personal data. It is part of
37
+                        these terms.
38
+                    </p>
39
+                </>
40
+            ),
41
+        },
42
+        {
43
+            id: 'account',
44
+            title: 'Your account',
45
+            body: (
46
+                <List
47
+                    items={[
48
+                        'You must be 18 or over, and able to make a binding agreement under Malaysian law.',
49
+                        'Give your real name and an email address you use. Keep your password to yourself.',
50
+                        'You are responsible for everything done with your account. Tell us straight away if you think someone else is using it.',
51
+                        'If you sign up for a business, you confirm you are allowed to agree to these terms for it.',
52
+                    ]}
53
+                />
54
+            ),
55
+        },
56
+        {
57
+            id: 'plans',
58
+            title: 'Free trial, plans and payment',
59
+            body: (
60
+                <List
61
+                    items={[
62
+                        `Every new account gets a ${details.trialDays}-day free trial. No card is needed for the trial.`,
63
+                        'After the trial, you choose a monthly plan on the Billing page. Each plan has its own limits on stores, AI designs and AI changes, shown on that page.',
64
+                        'Plans are charged in ringgit, through Stripe, at the start of each month of your plan, and renew by themselves until you cancel.',
65
+                        'You can cancel any time on the Billing page. Your plan stays active until the end of the month you paid for, and is not charged again.',
66
+                        'When you switch plans, Stripe adds or takes off the difference on your next bill.',
67
+                        'Payments already made are not refunded for unused days, unless the law says otherwise or we cancel your plan without a good reason.',
68
+                        'Without an active plan or trial, the AI, new stores and publishing stop, and your live stores go offline. Nothing is deleted, and everything comes back when you choose a plan.',
69
+                        'We may change prices or limits. We will email you at least 30 days before a price change affects you, and you can cancel before it starts.',
70
+                    ]}
71
+                />
72
+            ),
73
+        },
74
+        {
75
+            id: 'store',
76
+            title: 'Your store and what you sell',
77
+            body: (
78
+                <>
79
+                    <p>
80
+                        You are the seller in your store, not us. That means you
81
+                        are responsible for:
82
+                    </p>
83
+                    <List
84
+                        items={[
85
+                            'your products, their descriptions, photos and prices;',
86
+                            'delivering orders, and handling returns, refunds and complaints from shoppers;',
87
+                            'following the law that applies to your business, such as the Consumer Protection Act 1999 and its rules for online selling, which ask you to show your business name, registration number and contact details in your store;',
88
+                            'any licences, permits and taxes for your business, such as SST;',
89
+                            'claims you make, such as halal status, “handmade” or “organic”. Only make claims you can prove, and only show halal logos you are certified for.',
90
+                        ]}
91
+                    />
92
+                    <p>
93
+                        Shoppers pay through Stripe. To receive payments you may
94
+                        need to accept Stripe’s own terms.
95
+                    </p>
96
+                </>
97
+            ),
98
+        },
99
+        {
100
+            id: 'not-allowed',
101
+            title: 'What is not allowed',
102
+            body: (
103
+                <>
104
+                    <p>You may not use AI Commerce to:</p>
105
+                    <List
106
+                        items={[
107
+                            'sell anything illegal in Malaysia, such as drugs, weapons, counterfeit goods, unregistered medicines or cosmetics, or gambling;',
108
+                            'sell things you do not have or do not plan to send;',
109
+                            'copy other people’s brands, photos or words without permission;',
110
+                            'mislead or cheat shoppers, or collect their data for other purposes;',
111
+                            'post hateful, violent or sexual content;',
112
+                            'attack, overload or try to break into the service or other people’s stores.',
113
+                        ]}
114
+                    />
115
+                    <p>
116
+                        If you break these rules, we may take down the content,
117
+                        pause your stores or close your account, as explained
118
+                        below.
119
+                    </p>
120
+                </>
121
+            ),
122
+        },
123
+        {
124
+            id: 'ai',
125
+            title: 'Designs and words made by AI',
126
+            body: (
127
+                <>
128
+                    <p>
129
+                        AI Commerce uses AI from{' '}
130
+                        {companyList(details.aiCompanies)} to design your store
131
+                        and write its words. AI can make mistakes: it may write
132
+                        something untrue, make a claim you cannot back up, or
133
+                        produce something that looks like another brand’s work.
134
+                    </p>
135
+                    <p>
136
+                        Read your store before you publish it, and fix anything
137
+                        that is wrong. Once published, what your store says is
138
+                        your responsibility. The AI does not change products,
139
+                        prices, stock or discounts without your Confirm.
140
+                    </p>
141
+                </>
142
+            ),
143
+        },
144
+        {
145
+            id: 'content',
146
+            title: 'Who owns what',
147
+            body: (
148
+                <>
149
+                    <p>
150
+                        <strong>Your content stays yours.</strong> That includes
151
+                        your brand description, products, photos, and the
152
+                        designs and words made for your store. You give us
153
+                        permission to store, copy, show and process it, and to
154
+                        send it to our AI companies, only so we can run your
155
+                        stores and the service. This permission ends when you
156
+                        delete the content or your account.
157
+                    </p>
158
+                    <p>
159
+                        <strong>The service is ours.</strong> The AI Commerce
160
+                        software, name, logo, section designs and store styles
161
+                        belong to us. You may use them only through the service.
162
+                    </p>
163
+                </>
164
+            ),
165
+        },
166
+        {
167
+            id: 'service',
168
+            title: 'The service',
169
+            body: (
170
+                <List
171
+                    items={[
172
+                        'We work to keep AI Commerce online, but it may sometimes be slow or unavailable, for example during repairs or when an AI company is down.',
173
+                        'We keep improving the service. Features may be added, changed or removed. If we remove something important that your plan includes, we will tell you first.',
174
+                        'Your store lives at its own address on our domain. Your own domain name is not offered yet.',
175
+                        'Keep your own copies of anything important, such as product photos and order records.',
176
+                    ]}
177
+                />
178
+            ),
179
+        },
180
+        {
181
+            id: 'ending',
182
+            title: 'Ending the agreement',
183
+            body: (
184
+                <List
185
+                    items={[
186
+                        'You can stop any time: cancel your plan on the Billing page, and delete your account in Settings. Deleting your account deletes your stores and their orders and cannot be undone.',
187
+                        'We may pause your stores or close your account if you break these terms, do not pay, or put shoppers or us at risk. When we can, we will warn you first and give you time to fix it.',
188
+                        'If we ever close the whole service, we will tell you at least 30 days before, so you can save your data.',
189
+                    ]}
190
+                />
191
+            ),
192
+        },
193
+        {
194
+            id: 'liability',
195
+            title: 'Limits of our responsibility',
196
+            body: (
197
+                <>
198
+                    <p>
199
+                        AI Commerce is provided “as it is”. As far as Malaysian
200
+                        law allows:
201
+                    </p>
202
+                    <List
203
+                        items={[
204
+                            'we are not responsible for lost sales, lost profit, or problems between you and your shoppers;',
205
+                            'we are not responsible for problems caused by Stripe, couriers, AI companies or other services outside our control;',
206
+                            'our total responsibility to you is no more than what you paid us in the three months before the problem.',
207
+                        ]}
208
+                    />
209
+                    <p>
210
+                        You agree to cover our costs if someone makes a claim
211
+                        against us because of what you sell or publish, or
212
+                        because you broke these terms.
213
+                    </p>
214
+                    <p>
215
+                        Nothing in these terms takes away rights that the law
216
+                        does not allow us to take away.
217
+                    </p>
218
+                </>
219
+            ),
220
+        },
221
+        {
222
+            id: 'law',
223
+            title: 'Malaysian law',
224
+            body: (
225
+                <p>
226
+                    These terms follow the law of Malaysia. If we disagree,
227
+                    please write to us first and we will try to sort it out
228
+                    together. If we cannot, the courts of Malaysia will decide.
229
+                </p>
230
+            ),
231
+        },
232
+        {
233
+            id: 'changes',
234
+            title: 'Changes and contact',
235
+            body: (
236
+                <>
237
+                    <p>
238
+                        We may update these terms. We change the date at the top
239
+                        and, for important changes, email you at least 14 days
240
+                        before they start. If you keep using AI Commerce after
241
+                        that, you accept the new terms.
242
+                    </p>
243
+                    <p>
244
+                        Questions about these terms? Write to{' '}
245
+                        <Mail email={details.email} />
246
+                        {details.address
247
+                            ? `, or by post to ${details.address}`
248
+                            : ''}
249
+                        .
250
+                    </p>
251
+                </>
252
+            ),
253
+        },
254
+    ];
255
+
256
+    return (
257
+        <LegalPage
258
+            title="Terms of service"
259
+            description="The rules for using AI Commerce to build and run an online store."
260
+            intro={
261
+                <p>
262
+                    These are the rules for using AI Commerce to build and run
263
+                    your online store. We have kept them short and in plain
264
+                    words. Please read them before you start.
265
+                </p>
266
+            }
267
+            details={details}
268
+            sections={sections}
269
+        />
270
+    );
271
+}

+ 3
- 0
routes/web.php 파일 보기

@@ -10,6 +10,7 @@ use App\Http\Controllers\DiscountCodeController;
10 10
 use App\Http\Controllers\FeaturedProductController;
11 11
 use App\Http\Controllers\HeroImageController;
12 12
 use App\Http\Controllers\HomeController;
13
+use App\Http\Controllers\LegalController;
13 14
 use App\Http\Controllers\OrderController;
14 15
 use App\Http\Controllers\ProductController;
15 16
 use App\Http\Controllers\SectionLayoutController;
@@ -61,6 +62,8 @@ Route::domain('{storeSlug}.'.config('storefront.domain'))
61 62
     });
62 63
 
63 64
 Route::get('/', HomeController::class)->name('home');
65
+Route::get('privacy', [LegalController::class, 'privacy'])->name('privacy');
66
+Route::get('terms', [LegalController::class, 'terms'])->name('terms');
64 67
 
65 68
 // Called by Stripe, not by a browser, so it has no login. Each message is checked with a signing secret.
66 69
 Route::post('stripe/webhook', StripeWebhookController::class)->name('stripe.webhook');

+ 75
- 0
tests/Feature/LegalPagesTest.php 파일 보기

@@ -0,0 +1,75 @@
1
+<?php
2
+
3
+namespace Tests\Feature;
4
+
5
+use App\Http\Controllers\LegalController;
6
+use Inertia\Testing\AssertableInertia as Assert;
7
+use Tests\TestCase;
8
+
9
+class LegalPagesTest extends TestCase
10
+{
11
+    public function test_visitors_can_read_the_privacy_policy()
12
+    {
13
+        config([
14
+            'legal.operator' => 'Mirfalah Sdn Bhd',
15
+            'legal.registration' => '202601234567',
16
+            'legal.email' => 'privacy@example.com',
17
+        ]);
18
+
19
+        $this->get(route('privacy'))
20
+            ->assertOk()
21
+            ->assertInertia(fn (Assert $page) => $page
22
+                ->component('legal/privacy')
23
+                ->where('operator', 'Mirfalah Sdn Bhd')
24
+                ->where('registration', '202601234567')
25
+                ->where('email', 'privacy@example.com')
26
+                ->where('updated', '22 November 2026')
27
+                ->has('aiCompanies'));
28
+    }
29
+
30
+    public function test_visitors_can_read_the_terms()
31
+    {
32
+        $this->get(route('terms'))
33
+            ->assertOk()
34
+            ->assertInertia(fn (Assert $page) => $page
35
+                ->component('legal/terms')
36
+                ->where('trialDays', 14));
37
+    }
38
+
39
+    public function test_the_pages_name_the_ai_companies_the_tasks_use_now()
40
+    {
41
+        config([
42
+            'ai.tasks.generate.provider' => 'claude',
43
+            'ai.tasks.edit.provider' => 'deepseek',
44
+        ]);
45
+
46
+        $this->assertSame([
47
+            ['name' => 'Anthropic', 'country' => 'the United States'],
48
+            ['name' => 'DeepSeek', 'country' => 'China'],
49
+        ], LegalController::aiCompanies());
50
+
51
+        // After switching every task to one provider, only that company is named.
52
+        config(['ai.tasks.edit.provider' => 'claude']);
53
+
54
+        $this->assertSame([
55
+            ['name' => 'Anthropic', 'country' => 'the United States'],
56
+        ], LegalController::aiCompanies());
57
+    }
58
+
59
+    public function test_every_real_ai_provider_has_a_company_for_the_legal_pages()
60
+    {
61
+        $providers = array_diff(array_keys(config('ai.providers')), ['fake']);
62
+
63
+        foreach ($providers as $provider) {
64
+            $this->assertNotNull(
65
+                config("legal.ai_companies.{$provider}"),
66
+                "Add the company behind the \"{$provider}\" AI provider to config/legal.php, so the privacy policy names it.",
67
+            );
68
+        }
69
+    }
70
+
71
+    public function test_the_sign_up_page_works_with_its_links_to_the_terms()
72
+    {
73
+        $this->get(route('register'))->assertOk();
74
+    }
75
+}

Loading…
취소
저장