/**
 * Hospitality Domain Template
 *
 * A comprehensive hospitality data domain following domain-driven design principles.
 * This template covers the complete hospitality lifecycle including:
 *
 * - Guest Management: Guest profiles, preferences, loyalty programs
 * - Reservation System: Bookings, availability, pricing
 * - Property Management: Rooms, amenities, housekeeping
 * - Service Management: Concierge, room service, activities
 * - Revenue Management: Pricing, promotions, revenue optimization
 * - Operations: Staff scheduling, maintenance, security
 *
 * Key Features:
 * - Complete guest lifecycle management
 * - Reservation and booking system
 * - Room and property management
 * - Service delivery tracking
 * - Revenue optimization and pricing
 * - Operational management
 * - Loyalty program management
 *
 * Use Cases:
 * - Hotels and resorts
 * - Hospitality management
 * - Guest services
 * - Revenue management
 * - Property operations
 */
import { DataDomain } from '../../../DataDomain.js';
import { addIdField, addNameField, addDescriptionField, addEmailField, addPhoneField, addCustomStatusField, addCreatedAtField, addUpdatedAtField, addCurrencyAmountField, } from '../../../helpers/Intelisense.js';
function createDomain() {
    return new DataDomain({
        info: {
            name: 'Hospitality Platform',
            displayName: 'Hospitality Platform',
            description: 'A comprehensive hospitality platform with guest management, reservations, ' +
                'property management, services, revenue optimization, and operations',
        },
    });
}
/**
 * Creates a comprehensive hospitality data domain following domain-driven design principles.
 *
 * This function demonstrates the proper hierarchy and organization for a hospitality platform:
 * 1. Creates the root DataDomain for the hospitality platform
 * 2. Organizes functionality into logical namespaces (Guest Management, Reservation System, etc.)
 * 3. Groups related entities into models within each namespace
 * 4. Defines entities with proper semantic annotations for hospitality workflows
 * 5. Establishes associations with appropriate cardinality for hospitality relationships
 *
 * @returns A fully configured DataDomain with all hospitality entities and relationships
 */
