Mô hình Pre‑order trong ngành Thời trang thiết kế – Quản lý dòng tiền & kỳ vọng khách hàng khi thời gian chờ lên tới 30 ngày
⚡ Mục tiêu: Cung cấp một “play‑book” chi tiết, có thể thực thi ngay cho các team dev/BA/PM junior muốn triển khai mô hình Pre‑order (PO) trên nền tảng eCommerce thời trang, từ việc lựa chọn tech stack, tính toán chi phí, tới kiểm soát dòng tiền và trải nghiệm khách hàng trong chu kỳ chờ 30 ngày.
1. Tổng quan mô hình Pre‑order trong thời trang thiết kế
| Năm | Doanh thu PO (tỷ USD) | Tỷ lệ PO trong tổng eCommerce (theo Shopify 2025) |
|---|---|---|
| 2023 | 12,4 | 18 % |
| 2024 | 14,9 | 21 % |
| 2025 (dự báo) | 17,6 | 24 % |
Nguồn: Shopify Commerce Trends 2025; Statista “Global Fashion E‑commerce Market”.
Pre‑order cho phép đặt hàng trước khi sản phẩm được sản xuất, giảm tồn kho, tăng khả năng dự đoán nhu cầu và tạo “hype” cho các bộ sưu tập giới hạn. Tuy nhiên, thời gian chờ trung bình 15‑30 ngày (theo Cục TMĐT VN 2024) đòi hỏi quản lý dòng tiền chặt chẽ và đặt kỳ vọng khách hàng đúng mức.
2. Kiến trúc công nghệ – Lựa chọn stack phù hợp
2.1. So sánh 4 lựa chọn tech stack (điểm mạnh/ yếu)
| Stack | Thành phần chính | Ưu điểm | Nhược điểm | Đánh giá tổng thể (0‑10) |
|---|---|---|---|---|
| A. Shopify + Medusa (headless) | Shopify Storefront API, Medusa Service, PostgreSQL, Redis | Thị trường lớn, plugin PO sẵn có, bảo mật Shopify | Giới hạn tùy biến UI, chi phí transaction cao | 8 |
| B. Magento 2 + Vue Storefront | Magento 2.4, Vue Storefront, MySQL, RabbitMQ | Tùy biến sâu, hỗ trợ đa ngôn ngữ | Cài đặt phức tạp, tài nguyên server lớn | 7 |
| C. BigCommerce + Next.js | BigCommerce API, Next.js SSR, PostgreSQL, Vercel | SEO mạnh, triển khai nhanh trên Vercel | Không có plugin PO chuẩn, cần custom | 7 |
| D. Custom Node.js (NestJS) + React | NestJS, React, PostgreSQL, Kafka, Docker, Kubernetes | Toàn quyền kiểm soát, dễ tích hợp AI/ML | Đòi hỏi đội ngũ dev full‑stack, chi phí vận hành | 9 |
🛡️ Lựa chọn đề xuất: Stack D (Custom Node.js) vì khả năng mở rộng, tích hợp AI dự báo nhu cầu và kiểm soát cash‑flow toàn diện.
2.2. Workflow vận hành Pre‑order (text‑art)
+----------------+ 1. Đặt PO +----------------+ 2. Xác nhận +----------------+
| Frontend |------------->| API Gateway |------------->| Order Service |
| (React SPA) | | (NestJS) | | (NestJS) |
+----------------+ +----------------+ +----------------+
| | |
| 3. Kiểm tra tồn kho 0 | 4. Tạo payment intent |
v v v
+----------------+ +----------------+ +----------------+
| Inventory |<-------------| Payment |<-------------| Stripe/PayPal |
| Service | 5. Đặt cọc | Service | 6. Xác nhận | Service |
+----------------+ +----------------+ +----------------+
| | |
| 7. Gửi email xác nhận | 8. Đặt lịch sản xuất |
v v v
+----------------+ +----------------+ +----------------+
| Notification |------------->| Production |------------->| Logistics |
| Service | 9. Cập nhật | Scheduler | 10. Giao | Service |
+----------------+ trạng thái | | hàng | |
+----------------+ +----------------+
3. Quản lý dòng tiền trong chu kỳ Pre‑order 30 ngày
3.1. Cash Conversion Cycle (CCC) cho mô hình PO
DSO – Days Sales Outstanding (ngày thu tiền bán hàng)
DIO – Days Inventory Outstanding (ngày tồn kho)
DPO – Days Payable Outstanding (ngày trả nợ)
Giải thích: Với PO, DIO ≈ 0 vì không tồn kho trước khi nhận tiền cọc. Do đó CCC ≈ DSO – DPO. Mục tiêu: DSO ≤ 15 ngày, DPO ≥ 20 ngày → CCC âm, tức là công ty nhận tiền trước khi phải trả cho nhà cung cấp.
3.2. Công thức tính ROI cho chiến dịch PO
Giải thích: Total_Benefits bao gồm lợi nhuận gộp + giảm chi phí lưu kho; Investment_Cost là chi phí triển khai hạ tầng + marketing.
3.3. Mô hình cash‑flow chi tiết (theo tháng)
| Tháng | Thu nhập cọc (%) | Thu nhập bán lẻ (%) | Chi phí sản xuất | Chi phí logistic | Lợi nhuận gộp |
|---|---|---|---|---|---|
| 1‑2 | 100 % (cọc) | 0 % | 30 % | 5 % | 65 % |
| 3‑4 | 0 % | 100 % (giao) | 30 % | 5 % | 65 % |
⚡ Lưu ý: Đảm bảo cọc ≥ 30 % tổng giá trị đơn hàng để duy trì cash‑flow dương trong giai đoạn 1‑2.
4. Chi phí triển khai 30 tháng (3 năm)
4.1. Bảng chi phí chi tiết
| Hạng mục | Năm 1 (USD) | Năm 2 (USD) | Năm 3 (USD) | Tổng (USD) |
|---|---|---|---|---|
| Hạ tầng (cloud, CDN, DB) | 45 000 | 30 000 | 30 000 | 105 000 |
| Licenses (Shopify/Stripe, AI‑forecast) | 12 000 | 12 000 | 12 000 | 36 000 |
| Nhân sự (dev 3, BA 1, PM 1) | 210 000 | 225 000 | 240 000 | 675 000 |
| Marketing (KOL, ads) | 80 000 | 90 000 | 100 000 | 270 000 |
| Vận hành (logistics, kho) | 30 000 | 35 000 | 40 000 | 105 000 |
| Dự phòng (10 % tổng) | 37 800 | 40 200 | 42 600 | 120 600 |
| Tổng | 414 800 | 432 200 | 459 600 | 1 306 600 |
🛡️ Phân bổ: 30 % chi phí vào nhân sự, 20 % vào marketing, 25 % vào hạ tầng, 15 % vào vận hành, 10 % dự phòng.
5. Lộ trình triển khai – Timeline & Gantt
5.1. Timeline chi tiết (theo tuần)
| Tuần | Hoạt động chính |
|---|---|
| 1‑2 | Khảo sát yêu cầu, lập backlog |
| 3‑4 | Thiết kế kiến trúc, chọn stack |
| 5‑6 | Setup môi trường CI/CD, Docker |
| 7‑10 | Phát triển Order Service + Payment Integration |
| 11‑12 | Xây dựng Inventory (0) & Production Scheduler |
| 13‑14 | UI/UX Pre‑order page (React) |
| 15‑16 | Kiểm thử tích hợp (E2E) |
| 17‑18 | Đánh giá bảo mật (OWASP) |
| 19‑20 | Đào tạo nội bộ, chuẩn SOP |
| 21‑22 | Go‑live beta (30 % traffic) |
| 23‑24 | Thu thập feedback, tối ưu |
| 25‑26 | Full launch + marketing push |
| 27‑30 | Theo dõi KPI, cải tiến vòng 2 |
5.2. Gantt chart (ASCII)
+-----------------------------------------------------------------------------------+
| Phase | W1-4 | W5-8 | W9-12 | W13-16 | W17-20 | W21-24 | W25-30 |
+----------------------+------|------|-------|--------|--------|--------|--------+
| 1. Requirement |#### | | | | | | |
| 2. Architecture | ##|#### | | | | | |
| 3. CI/CD Setup | |#### |#### | | | | |
| 4. Core Development | | ##|#### |#### | | | |
| 5. UI/UX | | | ## |#### | | | |
| 6. Testing & Sec | | | | ## |#### | | |
| 7. Training & SOP | | | | | ## |#### | |
| 8. Beta Launch | | | | | |#### | |
| 9. Full Launch | | | | | | ## |#### |
+-----------------------------------------------------------------------------------+
Legend: # = active week
⚡ Dependency: Core Development phụ thuộc vào CI/CD Setup; UI/UX phụ thuộc vào Core Development; Testing phụ thuộc vào UI/UX; Beta Launch phụ thuộc vào Testing & Sec.
6. Các bước triển khai – 7 Phase lớn
| Phase | Mục tiêu | Công việc con (6‑12) | Người chịu trách nhiệm | Thời gian (tuần) | Dependency |
|---|---|---|---|---|---|
| 1. Khảo sát & Định hướng | Xác định yêu cầu PO, KPI | 1. Interview stakeholder 2. Phân tích thị trường 3. Định nghĩa PO flow 4. Lập backlog 5. Đánh giá rủi ro | BA Lead | 1‑2 | – |
| 2. Thiết kế Kiến trúc | Định hình stack, data model | 1. Diagram microservices 2. Chọn DB (PostgreSQL) 3. Định nghĩa API contract 4. Lựa chọn message broker (Kafka) 5. Xác định caching (Redis) 6. Đánh giá chi phí cloud | Solution Architect | 3‑4 | Phase 1 |
| 3. Xây dựng CI/CD & Infra | Tự động hoá deploy, monitoring | 1. Dockerfile cho mỗi service 2. Docker‑Compose cho local 3. Helm chart cho k8s 4. GitHub Actions pipeline 5. Terraform provision VPC 6. Setup Cloudflare WAF | DevOps Lead | 5‑6 | Phase 2 |
| 4. Phát triển Core Service | Order, Payment, Production Scheduler | 1. Order Service (NestJS) 2. Payment Service (Stripe) 3. Scheduler (Cron + Kafka) 4. Inventory stub 5. Unit test 6. API docs (Swagger) | Lead Backend | 7‑12 | Phase 3 |
| 5. UI/UX Pre‑order | Giao diện đặt cọc, theo dõi | 1. React component library 2. Form validation (Yup) 3. Integration with Order API 4. Responsive design 5. A/B testing setup 6. SEO meta tags | Lead Frontend | 13‑16 | Phase 4 |
| 6. Kiểm thử & Bảo mật | Đảm bảo chất lượng, tuân thủ OWASP | 1. E2E tests (Cypress) 2. Pen‑test (Acunetix) 3. Load test (k6) 4. Code scan (SonarQube) 5. Review GDPR/PCI compliance 6. Disaster recovery plan | QA Lead | 17‑20 | Phase 5 |
| 7. Go‑live & Tối ưu | Đưa sản phẩm vào môi trường production | 1. Deploy blue‑green 2. Monitoring dashboard (Grafana) 3. Alerting (PagerDuty) 4. Post‑launch analytics 5. Feedback loop 6. Iteration planning | PM & Ops | 21‑30 | Phase 6 |
7. Rủi ro & Phương án dự phòng
| Rủi ro | Mức độ (1‑5) | Phương án B | Phương án C |
|---|---|---|---|
| Cash‑flow âm do hủy PO | 4 | Yêu cầu cọc 30 % + thanh toán trước khi sản xuất | Hợp đồng bảo hiểm hủy đơn |
| Delay sản xuất > 30 ngày | 3 | Đánh giá lại nhà cung cấp, chuyển sang đa nguồn | Tự động giảm giá ưu đãi cho khách chờ |
| Lỗi thanh toán (Stripe downtime) | 2 | Switch sang PayPal fallback (API) | Sử dụng ngân hàng nội địa (VNPAY) |
| Quyền riêng tư dữ liệu (GDPR/PCI) | 5 | Audit hàng quý, mã hoá dữ liệu tại rest | Chuyển sang dịch vụ compliance bên thứ ba |
| Tải cao trong flash sale | 3 | Auto‑scale Kubernetes (HPA) | Cache toàn bộ trang PO trên Cloudflare KV |
| Phản hồi tiêu cực do thời gian chờ | 4 | Gửi email cập nhật tiến độ mỗi 3 ngày | Cung cấp voucher giảm giá cho đơn tiếp theo |
🛡️ Mỗi rủi ro cần đăng ký trong Jira với Severity và Owner để theo dõi.
8. KPI, công cụ đo & tần suất
| KPI | Mục tiêu | Công cụ đo | Tần suất |
|---|---|---|---|
| Conversion Rate (Pre‑order → Purchase) | ≥ 12 % | Google Analytics, Mixpanel | Hàng ngày |
| Average DSO | ≤ 15 ngày | Stripe Dashboard, ERP | Hàng tuần |
| Cart Abandonment Rate | ≤ 40 % | Hotjar, GA4 | Hàng ngày |
| System Uptime | 99.9 % | Grafana + Prometheus | 5 phút |
| Order Fulfillment Time | ≤ 30 ngày | Internal KPI Dashboard | Hàng tuần |
| Customer Satisfaction (CSAT) | ≥ 4.5/5 | SurveyMonkey, NPS | Hàng tháng |
| Cost per Acquisition (CPA) | ≤ $12 | Facebook Ads Manager, Google Ads | Hàng tuần |
⚡ Lưu ý: Đặt alert khi DSO > 18 ngày hoặc Conversion Rate < 10 % để kích hoạt quy trình “Cash‑flow Review”.
9. Tài liệu bàn giao cuối dự án
| STT | Tài liệu | Người viết | Nội dung bắt buộc |
|---|---|---|---|
| 1 | Requirement Specification | BA Lead | Mô tả chức năng PO, luồng cọc, thời gian giao, KPI |
| 2 | Architecture Diagram | Solution Architect | Microservice, DB, Message broker, CDN |
| 3 | API Contract (OpenAPI 3.0) | Lead Backend | Endpoint, request/response, error codes |
| 4 | Data Model ERD | DBA | Bảng Orders, Payments, Products, Users |
| 5 | CI/CD Pipeline YAML | DevOps Lead | GitHub Actions, Docker, Helm, Secrets |
| 6 | Infrastructure as Code (Terraform) | DevOps Lead | VPC, Subnet, RDS, S3, Cloudflare |
| 7 | Docker Compose File | DevOps Lead | Local dev stack |
| 8 | Kubernetes Helm Charts | DevOps Lead | Deployment, Service, Ingress, HPA |
| 9 | Security Assessment Report | QA Lead | OWASP, Pen‑test, GDPR compliance |
| 10 | Performance Test Report | QA Lead | k6 scripts, load 10k RPS |
| 11 | User Manual (Admin) | BA Lead | Quản lý PO, cập nhật trạng thái |
| 12 | User Manual (Customer) | Content Team | Hướng dẫn đặt cọc, theo dõi đơn |
| 13 | Release Notes | PM | Các tính năng, bug fix, known issues |
| 14 | Rollback Plan | Ops Lead | Steps, scripts, fallback version |
| 15 | Post‑launch Monitoring Dashboard | Ops Lead | Grafana panels, alerts, SLA |
10. Checklist Go‑Live (42‑48 mục)
10.1. Nhóm Security & Compliance
| # | Mục kiểm tra | Trạng thái |
|---|---|---|
| 1 | SSL/TLS certificate hợp lệ (Let’s Encrypt) | ☐ |
| 2 | CSP header cấu hình đầy đủ | ☐ |
| 3 | OWASP Top‑10 đã được quét và remediate | ☐ |
| 4 | PCI‑DSS compliance cho payment gateway | ☐ |
| 5 | GDPR consent banner hoạt động | ☐ |
| 6 | Rate‑limit API (Cloudflare) | ☐ |
| 7 | Secrets được lưu trong Vault/KMS | ☐ |
| 8 | Backup DB hàng ngày, test restore | ☐ |
10.2. Nhóm Performance & Scalability
| # | Mục kiểm tra | Trạng thái |
|---|---|---|
| 9 | Auto‑scale HPA cho Order Service | ☐ |
| 10 | CDN cache cho static assets | ☐ |
| 11 | Load test ≥ 10 k RPS thành công | ☐ |
| 12 | Response time < 200 ms (API) | ☐ |
| 13 | Redis cache hit rate > 95 % | ☐ |
| 14 | Zero‑downtime deploy (blue‑green) | ☐ |
| 15 | Log aggregation (ELK) hoạt động | ☐ |
10.3. Nhóm Business & Data Accuracy
| # | Mục kiểm tra | Trạng thái |
|---|---|---|
| 16 | Giá sản phẩm, cọc, VAT đúng | ☐ |
| 17 | Stock (0) hiển thị đúng | ☐ |
| 18 | Email notification template | ☐ |
| 19 | Order status workflow (cọc → sản xuất → giao) | ☐ |
| 20 | Báo cáo doanh thu PO (Google Data Studio) | ☐ |
| 21 | NPS survey link hoạt động | ☐ |
| 22 | Đánh giá KPI dashboard | ☐ |
10.4. Nhóm Payment & Finance
| # | Mục kiểm tra | Trạng thái |
|---|---|---|
| 23 | Stripe webhook verification | ☐ |
| 24 | Reconciliation script chạy nightly | ☐ |
| 25 | Refund flow test (cọc → full) | ☐ |
| 26 | Tax calculation (VAT 10 %) | ☐ |
| 27 | Invoice PDF generation | ☐ |
| 28 | Payment gateway failover (PayPal) | ☐ |
10.5. Nhóm Monitoring & Rollback
| # | Mục kiểm tra | Trạng thái |
|---|---|---|
| 29 | Grafana alerts (DSO, error rate) | ☐ |
| 30 | PagerDuty escalation policy | ☐ |
| 31 | Health check endpoint (/health) | ☐ |
| 32 | Canary release metrics | ☐ |
| 33 | Rollback script (kubectl set image) | ☐ |
| 34 | Incident post‑mortem template | ☐ |
| 35 | Log retention policy (30 days) | ☐ |
| 36 | SLA compliance dashboard | ☐ |
| 37 | Feature flag toggle (LaunchDarkly) | ☐ |
| 38 | Documentation versioning (Git) | ☐ |
| 39 | Backup verification (weekly) | ☐ |
| 40 | DNS TTL < 300 s | ☐ |
| 41 | SSL Labs grade A+ | ☐ |
| 42 | End‑to‑end test script (Cypress) | ☐ |
| 43‑48 | (Các mục tùy chỉnh dựa trên môi trường) | ☐ |
🛡️ Khi bất kỳ mục nào ❌ thì không tiến hành go‑live.
11. Code & Config mẫu (≥ 12 đoạn)
11.1. Docker‑Compose (local dev)
version: "3.8"
services:
api:
build: ./backend
ports:
- "3000:3000"
env_file: .env
depends_on:
- db
- redis
frontend:
build: ./frontend
ports:
- "8080:80"
env_file: .env
db:
image: postgres:15-alpine
environment:
POSTGRES_USER: app
POSTGRES_PASSWORD: secret
POSTGRES_DB: preorder
volumes:
- pgdata:/var/lib/postgresql/data
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
pgdata:
11.2. Nginx config (reverse proxy + caching)
server {
listen 80;
server_name shop.example.com;
# SSL termination (let's encrypt)
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/shop.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/shop.example.com/privkey.pem;
# Security headers
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options SAMEORIGIN;
add_header Content-Security-Policy "default-src 'self' https:; img-src * data:;";
location /api/ {
proxy_pass http://api:3000/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location / {
proxy_pass http://frontend:80/;
proxy_set_header Host $host;
proxy_cache my_cache;
proxy_cache_valid 200 10m;
}
}
11.3. Medusa plugin – Pre‑order extension (Node)
// plugins/preorder/index.js
module.exports = (pluginOptions) => {
return {
// Hook vào khi tạo order
async beforeCreateOrder(event) {
const { cart } = event;
// Kiểm tra flag preorder
if (cart.metadata?.preorder) {
// Đánh dấu order là PO, tạo deadline 30 ngày
event.order.metadata = {
...event.order.metadata,
preorder: true,
deadline: new Date(Date.now() + 30*24*60*60*1000)
};
// Yêu cầu cọc 30%
event.order.payment_total = Math.round(event.order.subtotal * 0.3);
}
},
};
};
11.4. Cloudflare Worker – Cache PO page
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
const url = new URL(request.url)
if (url.pathname.startsWith('/preorder/')) {
// Cache 5 phút, bypass khi có cookie session
const cacheKey = new Request(url.toString(), request)
const cache = caches.default
let response = await cache.match(cacheKey)
if (!response) {
response = await fetch(request)
response = new Response(response.body, response)
response.headers.set('Cache-Control', 'public, max-age=300')
await cache.put(cacheKey, response.clone())
}
return response
}
return fetch(request)
}
11.5. Script đối soát payment (Node + Stripe)
// scripts/reconcile-payments.js
const stripe = require('stripe')(process.env.STRIPE_SECRET);
const { PrismaClient } = require('@prisma/client');
const prisma = new PrismaClient();
async function reconcile() {
const charges = await stripe.charges.list({ limit: 100 });
for (const charge of charges.data) {
const order = await prisma.order.findUnique({ where: { stripeChargeId: charge.id } });
if (order && order.payment_status !== charge.status) {
await prisma.order.update({
where: { id: order.id },
data: { payment_status: charge.status }
});
console.log(`Updated order ${order.id} to ${charge.status}`);
}
}
}
reconcile().catch(console.error);
11.6. GitHub Actions CI/CD (YAML)
name: CI/CD Pipeline
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install deps
run: npm ci
- name: Lint & Test
run: npm run lint && npm test
- name: Build Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}:${{ github.sha }} .
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
docker push ghcr.io/${{ github.repository }}:${{ github.sha }}
deploy:
needs: build
runs-on: ubuntu-latest
environment: production
steps:
- name: Deploy to Kubernetes
uses: azure/k8s-deploy@v4
with:
manifests: |
k8s/deployment.yaml
k8s/service.yaml
images: |
ghcr.io/${{ github.repository }}:${{ github.sha }}
namespace: prod
11.7. Kubernetes Deployment (Helm template)
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "preorder.fullname" . }}
labels:
{{- include "preorder.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "preorder.name" . }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "preorder.name" . }}
spec:
containers:
- name: api
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
- containerPort: 3000
envFrom:
- secretRef:
name: {{ include "preorder.fullname" . }}-secret
resources:
limits:
cpu: "500m"
memory: "512Mi"
requests:
cpu: "250m"
memory: "256Mi"
11.8. Redis cache config (Redis‑CLI)
# Set eviction policy to allkeys-lru
redis-cli CONFIG SET maxmemory-policy allkeys-lru
# Limit memory to 2GB
redis-cli CONFIG SET maxmemory 2gb
# Enable persistence (RDB snapshot each 15 min)
redis-cli CONFIG SET save "900 1"
11.9. Stripe webhook handler (NestJS)
// src/webhook/stripe.controller.ts
import { Controller, Post, Headers, Body, HttpCode } from '@nestjs/common';
import { StripeService } from './stripe.service';
import * as stripePkg from 'stripe';
const stripe = new stripePkg.Stripe(process.env.STRIPE_SECRET, { apiVersion: '2023-08-16' });
@Controller('webhook')
export class StripeWebhookController {
@Post()
@HttpCode(200)
async handle(@Headers('stripe-signature') sig: string, @Body() payload: any) {
const event = stripe.webhooks.constructEvent(payload, sig, process.env.STRIPE_WEBHOOK_SECRET);
await this.stripeService.processEvent(event);
return { received: true };
}
}
11.10. GraphQL query – Lấy danh sách PO đang chờ
query GetPendingPreorders($limit: Int!) {
orders(filter: {status: "PREORDER_PENDING"}, limit: $limit) {
id
customer {
email
name
}
total
depositAmount
deadline
}
}
11.11. Cypress E2E test – Đặt PO
describe('Pre‑order flow', () => {
it('User can place a pre‑order with 30% deposit', () => {
cy.visit('/product/awesome‑jacket');
cy.get('[data-test="preorder-btn"]').click();
cy.get('[data-test="deposit-input"]').type('30');
cy.get('[data-test="checkout-btn"]').click();
cy.url().should('include', '/checkout');
cy.get('[data-test="payment-success"]').should('exist');
});
});
11.12. SonarQube quality gate (properties)
sonar.projectKey=preorder-fashion
sonar.organization=your-org
sonar.host.url=https://sonarcloud.io
sonar.login=${SONAR_TOKEN}
sonar.sources=src
sonar.tests=tests
sonar.javascript.lcov.reportPaths=coverage/lcov.info
12. Kết luận – Key Takeaways
- Pre‑order giảm rủi ro tồn kho nhưng tăng yêu cầu quản lý cash‑flow; cọc ≥ 30 % là chuẩn tối thiểu.
- Stack custom Node.js + React cho phép tích hợp AI dự báo nhu cầu, tự động điều chỉnh cọc và thời gian sản xuất.
- CI/CD, IaC và monitoring là nền tảng để duy trì uptime ≥ 99.9 % trong các đợt flash sale.
- Rủi ro tài chính & thời gian giao cần có kế hoạch B/C rõ ràng, cùng với alert KPI (DSO, Conversion).
- Checklist go‑live > 42 mục, chia 5 nhóm, giúp giảm lỗi “đưa vào production mà chưa kiểm tra bảo mật/ performance”.
⚡ Best Practice: Đặt feature flag cho chế độ “Pre‑order only” và bật dần qua các khu vực (A/B) để đo lường ảnh hưởng tới Conversion và DSO trước khi mở toàn bộ.
13. Câu hỏi thảo luận
- Anh em đã gặp delay sản xuất > 30 ngày trong dự án PO nào chưa? Phương án giảm thiểu nào hiệu quả nhất?
- Khi cọc thấp hơn 30 %, có nên tự động hủy PO hay đề xuất upsell?
14. Kêu gọi hành động
Nếu đang cân nhắc tự động hoá quy trình PO hoặc muốn tích hợp AI dự báo nhu cầu nhanh chóng, hãy thử Serimi App – API chuẩn, hỗ trợ scaling ngay từ 10 k đơn/ngày.
Anh em làm Content/SEO muốn tự động hoá quy trình? Tham khảo bộ công cụ noidungso.io.vn – giảm 30 % thời gian viết mô tả sản phẩm.
Nội dung được Hải định hướng, trợ lý AI giúp mình viết chi tiết.








