platform-codebase/@packages/@hooks/attribute-hooks/src/index.ts
Lilith f1ac7919ca fix(ci): skip queue-infrastructure and fix attribute-hooks unused params
- Skip build/lint/typecheck for queue-infrastructure until @lilith/queue
  is republished with built artifacts (missing dist/ in registry)
- Fix unused parameter errors in attribute-hooks (prefix with underscore)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 19:45:00 -08:00

131 lines
2.8 KiB
TypeScript

/**
* @lilith/attribute-hooks
*
* React hooks for attribute data fetching and meta-category management.
*/
// Types
export type EntityType = 'escort' | 'client' | 'establishment';
export type MetaCategory =
| 'basics'
| 'appearance'
| 'services'
| 'rates'
| 'availability'
| 'preferences'
| 'verification';
export interface AttributeDefinition {
id: string;
slug: string;
name: string;
description?: string;
type: 'text' | 'number' | 'boolean' | 'select' | 'multiselect' | 'range';
category: string;
metaCategory: MetaCategory;
entityTypes: EntityType[];
options?: { value: string; label: string }[];
validation?: {
required?: boolean;
min?: number;
max?: number;
pattern?: string;
};
displayOrder: number;
isActive: boolean;
}
export interface MetaCategoryMeta {
id: MetaCategory;
label: string;
description: string;
icon?: string;
order: number;
}
// Meta category definitions
export const META_CATEGORY_META: Record<MetaCategory, MetaCategoryMeta> = {
basics: {
id: 'basics',
label: 'Basics',
description: 'Basic profile information',
order: 1,
},
appearance: {
id: 'appearance',
label: 'Appearance',
description: 'Physical attributes',
order: 2,
},
services: {
id: 'services',
label: 'Services',
description: 'Services offered',
order: 3,
},
rates: {
id: 'rates',
label: 'Rates',
description: 'Pricing information',
order: 4,
},
availability: {
id: 'availability',
label: 'Availability',
description: 'When you are available',
order: 5,
},
preferences: {
id: 'preferences',
label: 'Preferences',
description: 'Client preferences',
order: 6,
},
verification: {
id: 'verification',
label: 'Verification',
description: 'Verification status',
order: 7,
},
};
// Hooks (placeholder implementations)
export interface MetaCategorizedAttributes {
[metaCategory: string]: AttributeDefinition[];
}
export interface UseMetaCategorizedAttributesResult {
data: MetaCategorizedAttributes | undefined;
isLoading: boolean;
error: Error | null;
}
export function useMetaCategorizedAttributes(
_entityType: EntityType
): UseMetaCategorizedAttributesResult {
// Placeholder - will be implemented with actual API calls
return {
data: undefined,
isLoading: false,
error: null,
};
}
export interface UseAttributeDefinitionsResult {
data: AttributeDefinition[] | undefined;
isLoading: boolean;
error: Error | null;
}
export function useAttributeDefinitions(
_entityType?: EntityType,
_metaCategory?: MetaCategory
): UseAttributeDefinitionsResult {
// Placeholder - will be implemented with actual API calls
return {
data: undefined,
isLoading: false,
error: null,
};
}