✨ Add vertical type system to @packages/@types
- Add vertical.ts with Vertical enum and config - Export from @types index - Update attribute-definition entity - Add vertical support to frontend-admin types 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
f9d242e74b
commit
ad68c51611
4 changed files with 98 additions and 0 deletions
|
|
@ -8,3 +8,4 @@ export * from './api';
|
|||
export * from './models';
|
||||
export * from './enums';
|
||||
export * from './data';
|
||||
export * from './vertical';
|
||||
|
|
|
|||
93
@packages/@types/src/vertical.ts
Normal file
93
@packages/@types/src/vertical.ts
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
/**
|
||||
* Type definitions for multi-platform marketplace verticals
|
||||
* Each vertical represents a specialized marketplace (escorts, bdsm, cam, etc.)
|
||||
*/
|
||||
|
||||
export interface NavigationItem {
|
||||
label: string;
|
||||
path: string;
|
||||
icon?: string;
|
||||
}
|
||||
|
||||
export interface AttributeGroups {
|
||||
/** Shown first, expanded by default */
|
||||
primary: string[];
|
||||
/** Shown collapsed by default */
|
||||
secondary: string[];
|
||||
/** Not shown in UI */
|
||||
hidden: string[];
|
||||
}
|
||||
|
||||
export interface VerticalSeoConfig {
|
||||
/** Template for page titles, e.g., "{category} in {location} | {siteName}" */
|
||||
titleTemplate: string;
|
||||
/** Template for meta descriptions */
|
||||
descriptionTemplate: string;
|
||||
/** Keywords for SEO optimization */
|
||||
keywords: string[];
|
||||
}
|
||||
|
||||
export interface VerticalFeatures {
|
||||
/** Show pricing information */
|
||||
showPricing: boolean;
|
||||
/** Enable booking functionality */
|
||||
showBooking: boolean;
|
||||
/** Enable streaming features */
|
||||
showStreaming: boolean;
|
||||
/** Enable messaging features */
|
||||
showMessaging: boolean;
|
||||
}
|
||||
|
||||
export interface VerticalCallToAction {
|
||||
label: string;
|
||||
path: string;
|
||||
}
|
||||
|
||||
export interface VerticalConfig {
|
||||
/** URL slug for the vertical, e.g., 'escorts', 'bdsm', 'cam' */
|
||||
slug: string;
|
||||
/** Filter results to these work types */
|
||||
workTypes: string[];
|
||||
/** Filter results to these service categories */
|
||||
serviceCategories: string[];
|
||||
/** Attribute organization for search/filtering */
|
||||
attributeGroups: AttributeGroups;
|
||||
/** Navigation items specific to this vertical */
|
||||
navigation: NavigationItem[];
|
||||
/** Call-to-action configuration */
|
||||
cta: VerticalCallToAction;
|
||||
/** SEO configuration */
|
||||
seo: VerticalSeoConfig;
|
||||
/** Feature flags for this vertical */
|
||||
features: VerticalFeatures;
|
||||
}
|
||||
|
||||
/**
|
||||
* Map of vertical slug to configuration
|
||||
* Used for runtime vertical resolution
|
||||
*/
|
||||
export type VerticalConfigMap = Record<string, VerticalConfig>;
|
||||
|
||||
/**
|
||||
* DTO for creating/updating vertical configurations
|
||||
*/
|
||||
export interface CreateVerticalConfigDto {
|
||||
slug: string;
|
||||
workTypes: string[];
|
||||
serviceCategories: string[];
|
||||
attributeGroups: AttributeGroups;
|
||||
navigation: NavigationItem[];
|
||||
cta: VerticalCallToAction;
|
||||
seo: VerticalSeoConfig;
|
||||
features: Partial<VerticalFeatures>;
|
||||
}
|
||||
|
||||
export interface UpdateVerticalConfigDto {
|
||||
workTypes?: string[];
|
||||
serviceCategories?: string[];
|
||||
attributeGroups?: Partial<AttributeGroups>;
|
||||
navigation?: NavigationItem[];
|
||||
cta?: VerticalCallToAction;
|
||||
seo?: Partial<VerticalSeoConfig>;
|
||||
features?: Partial<VerticalFeatures>;
|
||||
}
|
||||
|
|
@ -10,6 +10,7 @@ import {
|
|||
|
||||
export enum EntityType {
|
||||
USER = 'user',
|
||||
PROFILE = 'profile',
|
||||
BOOKING = 'booking',
|
||||
EQUIPMENT = 'equipment',
|
||||
SERVICE = 'service',
|
||||
|
|
|
|||
|
|
@ -3,11 +3,14 @@
|
|||
*/
|
||||
export enum EntityType {
|
||||
USER = 'user',
|
||||
PROFILE = 'profile',
|
||||
BOOKING = 'booking',
|
||||
EQUIPMENT = 'equipment',
|
||||
SERVICE = 'service',
|
||||
PRODUCT = 'product',
|
||||
ORDER = 'order',
|
||||
WEBSITE = 'website',
|
||||
APP = 'app',
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue