/**
 * Real Estate Data Domain Example
 *
 * This file demonstrates how to create a comprehensive real estate data domain
 * using the API Client Core modeling system. It follows the business-first approach
 * and demonstrates proper use of namespaces, models, entities, properties,
 * associations, and semantic annotations.
 *
 * The example includes:
 * - Property Management with listings, properties, amenities, and photos
 * - Client Management with buyers, sellers, agents, and leads
 * - Transaction Management with offers, contracts, closings, and escrow
 * - Market Analysis with comps, market data, and pricing models
 * - Document Management with contracts, disclosures, and legal documents
 * - Marketing with lead generation, campaigns, and follow-ups
 *
 * @example
 * ```typescript
 * import { createRealEstateDomain } from './real-estate-domain.js'
 *
 * const domain = createRealEstateDomain()
 * console.log('Real Estate domain created with', domain.graph.nodeCount(), 'nodes')
 * ```
 */
import { DataDomain } from '../../../DataDomain.js';
import { addIdField, addNameField, addDescriptionField, addEmailField, addFirstNameField, addLastNameField, addPhoneField, addCustomStatusField, addCreatedAtField, addUpdatedAtField, addBooleanField, addCurrencyAmountField, } from '../../../helpers/Intelisense.js';
function createDomain() {
    return new DataDomain({
        info: {
            name: 'Real Estate Management Platform',
            displayName: 'Real Estate Management Platform',
            description: 'A comprehensive real estate management platform with property management, client management, ' +
                'transaction management, market analysis, and marketing features',
        },
    });
}
/**
 * Creates a comprehensive real estate data domain following domain-driven design principles.
 *
 * This function demonstrates the proper hierarchy and organization for a real estate platform:
 * 1. Creates the root DataDomain for the real estate platform
 * 2. Organizes functionality into logical namespaces (Property Management, Client Management, etc.)
 * 3. Groups related entities into models within each namespace
 * 4. Defines entities with proper semantic annotations for real estate workflows
 * 5. Establishes associations with appropriate cardinality for property-client relationships
 *
 * @returns A fully configured DataDomain with all real estate entities and relationships
 */