export default function createHospitalityDomain(options = {}) {
    // Ensure the root data domain
    const domain = options.domain ?? createDomain();
    //
    // 1. GUEST MANAGEMENT NAMESPACE
    //
    const guestManagement = domain.addNamespace({
        info: {
            name: 'GuestManagement',
            displayName: 'Guest Management',
            description: 'Guest profiles, preferences, and loyalty programs',
        },
    });
    // Guest Model
    const guestModel = guestManagement.addModel({
        info: {
            name: 'Guests',
            displayName: 'Guest Management',
            description: 'Guest profiles and information',
        },
    });
    // Guest Entity
    const guestEntity = guestModel.addEntity({
        info: {
            name: 'guest',
            displayName: 'Guest',
            description: 'Hotel guest with profile and preferences',
        },
    });
    addIdField(guestEntity, { displayName: 'Guest ID', description: 'Unique identifier for the guest' });
    addNameField(guestEntity, { description: 'Guest name and title' });
    addDescriptionField(guestEntity, { description: 'Guest description and notes' });
    addEmailField(guestEntity, { description: 'Guest email address' });
    addPhoneField(guestEntity, { description: 'Guest phone number' });
    guestEntity.addProperty({
        info: { name: 'date_of_birth', displayName: 'Date of Birth', description: 'Guest date of birth' },
        type: 'date',
        required: false,
    });
    guestEntity.addProperty({
        info: { name: 'nationality', displayName: 'Nationality', description: 'Guest nationality' },
        type: 'string',
        required: false,
    });
    guestEntity.addProperty({
        info: { name: 'address', displayName: 'Address', description: 'Guest address' },
        type: 'string',
        required: false,
    });
    guestEntity.addProperty({
        info: { name: 'guest_type', displayName: 'Guest Type', description: 'Type of guest' },
        type: 'string',
        required: true,
        schema: {
            enum: ['individual', 'business', 'group', 'vip'],
        },
    });
    addCustomStatusField(guestEntity, ['active', 'inactive', 'blacklisted'], {
        displayName: 'Guest Status',
        description: 'Current status of the guest',
    });
    addCreatedAtField(guestEntity, { description: 'When the guest record was created' });
    addUpdatedAtField(guestEntity, { description: 'When the guest record was last updated' });
    // Guest Preference Entity
    const guestPreferenceEntity = guestModel.addEntity({
        info: {
            name: 'guest_preference',
            displayName: 'Guest Preference',
            description: 'Guest preferences and special requirements',
        },
    });
    addIdField(guestPreferenceEntity, {
        displayName: 'Preference ID',
        description: 'Unique identifier for the guest preference',
    });
    addNameField(guestPreferenceEntity, { description: 'Preference name and description' });
    guestPreferenceEntity.addProperty({
        info: { name: 'preference_type', displayName: 'Preference Type', description: 'Type of preference' },
        type: 'string',
        required: true,
        schema: {
            enum: ['room', 'amenity', 'service', 'dietary', 'accessibility'],
        },
    });
    guestPreferenceEntity.addProperty({
        info: { name: 'value', displayName: 'Value', description: 'Preference value or setting' },
        type: 'string',
        required: true,
    });
    addCustomStatusField(guestPreferenceEntity, ['active', 'inactive'], {
        displayName: 'Preference Status',
        description: 'Current status of the preference',
    });
    addCreatedAtField(guestPreferenceEntity, { description: 'When the preference was created' });
    // GuestPreference-Guest Association (Many-to-One)
    guestPreferenceEntity.addAssociation({ key: guestEntity.key }, {
        info: { name: 'guest', displayName: 'Guest', description: 'Guest for this preference' },
        required: true,
        multiple: false,
    });
    // Loyalty Program Entity
    const loyaltyProgramEntity = guestModel.addEntity({
        info: {
            name: 'loyalty_program',
            displayName: 'Loyalty Program',
            description: 'Guest loyalty program and membership',
        },
    });
    addIdField(loyaltyProgramEntity, {
        displayName: 'Loyalty ID',
        description: 'Unique identifier for the loyalty program',
    });
    addNameField(loyaltyProgramEntity, { description: 'Loyalty program name' });
    loyaltyProgramEntity.addProperty({
        info: { name: 'membership_number', displayName: 'Membership Number', description: 'Loyalty membership number' },
        type: 'string',
        required: true,
        unique: true,
    });
    loyaltyProgramEntity.addProperty({
        info: { name: 'tier_level', displayName: 'Tier Level', description: 'Loyalty tier level' },
        type: 'string',
        required: true,
        schema: {
            enum: ['bronze', 'silver', 'gold', 'platinum', 'diamond'],
        },
    });
    loyaltyProgramEntity.addProperty({
        info: { name: 'points_balance', displayName: 'Points Balance', description: 'Current points balance' },
        type: 'number',
        required: true,
        schema: {
            minimum: 0,
        },
    });
    addCustomStatusField(loyaltyProgramEntity, ['active', 'inactive', 'suspended'], {
        displayName: 'Loyalty Status',
        description: 'Current status of the loyalty membership',
    });
    addCreatedAtField(loyaltyProgramEntity, { description: 'When the loyalty membership was created' });
    // LoyaltyProgram-Guest Association (One-to-One)
    loyaltyProgramEntity.addAssociation({ key: guestEntity.key }, {
        info: { name: 'guest', displayName: 'Guest', description: 'Guest for this loyalty program' },
        required: true,
        multiple: false,
    });
    //
    // 2. RESERVATION SYSTEM NAMESPACE
    //
    const reservationSystem = domain.addNamespace({
        info: {
            name: 'ReservationSystem',
            displayName: 'Reservation System',
            description: 'Bookings, availability, and pricing management',
        },
    });
    // Reservation Model
    const reservationModel = reservationSystem.addModel({
        info: {
            name: 'Reservations',
            displayName: 'Reservation Management',
            description: 'Reservation and booking management',
        },
    });
    // Reservation Entity
    const reservationEntity = reservationModel.addEntity({
        info: {
            name: 'reservation',
            displayName: 'Reservation',
            description: 'Guest reservation and booking',
        },
    });
    addIdField(reservationEntity, { displayName: 'Reservation ID', description: 'Unique identifier for the reservation' });
    addNameField(reservationEntity, { description: 'Reservation name and description' });
    reservationEntity.addProperty({
        info: { name: 'check_in_date', displayName: 'Check-in Date', description: 'Guest check-in date' },
        type: 'date',
        required: true,
    });
    reservationEntity.addProperty({
        info: { name: 'check_out_date', displayName: 'Check-out Date', description: 'Guest check-out date' },
        type: 'date',
        required: true,
    });
    reservationEntity.addProperty({
        info: { name: 'adults', displayName: 'Adults', description: 'Number of adult guests' },
        type: 'number',
        required: true,
        schema: {
            minimum: 1,
        },
    });
    reservationEntity.addProperty({
        info: { name: 'children', displayName: 'Children', description: 'Number of children' },
        type: 'number',
        required: true,
        schema: {
            minimum: 0,
        },
    });
    reservationEntity.addProperty({
        info: { name: 'reservation_type', displayName: 'Reservation Type', description: 'Type of reservation' },
        type: 'string',
        required: true,
        schema: {
            enum: ['direct', 'ota', 'corporate', 'group', 'package'],
        },
    });
    addCurrencyAmountField(reservationEntity, 'total_amount', 'Total Amount', {
        description: 'Total reservation amount',
    });
    addCustomStatusField(reservationEntity, ['confirmed', 'pending', 'cancelled', 'checked_in', 'checked_out'], {
        displayName: 'Reservation Status',
        description: 'Current status of the reservation',
    });
    addCreatedAtField(reservationEntity, { description: 'When the reservation was created' });
    // Reservation-Guest Association (Many-to-One)
    reservationEntity.addAssociation({ key: guestEntity.key }, {
        info: { name: 'guest', displayName: 'Guest', description: 'Guest for this reservation' },
        required: true,
        multiple: false,
    });
    // Room Rate Entity
    const roomRateEntity = reservationModel.addEntity({
        info: {
            name: 'room_rate',
            displayName: 'Room Rate',
            description: 'Room pricing and rate management',
        },
    });
    addIdField(roomRateEntity, { displayName: 'Rate ID', description: 'Unique identifier for the room rate' });
    addNameField(roomRateEntity, { description: 'Rate name and description' });
    roomRateEntity.addProperty({
        info: { name: 'rate_type', displayName: 'Rate Type', description: 'Type of room rate' },
        type: 'string',
        required: true,
        schema: {
            enum: ['rack', 'corporate', 'package', 'promotional', 'seasonal'],
        },
    });
    roomRateEntity.addProperty({
        info: { name: 'start_date', displayName: 'Start Date', description: 'Rate start date' },
        type: 'date',
        required: true,
    });
    roomRateEntity.addProperty({
        info: { name: 'end_date', displayName: 'End Date', description: 'Rate end date' },
        type: 'date',
        required: true,
    });
    addCurrencyAmountField(roomRateEntity, 'base_rate', 'Base Rate', {
        description: 'Base room rate',
    });
    addCustomStatusField(roomRateEntity, ['active', 'inactive', 'expired'], {
        displayName: 'Rate Status',
        description: 'Current status of the room rate',
    });
    addCreatedAtField(roomRateEntity, { description: 'When the room rate was created' });
    //
    // 3. PROPERTY MANAGEMENT NAMESPACE
    //
    const propertyManagement = domain.addNamespace({
        info: {
            name: 'PropertyManagement',
            displayName: 'Property Management',
            description: 'Rooms, amenities, and housekeeping management',
        },
    });
    // Property Model
    const propertyModel = propertyManagement.addModel({
        info: {
            name: 'Property',
            displayName: 'Property Management',
            description: 'Property and room management',
        },
    });
    // Room Entity
    const roomEntity = propertyModel.addEntity({
        info: {
            name: 'room',
            displayName: 'Room',
            description: 'Hotel room with amenities and status',
        },
    });
    addIdField(roomEntity, { displayName: 'Room ID', description: 'Unique identifier for the room' });
    addNameField(roomEntity, { description: 'Room name and number' });
    addDescriptionField(roomEntity, { description: 'Room description and features' });
    roomEntity.addProperty({
        info: { name: 'room_type', displayName: 'Room Type', description: 'Type of room' },
        type: 'string',
        required: true,
        schema: {
            enum: ['standard', 'deluxe', 'suite', 'presidential', 'accessible'],
        },
    });
    roomEntity.addProperty({
        info: { name: 'floor', displayName: 'Floor', description: 'Room floor number' },
        type: 'number',
        required: true,
        schema: {
            minimum: 1,
        },
    });
    roomEntity.addProperty({
        info: { name: 'capacity', displayName: 'Capacity', description: 'Room guest capacity' },
        type: 'number',
        required: true,
        schema: {
            minimum: 1,
        },
    });
    addCustomStatusField(roomEntity, ['available', 'occupied', 'maintenance', 'out_of_order'], {
        displayName: 'Room Status',
        description: 'Current status of the room',
    });
    addCreatedAtField(roomEntity, { description: 'When the room was created' });
    addUpdatedAtField(roomEntity, { description: 'When the room was last updated' });
    // Amenity Entity
    const amenityEntity = propertyModel.addEntity({
        info: {
            name: 'amenity',
            displayName: 'Amenity',
            description: 'Hotel amenities and services',
        },
    });
    addIdField(amenityEntity, { displayName: 'Amenity ID', description: 'Unique identifier for the amenity' });
    addNameField(amenityEntity, { description: 'Amenity name and description' });
    addDescriptionField(amenityEntity, { description: 'Amenity description and features' });
    amenityEntity.addProperty({
        info: { name: 'amenity_type', displayName: 'Amenity Type', description: 'Type of amenity' },
        type: 'string',
        required: true,
        schema: {
            enum: ['room', 'hotel', 'recreation', 'business', 'wellness'],
        },
    });
    amenityEntity.addProperty({
        info: { name: 'location', displayName: 'Location', description: 'Amenity location' },
        type: 'string',
        required: true,
    });
    addCustomStatusField(amenityEntity, ['available', 'maintenance', 'closed'], {
        displayName: 'Amenity Status',
        description: 'Current status of the amenity',
    });
    addCreatedAtField(amenityEntity, { description: 'When the amenity was created' });
    // Housekeeping Task Entity
    const housekeepingTaskEntity = propertyModel.addEntity({
        info: {
            name: 'housekeeping_task',
            displayName: 'Housekeeping Task',
            description: 'Housekeeping tasks and room cleaning',
        },
    });
    addIdField(housekeepingTaskEntity, {
        displayName: 'Task ID',
        description: 'Unique identifier for the housekeeping task',
    });
    addNameField(housekeepingTaskEntity, { description: 'Task name and description' });
    housekeepingTaskEntity.addProperty({
        info: { name: 'task_type', displayName: 'Task Type', description: 'Type of housekeeping task' },
        type: 'string',
        required: true,
        schema: {
            enum: ['daily_cleaning', 'turnover', 'deep_cleaning', 'maintenance', 'inspection'],
        },
    });
    housekeepingTaskEntity.addProperty({
        info: { name: 'assigned_to', displayName: 'Assigned To', description: 'Staff member assigned to task' },
        type: 'string',
        required: true,
    });
    housekeepingTaskEntity.addProperty({
        info: { name: 'scheduled_time', displayName: 'Scheduled Time', description: 'Scheduled task time' },
        type: 'datetime',
        required: true,
    });
    addCustomStatusField(housekeepingTaskEntity, ['pending', 'in_progress', 'completed', 'cancelled'], {
        displayName: 'Task Status',
        description: 'Current status of the housekeeping task',
    });
    addCreatedAtField(housekeepingTaskEntity, { description: 'When the task was created' });
    // HousekeepingTask-Room Association (Many-to-One)
    housekeepingTaskEntity.addAssociation({ key: roomEntity.key }, {
        info: { name: 'room', displayName: 'Room', description: 'Room for this housekeeping task' },
        required: true,
        multiple: false,
    });
    // Reservation-Room Association (Many-to-One)
    reservationEntity.addAssociation({ key: roomEntity.key }, {
        info: { name: 'room', displayName: 'Room', description: 'Room for this reservation' },
        required: true,
        multiple: false,
    });
    //
    // 4. SERVICE MANAGEMENT NAMESPACE
    //
    const serviceManagement = domain.addNamespace({
        info: {
            name: 'ServiceManagement',
            displayName: 'Service Management',
            description: 'Concierge, room service, and activities management',
        },
    });
    // Service Model
    const serviceModel = serviceManagement.addModel({
        info: {
            name: 'Services',
            displayName: 'Service Management',
            description: 'Guest services and activities',
        },
    });
    // Service Request Entity
    const serviceRequestEntity = serviceModel.addEntity({
        info: {
            name: 'service_request',
            displayName: 'Service Request',
            description: 'Guest service requests and orders',
        },
    });
    addIdField(serviceRequestEntity, {
        displayName: 'Request ID',
        description: 'Unique identifier for the service request',
    });
    addNameField(serviceRequestEntity, { description: 'Service request description' });
    serviceRequestEntity.addProperty({
        info: { name: 'service_type', displayName: 'Service Type', description: 'Type of service requested' },
        type: 'string',
        required: true,
        schema: {
            enum: ['concierge', 'room_service', 'housekeeping', 'maintenance', 'transportation'],
        },
    });
    serviceRequestEntity.addProperty({
        info: { name: 'priority', displayName: 'Priority', description: 'Request priority level' },
        type: 'string',
        required: true,
        schema: {
            enum: ['low', 'medium', 'high', 'urgent'],
        },
    });
    serviceRequestEntity.addProperty({
        info: { name: 'requested_time', displayName: 'Requested Time', description: 'Time service was requested' },
        type: 'datetime',
        required: true,
    });
    addCustomStatusField(serviceRequestEntity, ['pending', 'in_progress', 'completed', 'cancelled'], {
        displayName: 'Request Status',
        description: 'Current status of the service request',
    });
    addCreatedAtField(serviceRequestEntity, { description: 'When the service request was created' });
    // ServiceRequest-Guest Association (Many-to-One)
    serviceRequestEntity.addAssociation({ key: guestEntity.key }, {
        info: { name: 'guest', displayName: 'Guest', description: 'Guest for this service request' },
        required: true,
        multiple: false,
    });
    // ServiceRequest-Room Association (Many-to-One)
    serviceRequestEntity.addAssociation({ key: roomEntity.key }, {
        info: { name: 'room', displayName: 'Room', description: 'Room for this service request' },
        required: true,
        multiple: false,
    });
    // Activity Entity
    const activityEntity = serviceModel.addEntity({
        info: {
            name: 'activity',
            displayName: 'Activity',
            description: 'Hotel activities and events',
        },
    });
    addIdField(activityEntity, { displayName: 'Activity ID', description: 'Unique identifier for the activity' });
    addNameField(activityEntity, { description: 'Activity name and description' });
    addDescriptionField(activityEntity, { description: 'Activity description and details' });
    activityEntity.addProperty({
        info: { name: 'activity_type', displayName: 'Activity Type', description: 'Type of activity' },
        type: 'string',
        required: true,
        schema: {
            enum: ['recreation', 'entertainment', 'wellness', 'business', 'cultural'],
        },
    });
    activityEntity.addProperty({
        info: { name: 'start_time', displayName: 'Start Time', description: 'Activity start time' },
        type: 'datetime',
        required: true,
    });
    activityEntity.addProperty({
        info: { name: 'end_time', displayName: 'End Time', description: 'Activity end time' },
        type: 'datetime',
        required: true,
    });
    activityEntity.addProperty({
        info: { name: 'capacity', displayName: 'Capacity', description: 'Activity capacity' },
        type: 'number',
        required: true,
        schema: {
            minimum: 1,
        },
    });
    addCustomStatusField(activityEntity, ['scheduled', 'in_progress', 'completed', 'cancelled'], {
        displayName: 'Activity Status',
        description: 'Current status of the activity',
    });
    addCreatedAtField(activityEntity, { description: 'When the activity was created' });
    //
    // 5. REVENUE MANAGEMENT NAMESPACE
    //
    const revenueManagement = domain.addNamespace({
        info: {
            name: 'RevenueManagement',
            displayName: 'Revenue Management',
            description: 'Pricing, promotions, and revenue optimization',
        },
    });
    // Revenue Model
    const revenueModel = revenueManagement.addModel({
        info: {
            name: 'Revenue',
            displayName: 'Revenue Management',
            description: 'Revenue optimization and pricing',
        },
    });
    // Promotion Entity
    const promotionEntity = revenueModel.addEntity({
        info: {
            name: 'promotion',
            displayName: 'Promotion',
            description: 'Hotel promotions and special offers',
        },
    });
    addIdField(promotionEntity, { displayName: 'Promotion ID', description: 'Unique identifier for the promotion' });
    addNameField(promotionEntity, { description: 'Promotion name and description' });
    addDescriptionField(promotionEntity, { description: 'Promotion details and terms' });
    promotionEntity.addProperty({
        info: { name: 'promotion_type', displayName: 'Promotion Type', description: 'Type of promotion' },
        type: 'string',
        required: true,
        schema: {
            enum: ['discount', 'package', 'loyalty', 'seasonal', 'corporate'],
        },
    });
    promotionEntity.addProperty({
        info: { name: 'start_date', displayName: 'Start Date', description: 'Promotion start date' },
        type: 'date',
        required: true,
    });
    promotionEntity.addProperty({
        info: { name: 'end_date', displayName: 'End Date', description: 'Promotion end date' },
        type: 'date',
        required: true,
    });
    promotionEntity.addProperty({
        info: { name: 'discount_percentage', displayName: 'Discount Percentage', description: 'Discount percentage' },
        type: 'number',
        required: false,
        schema: {
            minimum: 0,
            maximum: 100,
        },
    });
    addCustomStatusField(promotionEntity, ['active', 'inactive', 'expired'], {
        displayName: 'Promotion Status',
        description: 'Current status of the promotion',
    });
    addCreatedAtField(promotionEntity, { description: 'When the promotion was created' });
    // Revenue Report Entity
    const revenueReportEntity = revenueModel.addEntity({
        info: {
            name: 'revenue_report',
            displayName: 'Revenue Report',
            description: 'Revenue reports and analytics',
        },
    });
    addIdField(revenueReportEntity, {
        displayName: 'Report ID',
        description: 'Unique identifier for the revenue report',
    });
    addNameField(revenueReportEntity, { description: 'Report name and description' });
    revenueReportEntity.addProperty({
        info: { name: 'report_type', displayName: 'Report Type', description: 'Type of revenue report' },
        type: 'string',
        required: true,
        schema: {
            enum: ['daily', 'weekly', 'monthly', 'quarterly', 'annual'],
        },
    });
    revenueReportEntity.addProperty({
        info: { name: 'report_date', displayName: 'Report Date', description: 'Report date' },
        type: 'date',
        required: true,
    });
    addCurrencyAmountField(revenueReportEntity, 'total_revenue', 'Total Revenue', {
        description: 'Total revenue for the period',
    });
    addCurrencyAmountField(revenueReportEntity, 'average_daily_rate', 'Average Daily Rate', {
        description: 'Average daily room rate',
    });
    addCurrencyAmountField(revenueReportEntity, 'occupancy_rate', 'Occupancy Rate', {
        description: 'Room occupancy rate percentage',
    });
    addCustomStatusField(revenueReportEntity, ['draft', 'final', 'archived'], {
        displayName: 'Report Status',
        description: 'Current status of the revenue report',
    });
    addCreatedAtField(revenueReportEntity, { description: 'When the revenue report was created' });
    //
    // 6. OPERATIONS NAMESPACE
    //
    const operations = domain.addNamespace({
        info: {
            name: 'Operations',
            displayName: 'Operations',
            description: 'Staff scheduling, maintenance, and security',
        },
    });
    // Operations Model
    const operationsModel = operations.addModel({
        info: {
            name: 'Operations',
            displayName: 'Operations Management',
            description: 'Hotel operations and staff management',
        },
    });
    // Staff Entity
    const staffEntity = operationsModel.addEntity({
        info: {
            name: 'staff',
            displayName: 'Staff',
            description: 'Hotel staff and employees',
        },
    });
    addIdField(staffEntity, { displayName: 'Staff ID', description: 'Unique identifier for the staff member' });
    addNameField(staffEntity, { description: 'Staff name and title' });
    addEmailField(staffEntity, { description: 'Staff email address' });
    addPhoneField(staffEntity, { description: 'Staff phone number' });
    staffEntity.addProperty({
        info: { name: 'department', displayName: 'Department', description: 'Staff department' },
        type: 'string',
        required: true,
        schema: {
            enum: ['front_office', 'housekeeping', 'food_beverage', 'maintenance', 'security', 'management'],
        },
    });
    staffEntity.addProperty({
        info: { name: 'position', displayName: 'Position', description: 'Staff position' },
        type: 'string',
        required: true,
    });
    staffEntity.addProperty({
        info: { name: 'hire_date', displayName: 'Hire Date', description: 'Staff hire date' },
        type: 'date',
        required: true,
    });
    addCustomStatusField(staffEntity, ['active', 'inactive', 'on_leave', 'terminated'], {
        displayName: 'Staff Status',
        description: 'Current status of the staff member',
    });
    addCreatedAtField(staffEntity, { description: 'When the staff record was created' });
    addUpdatedAtField(staffEntity, { description: 'When the staff record was last updated' });
    // Staff Schedule Entity
    const staffScheduleEntity = operationsModel.addEntity({
        info: {
            name: 'staff_schedule',
            displayName: 'Staff Schedule',
            description: 'Staff scheduling and shift management',
        },
    });
    addIdField(staffScheduleEntity, {
        displayName: 'Schedule ID',
        description: 'Unique identifier for the staff schedule',
    });
    staffScheduleEntity.addProperty({
        info: { name: 'shift_type', displayName: 'Shift Type', description: 'Type of work shift' },
        type: 'string',
        required: true,
        schema: {
            enum: ['morning', 'afternoon', 'night', 'split', 'overtime'],
        },
    });
    staffScheduleEntity.addProperty({
        info: { name: 'start_time', displayName: 'Start Time', description: 'Shift start time' },
        type: 'datetime',
        required: true,
    });
    staffScheduleEntity.addProperty({
        info: { name: 'end_time', displayName: 'End Time', description: 'Shift end time' },
        type: 'datetime',
        required: true,
    });
    addCustomStatusField(staffScheduleEntity, ['scheduled', 'in_progress', 'completed', 'cancelled'], {
        displayName: 'Schedule Status',
        description: 'Current status of the staff schedule',
    });
    addCreatedAtField(staffScheduleEntity, { description: 'When the schedule was created' });
    // StaffSchedule-Staff Association (Many-to-One)
    staffScheduleEntity.addAssociation({ key: staffEntity.key }, {
        info: { name: 'staff', displayName: 'Staff', description: 'Staff member for this schedule' },
        required: true,
        multiple: false,
    });
    // Maintenance Request Entity
    const maintenanceRequestEntity = operationsModel.addEntity({
        info: {
            name: 'maintenance_request',
            displayName: 'Maintenance Request',
            description: 'Property maintenance requests',
        },
    });
    addIdField(maintenanceRequestEntity, {
        displayName: 'Maintenance ID',
        description: 'Unique identifier for the maintenance request',
    });
    addNameField(maintenanceRequestEntity, { description: 'Maintenance request description' });
    maintenanceRequestEntity.addProperty({
        info: { name: 'maintenance_type', displayName: 'Maintenance Type', description: 'Type of maintenance' },
        type: 'string',
        required: true,
        schema: {
            enum: ['preventive', 'corrective', 'emergency', 'inspection'],
        },
    });
    maintenanceRequestEntity.addProperty({
        info: { name: 'priority', displayName: 'Priority', description: 'Maintenance priority level' },
        type: 'string',
        required: true,
        schema: {
            enum: ['low', 'medium', 'high', 'critical'],
        },
    });
    addCustomStatusField(maintenanceRequestEntity, ['pending', 'in_progress', 'completed', 'cancelled'], {
        displayName: 'Maintenance Status',
        description: 'Current status of the maintenance request',
    });
    addCreatedAtField(maintenanceRequestEntity, { description: 'When the maintenance request was created' });
    // MaintenanceRequest-Room Association (Many-to-One)
    maintenanceRequestEntity.addAssociation({ key: roomEntity.key }, {
        info: { name: 'room', displayName: 'Room', description: 'Room for this maintenance request' },
        required: false,
        multiple: false,
    });
    return domain;
}
//# sourceMappingURL=hospitality-domain.js.map