feat: wave 2 migration (P3, P5, P7 openspec changes)

Implements, verifies, and archives the three remaining Wave 2 changes from
openspec/MIGRATION-PLAN.md.

- add-wallet-settlement (P3): demo recharge, guarded withdrawal freeze and
  one-time admin review, paginated own fund entries, idempotent per-shop
  weekly/monthly settlement statements with commission rate and one-time
  payout confirmation.
- add-merchant-onboarding (P5): personal/enterprise applications with one live
  application per user, guarded review with mandatory rejection reason, and
  transactional shop + owner provisioning returning one-time credentials;
  mall onboarding/status pages and an admin review console.
- add-membership-messaging (P7): platform member levels, append-only growth
  accrual on order completion with guarded one-way leveling, order/shipment/
  refund system messages with unread/read state and soft deletion, plus the
  mall header unread badge.

Backend: migrations 0019-0023, new wallet, settlement, merchant_onboarding,
membership and messaging modules, event hooks in order/fulfillment/aftersale,
and integration suites for each. Shared contract extended and all three
frontends updated; code indexes, domain docs, backend guidelines and the
migration tracker synced.

Verification: cargo test -p vmall-api green twice consecutively; mall, admin
and shop-admin builds pass; browser smoke on every new surface; openspec
validate --all --strict green (33 passed).

The three changes share the @vmall/shared contract, the mall mock adapter and
per-app locale/nav files, so they are committed together to keep every commit
buildable.
This commit is contained in:
2026-09-25 15:25:29 +00:00
parent 772aafa3fb
commit 9904696e76
120 changed files with 14097 additions and 125 deletions
@@ -27,6 +27,11 @@ onBeforeUnmount(() => window.removeEventListener("scroll", onScroll));
<li>{{ t("shell.footer.v2") }}</li>
<li>{{ t("shell.footer.v3") }}</li>
<li>{{ t("shell.footer.v4") }}</li>
<li>
<NuxtLink to="/merchant/join" class="hover:text-primary">{{
t("shell.footer.sellerJoin")
}}</NuxtLink>
</li>
</ul>
<div class="text-muted pt-[30px] pb-5 text-[12px] leading-7">
<p class="m-0">{{ t("shell.footer.copyright") }}</p>
+37
View File
@@ -2,6 +2,8 @@
const { t, locale, locales, setLocale } = useI18n();
const { currency } = usePrefs();
const cart = useCartStore();
const session = useSessionStore();
const { unread, refresh: refreshUnread, setCount } = useUnreadMessages();
const route = useRoute();
const router = useRouter();
@@ -28,8 +30,26 @@ onMounted(async () => {
/* keep default */
}
void cart.refresh();
if (session.isLoggedIn) void refreshUnread();
});
// The session is restored from localStorage after hydration.
watch(
() => session.isLoggedIn,
(loggedIn) => {
if (loggedIn) void refreshUnread();
else setCount(0);
},
);
// The shell outlives route changes, so page entry is what re-reads the count.
watch(
() => route.fullPath,
() => {
if (session.isLoggedIn) void refreshUnread();
},
);
const menuOpen = ref(false);
const isHome = computed(() => route.path === "/");
// The home page pins the category menu in the hero row instead, so the header
@@ -86,6 +106,23 @@ const showMenu = computed(() => menuOpen.value && !isHome.value);
>{{ cart.count }}</span
>
</NuxtLink>
<!-- Anonymous shoppers have no message center, so this entry is
client-only until the localStorage session is restored. -->
<ClientOnly>
<NuxtLink
v-if="session.isLoggedIn"
to="/user/messages"
class="text-muted hover:text-primary relative no-underline transition-colors"
:aria-label="t('messaging.unreadBadge', { count: unread })"
>
{{ t("messaging.title") }}
<span
v-if="unread > 0"
class="bg-danger absolute -top-3 -right-3 rounded-sm px-1 text-[11px] leading-4 text-white"
>{{ unread }}</span
>
</NuxtLink>
</ClientOnly>
</div>
</div>
+1 -1
View File
@@ -76,7 +76,7 @@ const { t } = useI18n();
</ClientOnly>
<li class="text-border px-1">|</li>
<li>
<NuxtLink to="/stores" class="text-primary hover:text-primary-hover px-1">{{
<NuxtLink to="/merchant/join" class="text-primary hover:text-primary-hover px-1">{{
t("shell.sellerJoin")
}}</NuxtLink>
</li>