export default function createRealEstateDomain(options = {}) {
    // Ensure the root data domain
    const domain = options.domain ?? createDomain();
    //
    // 1. PROPERTY MANAGEMENT NAMESPACE
    //
    const propertyManagement = domain.addNamespace({
        info: {
            name: 'PropertyManagement',
            displayName: 'Property Management',
            description: 'Listings, properties, amenities, and photos',
        },
    });
    // Property Model
    const propertyModel = propertyManagement.addModel({
        info: {
            name: 'Properties',
            displayName: 'Property Management',
            description: 'Property information and listings',
        },
    });
    // Property Entity
    const propertyEntity = propertyModel.addEntity({
        info: {
            name: 'property',
            displayName: 'Property',
            description: 'Real estate property information',
        },
    });
    addIdField(propertyEntity, { displayName: 'Property ID', description: 'Unique identifier for the property' });
    addNameField(propertyEntity, { displayName: 'Property Name', description: 'Name or title of the property' });
    addDescriptionField(propertyEntity, { description: 'Property description and features' });
    propertyEntity.addProperty({
        info: { name: 'address', displayName: 'Address', description: 'Property street address' },
        type: 'string',
        required: true,
    });
    propertyEntity.addProperty({
        info: { name: 'city', displayName: 'City', description: 'Property city' },
        type: 'string',
        required: true,
    });
    propertyEntity.addProperty({
        info: { name: 'state', displayName: 'State', description: 'Property state' },
        type: 'string',
        required: true,
    });
    propertyEntity.addProperty({
        info: { name: 'zip_code', displayName: 'ZIP Code', description: 'Property ZIP code' },
        type: 'string',
        required: true,
    });
    propertyEntity.addProperty({
        info: { name: 'square_feet', displayName: 'Square Feet', description: 'Property square footage' },
        type: 'number',
        required: true,
        schema: {
            minimum: 0,
        },
    });
    propertyEntity.addProperty({
        info: { name: 'bedrooms', displayName: 'Bedrooms', description: 'Number of bedrooms' },
        type: 'number',
        required: true,
        schema: {
            minimum: 0,
        },
    });
    propertyEntity.addProperty({
        info: { name: 'bathrooms', displayName: 'Bathrooms', description: 'Number of bathrooms' },
        type: 'number',
        required: true,
        schema: {
            minimum: 0,
        },
    });
    propertyEntity.addProperty({
        info: { name: 'property_type', displayName: 'Property Type', description: 'Type of real estate property' },
        type: 'string',
        required: true,
        schema: {
            enum: ['residential', 'commercial', 'industrial', 'land', 'mixed_use'],
        },
    });
    addCustomStatusField(propertyEntity, ['for_sale', 'for_rent', 'sold', 'rented', 'off_market'], {
        displayName: 'Listing Status',
        description: 'Current listing status of the property',
    });
    addCurrencyAmountField(propertyEntity, 'list_price', 'List Price', {
        description: 'Listing price of the property',
    });
    addCurrencyAmountField(propertyEntity, 'market_value', 'Market Value', {
        description: 'Estimated market value of the property',
    });
    addCreatedAtField(propertyEntity, { description: 'When the property was created' });
    addUpdatedAtField(propertyEntity, { description: 'When the property was last updated' });
    // Listing Entity
    const listingEntity = propertyModel.addEntity({
        info: {
            name: 'listing',
            displayName: 'Listing',
            description: 'Property listing information',
        },
    });
    addIdField(listingEntity, { displayName: 'Listing ID', description: 'Unique identifier for the listing' });
    addNameField(listingEntity, { displayName: 'Listing Title', description: 'Title of the listing' });
    addDescriptionField(listingEntity, { description: 'Listing description and details' });
    addCurrencyAmountField(listingEntity, 'price', 'Listing Price', {
        description: 'Price for the listing',
    });
    listingEntity.addProperty({
        info: { name: 'list_date', displayName: 'List Date', description: 'Date when property was listed' },
        type: 'date',
        required: true,
    });
    addCustomStatusField(listingEntity, ['active', 'pending', 'sold', 'expired', 'withdrawn'], {
        displayName: 'Listing Status',
        description: 'Current status of the listing',
    });
    addCreatedAtField(listingEntity, { description: 'When the listing was created' });
    // Listing-Property Association (Many-to-One)
    listingEntity.addAssociation({ key: propertyEntity.key }, {
        info: { name: 'property', displayName: 'Property', description: 'Property for this listing' },
        required: true,
        multiple: false,
    });
    // Amenity Entity
    const amenityEntity = propertyModel.addEntity({
        info: {
            name: 'amenity',
            displayName: 'Amenity',
            description: 'Property amenities and features',
        },
    });
    addIdField(amenityEntity, { displayName: 'Amenity ID', description: 'Unique identifier for the amenity' });
    addNameField(amenityEntity, { displayName: 'Amenity Name', description: 'Name of the amenity' });
    addDescriptionField(amenityEntity, { description: 'Amenity description and details' });
    amenityEntity.addProperty({
        info: { name: 'amenity_type', displayName: 'Amenity Type', description: 'Type of amenity' },
        type: 'string',
        required: true,
        schema: {
            enum: ['interior', 'exterior', 'community', 'utilities'],
        },
    });
    addBooleanField(amenityEntity, 'available', 'true', {
        displayName: 'Available',
        description: 'Whether the amenity is available',
    });
    addCreatedAtField(amenityEntity, { description: 'When the amenity was created' });
    // Property-Amenity Association (Many-to-Many)
    propertyEntity.addAssociation({ key: amenityEntity.key }, {
        info: { name: 'amenities', displayName: 'Amenities', description: 'Amenities available at this property' },
        required: false,
        multiple: true,
    });
    // Photo Entity
    const photoEntity = propertyModel.addEntity({
        info: {
            name: 'photo',
            displayName: 'Photo',
            description: 'Property photos and images',
        },
    });
    addIdField(photoEntity, { displayName: 'Photo ID', description: 'Unique identifier for the photo' });
    photoEntity.addProperty({
        info: { name: 'url', displayName: 'Photo URL', description: 'URL to the photo' },
        type: 'string',
        required: true,
    });
    addNameField(photoEntity, { displayName: 'Photo Title', description: 'Title or caption for the photo' });
    addDescriptionField(photoEntity, { description: 'Photo description and details' });
    photoEntity.addProperty({
        info: { name: 'photo_type', displayName: 'Photo Type', description: 'Type of property photo' },
        type: 'string',
        required: true,
        schema: {
            enum: ['exterior', 'interior', 'kitchen', 'bathroom', 'bedroom', 'living_room'],
        },
    });
    addBooleanField(photoEntity, 'featured', 'false', {
        displayName: 'Featured',
        description: 'Whether this is a featured photo',
    });
    addCreatedAtField(photoEntity, { description: 'When the photo was created' });
    // Property-Photo Association (One-to-Many)
    propertyEntity.addAssociation({ key: photoEntity.key }, {
        info: { name: 'photos', displayName: 'Photos', description: 'Photos of this property' },
        required: false,
        multiple: true,
    });
    //
    // 2. CLIENT MANAGEMENT NAMESPACE
    //
    const clientManagement = domain.addNamespace({
        info: {
            name: 'ClientManagement',
            displayName: 'Client Management',
            description: 'Buyers, sellers, agents, and leads',
        },
    });
    // Client Model
    const clientModel = clientManagement.addModel({
        info: {
            name: 'Clients',
            displayName: 'Client Management',
            description: 'Client information and relationships',
        },
    });
    // Client Entity
    const clientEntity = clientModel.addEntity({
        info: {
            name: 'client',
            displayName: 'Client',
            description: 'Real estate client (buyer or seller)',
        },
    });
    addIdField(clientEntity, { displayName: 'Client ID', description: 'Unique identifier for the client' });
    addFirstNameField(clientEntity, { description: 'Client first name' });
    addLastNameField(clientEntity, { description: 'Client last name' });
    addEmailField(clientEntity, { description: 'Client email address' });
    addPhoneField(clientEntity, { description: 'Client phone number' });
    clientEntity.addProperty({
        info: { name: 'client_type', displayName: 'Client Type', description: 'Type of client (buyer, seller, or both)' },
        type: 'string',
        required: true,
        schema: {
            enum: ['buyer', 'seller', 'both'],
        },
    });
    addCustomStatusField(clientEntity, ['active', 'inactive', 'prospect', 'closed'], {
        displayName: 'Client Status',
        description: 'Current status of the client',
    });
    addCurrencyAmountField(clientEntity, 'budget_min', 'Minimum Budget', {
        description: 'Minimum budget for property purchase',
    });
    addCurrencyAmountField(clientEntity, 'budget_max', 'Maximum Budget', {
        description: 'Maximum budget for property purchase',
    });
    addCreatedAtField(clientEntity, { description: 'When the client was created' });
    addUpdatedAtField(clientEntity, { description: 'When the client was last updated' });
    // Agent Entity
    const agentEntity = clientModel.addEntity({
        info: {
            name: 'agent',
            displayName: 'Agent',
            description: 'Real estate agent information',
        },
    });
    addIdField(agentEntity, { displayName: 'Agent ID', description: 'Unique identifier for the agent' });
    addFirstNameField(agentEntity, { description: 'Agent first name' });
    addLastNameField(agentEntity, { description: 'Agent last name' });
    addEmailField(agentEntity, { description: 'Agent email address' });
    addPhoneField(agentEntity, { description: 'Agent phone number' });
    agentEntity.addProperty({
        info: { name: 'license_number', displayName: 'License Number', description: 'Real estate license number' },
        type: 'string',
        required: true,
        unique: true,
    });
    addCustomStatusField(agentEntity, ['active', 'inactive', 'suspended'], {
        displayName: 'Agent Status',
        description: 'Current status of the agent',
    });
    addCreatedAtField(agentEntity, { description: 'When the agent was created' });
    // Client-Agent Association (Many-to-One)
    clientEntity.addAssociation({ key: agentEntity.key }, {
        info: { name: 'agent', displayName: 'Agent', description: 'Agent representing this client' },
        required: true,
        multiple: false,
    });
    // Lead Entity
    const leadEntity = clientModel.addEntity({
        info: {
            name: 'lead',
            displayName: 'Lead',
            description: 'Sales leads and prospects',
        },
    });
    addIdField(leadEntity, { displayName: 'Lead ID', description: 'Unique identifier for the lead' });
    addFirstNameField(leadEntity, { description: 'Lead first name' });
    addLastNameField(leadEntity, { description: 'Lead last name' });
    addEmailField(leadEntity, { description: 'Lead email address' });
    addPhoneField(leadEntity, { description: 'Lead phone number' });
    addCustomStatusField(leadEntity, ['new', 'contacted', 'qualified', 'converted', 'lost'], {
        displayName: 'Lead Status',
        description: 'Current status of the lead',
    });
    leadEntity.addProperty({
        info: { name: 'lead_source', displayName: 'Lead Source', description: 'Source of the lead' },
        type: 'string',
        required: true,
        schema: {
            enum: ['website', 'referral', 'social_media', 'cold_call', 'event'],
        },
    });
    addDescriptionField(leadEntity, { description: 'Lead notes and information' });
    addCreatedAtField(leadEntity, { description: 'When the lead was created' });
    // Lead-Agent Association (Many-to-One)
    leadEntity.addAssociation({ key: agentEntity.key }, {
        info: { name: 'agent', displayName: 'Agent', description: 'Agent assigned to this lead' },
        required: true,
        multiple: false,
    });
    //
    // 3. TRANSACTION MANAGEMENT NAMESPACE
    //
    const transactionManagement = domain.addNamespace({
        info: {
            name: 'TransactionManagement',
            displayName: 'Transaction Management',
            description: 'Offers, contracts, closings, and escrow',
        },
    });
    // Transaction Model
    const transactionModel = transactionManagement.addModel({
        info: {
            name: 'Transactions',
            displayName: 'Transaction Management',
            description: 'Real estate transactions and deals',
        },
    });
    // Offer Entity
    const offerEntity = transactionModel.addEntity({
        info: {
            name: 'offer',
            displayName: 'Offer',
            description: 'Property purchase offers',
        },
    });
    addIdField(offerEntity, { displayName: 'Offer ID', description: 'Unique identifier for the offer' });
    addCurrencyAmountField(offerEntity, 'offer_price', 'Offer Price', {
        description: 'Price offered for the property',
    });
    offerEntity.addProperty({
        info: { name: 'offer_date', displayName: 'Offer Date', description: 'Date when offer was made' },
        type: 'date',
        required: true,
    });
    addCustomStatusField(offerEntity, ['pending', 'accepted', 'rejected', 'countered', 'withdrawn'], {
        displayName: 'Offer Status',
        description: 'Current status of the offer',
    });
    addDescriptionField(offerEntity, { description: 'Offer terms and conditions' });
    addCreatedAtField(offerEntity, { description: 'When the offer was created' });
    // Offer-Property Association (Many-to-One)
    offerEntity.addAssociation({ key: propertyEntity.key }, {
        info: { name: 'property', displayName: 'Property', description: 'Property for this offer' },
        required: true,
        multiple: false,
    });
    // Offer-Client Association (Many-to-One)
    offerEntity.addAssociation({ key: clientEntity.key }, {
        info: { name: 'buyer', displayName: 'Buyer', description: 'Buyer making this offer' },
        required: true,
        multiple: false,
    });
    // Contract Entity
    const contractEntity = transactionModel.addEntity({
        info: {
            name: 'contract',
            displayName: 'Contract',
            description: 'Real estate purchase contracts',
        },
    });
    addIdField(contractEntity, { displayName: 'Contract ID', description: 'Unique identifier for the contract' });
    addCurrencyAmountField(contractEntity, 'purchase_price', 'Purchase Price', {
        description: 'Final purchase price',
    });
    contractEntity.addProperty({
        info: { name: 'contract_date', displayName: 'Contract Date', description: 'Date when contract was signed' },
        type: 'date',
        required: true,
    });
    contractEntity.addProperty({
        info: { name: 'closing_date', displayName: 'Closing Date', description: 'Scheduled closing date' },
        type: 'date',
        required: true,
    });
    addCustomStatusField(contractEntity, ['draft', 'signed', 'pending', 'closed', 'cancelled'], {
        displayName: 'Contract Status',
        description: 'Current status of the contract',
    });
    addCreatedAtField(contractEntity, { description: 'When the contract was created' });
    // Contract-Property Association (Many-to-One)
    contractEntity.addAssociation({ key: propertyEntity.key }, {
        info: { name: 'property', displayName: 'Property', description: 'Property in this contract' },
        required: true,
        multiple: false,
    });
    // Contract-Buyer Association (Many-to-One)
    contractEntity.addAssociation({ key: clientEntity.key }, {
        info: { name: 'buyer', displayName: 'Buyer', description: 'Buyer in this contract' },
        required: true,
        multiple: false,
    });
    // Contract-Seller Association (Many-to-One)
    contractEntity.addAssociation({ key: clientEntity.key }, {
        info: { name: 'seller', displayName: 'Seller', description: 'Seller in this contract' },
        required: true,
        multiple: false,
    });
    // Escrow Entity
    const escrowEntity = transactionModel.addEntity({
        info: {
            name: 'escrow',
            displayName: 'Escrow',
            description: 'Escrow account and transaction details',
        },
    });
    addIdField(escrowEntity, { displayName: 'Escrow ID', description: 'Unique identifier for the escrow' });
    addCurrencyAmountField(escrowEntity, 'escrow_amount', 'Escrow Amount', {
        description: 'Amount held in escrow',
    });
    escrowEntity.addProperty({
        info: { name: 'escrow_date', displayName: 'Escrow Date', description: 'Date when escrow was opened' },
        type: 'date',
        required: true,
    });
    addCustomStatusField(escrowEntity, ['open', 'funded', 'closed', 'cancelled'], {
        displayName: 'Escrow Status',
        description: 'Current status of the escrow',
    });
    addCreatedAtField(escrowEntity, { description: 'When the escrow was created' });
    // Escrow-Contract Association (Many-to-One)
    escrowEntity.addAssociation({ key: contractEntity.key }, {
        info: { name: 'contract', displayName: 'Contract', description: 'Contract for this escrow' },
        required: true,
        multiple: false,
    });
    //
    // 4. MARKET ANALYSIS NAMESPACE
    //
    const marketAnalysis = domain.addNamespace({
        info: {
            name: 'MarketAnalysis',
            displayName: 'Market Analysis',
            description: 'Comps, market data, and pricing models',
        },
    });
    // Market Model
    const marketModel = marketAnalysis.addModel({
        info: {
            name: 'Market',
            displayName: 'Market Analysis',
            description: 'Market data and analysis',
        },
    });
    // Market Data Entity
    const marketDataEntity = marketModel.addEntity({
        info: {
            name: 'market_data',
            displayName: 'Market Data',
            description: 'Real estate market data and trends',
        },
    });
    addIdField(marketDataEntity, { displayName: 'Market Data ID', description: 'Unique identifier for the market data' });
    marketDataEntity.addProperty({
        info: { name: 'area', displayName: 'Area', description: 'Geographic area for market data' },
        type: 'string',
        required: true,
    });
    marketDataEntity.addProperty({
        info: { name: 'data_date', displayName: 'Data Date', description: 'Date of market data' },
        type: 'date',
        required: true,
    });
    addCurrencyAmountField(marketDataEntity, 'avg_price', 'Average Price', {
        description: 'Average property price in the area',
    });
    marketDataEntity.addProperty({
        info: { name: 'days_on_market', displayName: 'Days on Market', description: 'Average days on market' },
        type: 'number',
        required: true,
        schema: {
            minimum: 0,
        },
    });
    marketDataEntity.addProperty({
        info: { name: 'inventory_count', displayName: 'Inventory Count', description: 'Number of properties for sale' },
        type: 'number',
        required: true,
        schema: {
            minimum: 0,
        },
    });
    addCreatedAtField(marketDataEntity, { description: 'When the market data was created' });
    // Comparable Entity
    const comparableEntity = marketModel.addEntity({
        info: {
            name: 'comparable',
            displayName: 'Comparable',
            description: 'Comparable property sales data',
        },
    });
    addIdField(comparableEntity, { displayName: 'Comparable ID', description: 'Unique identifier for the comparable' });
    addNameField(comparableEntity, {
        displayName: 'Comparable Name',
        description: 'Name or address of comparable property',
    });
    addCurrencyAmountField(comparableEntity, 'sale_price', 'Sale Price', {
        description: 'Sale price of the comparable property',
    });
    comparableEntity.addProperty({
        info: { name: 'sale_date', displayName: 'Sale Date', description: 'Date when comparable property sold' },
        type: 'date',
        required: true,
    });
    comparableEntity.addProperty({
        info: { name: 'square_feet', displayName: 'Square Feet', description: 'Square footage of comparable property' },
        type: 'number',
        required: true,
        schema: {
            minimum: 0,
        },
    });
    addCreatedAtField(comparableEntity, { description: 'When the comparable was created' });
    // Comparable-Property Association (Many-to-One)
    comparableEntity.addAssociation({ key: propertyEntity.key }, {
        info: { name: 'property', displayName: 'Property', description: 'Property for this comparable' },
        required: true,
        multiple: false,
    });
    //
    // 5. DOCUMENT MANAGEMENT NAMESPACE
    //
    const documentManagement = domain.addNamespace({
        info: {
            name: 'DocumentManagement',
            displayName: 'Document Management',
            description: 'Contracts, disclosures, and legal documents',
        },
    });
    // Document Model
    const documentModel = documentManagement.addModel({
        info: {
            name: 'Documents',
            displayName: 'Document Management',
            description: 'Document storage and management',
        },
    });
    // Document Entity
    const documentEntity = documentModel.addEntity({
        info: {
            name: 'document',
            displayName: 'Document',
            description: 'Legal documents and contracts',
        },
    });
    addIdField(documentEntity, { displayName: 'Document ID', description: 'Unique identifier for the document' });
    addNameField(documentEntity, { displayName: 'Document Name', description: 'Name of the document' });
    addDescriptionField(documentEntity, { description: 'Document description and details' });
    documentEntity.addProperty({
        info: { name: 'file_url', displayName: 'File URL', description: 'URL to the document file' },
        type: 'string',
        required: true,
    });
    documentEntity.addProperty({
        info: { name: 'document_type', displayName: 'Document Type', description: 'Type of document' },
        type: 'string',
        required: true,
        schema: {
            enum: ['contract', 'disclosure', 'inspection', 'appraisal', 'title', 'other'],
        },
    });
    addCustomStatusField(documentEntity, ['draft', 'pending', 'signed', 'archived'], {
        displayName: 'Document Status',
        description: 'Current status of the document',
    });
    addCreatedAtField(documentEntity, { description: 'When the document was created' });
    // Document-Contract Association (Many-to-One)
    documentEntity.addAssociation({ key: contractEntity.key }, {
        info: { name: 'contract', displayName: 'Contract', description: 'Contract for this document' },
        required: false,
        multiple: false,
    });
    // Document-Property Association (Many-to-One)
    documentEntity.addAssociation({ key: propertyEntity.key }, {
        info: { name: 'property', displayName: 'Property', description: 'Property for this document' },
        required: false,
        multiple: false,
    });
    //
    // 6. MARKETING NAMESPACE
    //
    const marketing = domain.addNamespace({
        info: {
            name: 'Marketing',
            displayName: 'Marketing',
            description: 'Lead generation, campaigns, and follow-ups',
        },
    });
    // Marketing Model
    const marketingModel = marketing.addModel({
        info: {
            name: 'Marketing',
            displayName: 'Marketing Management',
            description: 'Marketing campaigns and activities',
        },
    });
    // Campaign Entity
    const campaignEntity = marketingModel.addEntity({
        info: {
            name: 'campaign',
            displayName: 'Campaign',
            description: 'Marketing campaigns and promotions',
        },
    });
    addIdField(campaignEntity, { displayName: 'Campaign ID', description: 'Unique identifier for the campaign' });
    addNameField(campaignEntity, { displayName: 'Campaign Name', description: 'Name of the marketing campaign' });
    addDescriptionField(campaignEntity, { description: 'Campaign description and objectives' });
    campaignEntity.addProperty({
        info: { name: 'start_date', displayName: 'Start Date', description: 'Campaign start date' },
        type: 'date',
        required: true,
    });
    campaignEntity.addProperty({
        info: { name: 'end_date', displayName: 'End Date', description: 'Campaign end date' },
        type: 'date',
        required: true,
    });
    addCustomStatusField(campaignEntity, ['draft', 'active', 'paused', 'completed', 'cancelled'], {
        displayName: 'Campaign Status',
        description: 'Current status of the campaign',
    });
    campaignEntity.addProperty({
        info: { name: 'campaign_type', displayName: 'Campaign Type', description: 'Type of marketing campaign' },
        type: 'string',
        required: true,
        schema: {
            enum: ['email', 'social_media', 'print', 'digital', 'event'],
        },
    });
    addCreatedAtField(campaignEntity, { description: 'When the campaign was created' });
    // Follow-up Entity
    const followUpEntity = marketingModel.addEntity({
        info: {
            name: 'follow_up',
            displayName: 'Follow-up',
            description: 'Client follow-up activities',
        },
    });
    addIdField(followUpEntity, { displayName: 'Follow-up ID', description: 'Unique identifier for the follow-up' });
    addNameField(followUpEntity, { displayName: 'Follow-up Title', description: 'Title of the follow-up activity' });
    addDescriptionField(followUpEntity, { description: 'Follow-up notes and details' });
    followUpEntity.addProperty({
        info: { name: 'scheduled_date', displayName: 'Scheduled Date', description: 'Scheduled follow-up date' },
        type: 'date',
        required: true,
    });
    addCustomStatusField(followUpEntity, ['scheduled', 'completed', 'cancelled', 'overdue'], {
        displayName: 'Follow-up Status',
        description: 'Current status of the follow-up',
    });
    followUpEntity.addProperty({
        info: { name: 'follow_up_type', displayName: 'Follow-up Type', description: 'Type of follow-up activity' },
        type: 'string',
        required: true,
        schema: {
            enum: ['phone_call', 'email', 'meeting', 'text', 'other'],
        },
    });
    addCreatedAtField(followUpEntity, { description: 'When the follow-up was created' });
    // Follow-up-Client Association (Many-to-One)
    followUpEntity.addAssociation({ key: clientEntity.key }, {
        info: { name: 'client', displayName: 'Client', description: 'Client for this follow-up' },
        required: true,
        multiple: false,
    });
    // Follow-up-Agent Association (Many-to-One)
    followUpEntity.addAssociation({ key: agentEntity.key }, {
        info: { name: 'agent', displayName: 'Agent', description: 'Agent responsible for this follow-up' },
        required: true,
        multiple: false,
    });
    return domain;
}
//# sourceMappingURL=real-estate-domain.js.map