feat(cms): hosting plans page with lifecycle gate and net + VAT prices (MITHOME-130)
CI Pipeline with Test Management / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
CI Pipeline with Test Management / 🐳 Docker Integration Tests (push) Canceled after 0s
CI Pipeline with Test Management / 🏗️ Build Docker Image (push) Canceled after 0s
CI Pipeline with Test Management / 📊 Generate Test Summary (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 📊 Analyze Test Coverage (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🔄 Sync with Linear (push) Canceled after 0s
Test Reporting & Gherkin Analysis / ⚡ Performance Monitoring (push) Canceled after 0s
CI Pipeline with Test Management / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
CI Pipeline with Test Management / 🐳 Docker Integration Tests (push) Canceled after 0s
CI Pipeline with Test Management / 🏗️ Build Docker Image (push) Canceled after 0s
CI Pipeline with Test Management / 📊 Generate Test Summary (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 📊 Analyze Test Coverage (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🔄 Sync with Linear (push) Canceled after 0s
Test Reporting & Gherkin Analysis / ⚡ Performance Monitoring (push) Canceled after 0s
- Products collection (interim mirror of the PLATFM-14 catalogue contract): lifecycle status, product type, required whole-forint net price, yearly billing, service definition, per-product English gate - HostingPlans global: page copy, comparison labels, VAT rate (27%) - Gate: production shows only active plans, staging all but retired; with no showable plan the page is 404 and left out of the menu and the sitemap - /hu/tarhely-csomagok <-> /en/hosting-plans via PAGE_SLUGS (hreflang, language switcher, CTA page picker) - Seed migration 20260929_hosting_plans: mIT Start (14 900 Ft/yr, 5 mailboxes) and mIT Mid (23 900 Ft/yr) as drafts, English AI draft; idempotent - Production SEO suite expects at least 12 sitemap URLs; new SMOKE-10 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
0c5888761b
commit
1e0742a548
@@ -24,11 +24,13 @@ import { LegalPages } from './collections/LegalPages'
|
||||
import { Media } from './collections/Media'
|
||||
import { Partners } from './collections/Partners'
|
||||
import { ContactSubmissions } from './collections/ContactSubmissions'
|
||||
import { Products } from './collections/Products'
|
||||
import { Home } from './globals/Home'
|
||||
import { About } from './globals/About'
|
||||
import { Services } from './globals/Services'
|
||||
import { Contact } from './globals/Contact'
|
||||
import { Common } from './globals/Common'
|
||||
import { HostingPlans } from './globals/HostingPlans'
|
||||
|
||||
type FieldLike = { name?: string; required?: boolean; type?: string }
|
||||
|
||||
@@ -38,8 +40,8 @@ function findField(fields: unknown[], name: string): FieldLike | undefined {
|
||||
|
||||
describe('Payload collections', () => {
|
||||
it('all collection slugs are present and unique', () => {
|
||||
const slugs = [Users, LegalPages, Media, Partners, ContactSubmissions].map((c) => c.slug)
|
||||
expect(slugs).toEqual(['users', 'legal-pages', 'media', 'partners', 'contact-submissions'])
|
||||
const slugs = [Users, LegalPages, Media, Partners, ContactSubmissions, Products].map((c) => c.slug)
|
||||
expect(slugs).toEqual(['users', 'legal-pages', 'media', 'partners', 'contact-submissions', 'products'])
|
||||
expect(new Set(slugs).size).toBe(slugs.length)
|
||||
})
|
||||
|
||||
@@ -130,8 +132,8 @@ describe('Payload collections', () => {
|
||||
|
||||
describe('Payload globals', () => {
|
||||
it('all global slugs are present and unique', () => {
|
||||
const slugs = [Home, About, Services, Contact, Common].map((g) => g.slug)
|
||||
expect(slugs).toEqual(['home', 'about', 'services', 'contact', 'common'])
|
||||
const slugs = [Home, About, Services, Contact, Common, HostingPlans].map((g) => g.slug)
|
||||
expect(slugs).toEqual(['home', 'about', 'services', 'contact', 'common', 'hosting-plans'])
|
||||
expect(new Set(slugs).size).toBe(slugs.length)
|
||||
})
|
||||
|
||||
@@ -155,7 +157,8 @@ describe('Payload globals', () => {
|
||||
// DECISION (design D1): structural values shared across locales.
|
||||
// MITHOME-112: `slug` is the shared URL identifier of LegalPages.
|
||||
// MITHOME-113: `result`/`notes` are legal-validation metadata, not copy.
|
||||
const SHARED_TEXT_FIELDS = new Set(['icon', 'id', 'address', 'slug', 'result', 'notes'])
|
||||
// MITHOME-130: a product `name` is a brand, the same in every language.
|
||||
const SHARED_TEXT_FIELDS = new Set(['icon', 'id', 'address', 'slug', 'result', 'notes', 'name'])
|
||||
|
||||
type Node = FieldLike & { localized?: boolean; fields?: Node[] }
|
||||
type Finding = { path: string; type?: string; localized: boolean }
|
||||
@@ -187,7 +190,7 @@ describe('Payload globals', () => {
|
||||
return !SHARED_TEXT_FIELDS.has(finding.path.split('.').pop()!)
|
||||
}
|
||||
|
||||
it.each([Home, About, Services, Contact, Common, LegalPages].map((g) => [g.slug, g] as const))(
|
||||
it.each([Home, About, Services, Contact, Common, LegalPages, Products, HostingPlans].map((g) => [g.slug, g] as const))(
|
||||
'should localize exactly the translatable fields of %s',
|
||||
(_slug, global) => {
|
||||
const findings = walk(global.fields as Node[], '', [])
|
||||
@@ -218,7 +221,7 @@ describe('Payload globals', () => {
|
||||
|
||||
it('should offer every routable page, including home, in the page selector', () => {
|
||||
const page = findField(cta('primary'), 'page') as unknown as { options: { value: string }[] }
|
||||
expect(page.options.map((o) => o.value)).toEqual(['home', 'about', 'services', 'contact', 'privacy', 'terms'])
|
||||
expect(page.options.map((o) => o.value)).toEqual(['home', 'about', 'services', 'hostingPlans', 'contact', 'privacy', 'terms'])
|
||||
})
|
||||
|
||||
it('should require a page only for internal links and a URL only for external links', () => {
|
||||
@@ -232,7 +235,7 @@ describe('Payload globals', () => {
|
||||
})
|
||||
|
||||
describe('MITHOME-113 English translation status', () => {
|
||||
it.each([Home, About, Services, Contact, Common, LegalPages].map((d) => [d.slug, d] as const))(
|
||||
it.each([Home, About, Services, Contact, Common, LegalPages, Products, HostingPlans].map((d) => [d.slug, d] as const))(
|
||||
'should give %s a shared sidebar status that defaults to "none"',
|
||||
(_slug, doc) => {
|
||||
const field = findField(doc.fields, 'enTranslationStatus') as unknown as {
|
||||
@@ -266,3 +269,35 @@ describe('MITHOME-113 legal validation gate', () => {
|
||||
},
|
||||
)
|
||||
})
|
||||
|
||||
describe('MITHOME-130 hosting plans', () => {
|
||||
type Select = { defaultValue: string; required?: boolean; options: { value: string }[]; admin?: { position?: string } }
|
||||
type Validate = (value: unknown) => true | string
|
||||
const group = (name: string) => (findField(Products.fields, name) as unknown as { fields: unknown[] }).fields
|
||||
|
||||
it('should start every product as a draft with the catalogue lifecycle and types', () => {
|
||||
const status = findField(Products.fields, 'status') as unknown as Select
|
||||
expect(status).toMatchObject({ required: true, defaultValue: 'draft', admin: { position: 'sidebar' } })
|
||||
expect(status.options.map((o) => o.value)).toEqual(['draft', 'internal', 'publishable', 'active', 'retired'])
|
||||
const type = findField(Products.fields, 'productType') as unknown as Select
|
||||
expect(type.options.map((o) => o.value)).toEqual(['hosting', 'managed-service'])
|
||||
const slug = findField(Products.fields, 'slug') as FieldLike & { unique?: boolean }
|
||||
expect(slug).toMatchObject({ required: true, unique: true })
|
||||
})
|
||||
|
||||
it('should require a whole, non-negative net price and default to yearly billing', () => {
|
||||
const net = findField(group('pricing'), 'netAmount') as unknown as FieldLike & { validate: Validate }
|
||||
expect(net.required).toBe(true)
|
||||
expect(net.validate(14900)).toBe(true)
|
||||
expect(net.validate(14900.5)).toEqual(expect.any(String))
|
||||
expect(net.validate(-1)).toEqual(expect.any(String))
|
||||
const period = findField(group('pricing'), 'billingPeriod') as unknown as Select
|
||||
expect(period.defaultValue).toBe('yearly')
|
||||
})
|
||||
|
||||
it('should keep the VAT rate as a shared page setting, 27% by default', () => {
|
||||
const vat = findField(HostingPlans.fields, 'vatRatePercent') as unknown as FieldLike & { defaultValue: number; localized?: boolean }
|
||||
expect(vat).toMatchObject({ type: 'number', required: true, defaultValue: 27 })
|
||||
expect(vat.localized).toBeUndefined()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user