meeting.js

Overview

This file defines the Meeting class, which encapsulates the core logic for managing the lifecycle, state, and cost calculations of a meeting session. It models a meeting as a sequence of discrete time increments, each capturing a snapshot of attendee count, average wage, elapsed time, and purpose. The class supports starting, stopping, resetting meetings, and dynamically updating parameters such as attendee count, average wage, and meeting purpose during an active session.

Meeting interacts closely with the Increment class (imported from increment.js), which represents individual time slices with associated cost calculations, and with a warehouse instance responsible for persistent storage of completed meeting increments.

This file is central to the functionality described in Real-Time Meeting Cost Tracking, Meeting Lifecycle Management, and Incremental Cost Calculation.


Class: Meeting

Properties


Constructor

constructor(attendeeCount, averageWage, warehouse, increments = [], purposeInput = '')

Methods

startMeeting()

startMeeting()

stopMeeting()

stopMeeting()

resetMeeting()

resetMeeting()

changeAttendeeCount(newAttendeeCount)

changeAttendeeCount(newAttendeeCount)

changeAverageWage(newAverageWage)

changeAverageWage(newAverageWage)

changePurpose(purpose)

changePurpose(purpose)

getTotalCost()

getTotalCost() : number

getTotalTime()

getTotalTime() : number

getMaxAttendees()

getMaxAttendees() : number

burnPerSecond()

burnPerSecond() : number

burnPerMinute()

burnPerMinute() : number

timeElapsedInSeconds(currentTime = new Date, pastTime = this.currentIncrementStartTime)

timeElapsedInSeconds(currentTime, pastTime) : number

pushIncrement()

pushIncrement()

Static Properties

defaultObject

static get defaultObject()

Important Implementation Details


Interactions with Other System Components


Visual Diagram

classDiagram
class Meeting {
+boolean clockRunning
+Increment[] increments
+Date|string currentIncrementStartTime
+number currentIncrementAttendeeCount
+number currentIncrementAverageWage
+string purpose
+object warehouse
+constructor(attendeeCount, averageWage, warehouse, increments, purposeInput)
+startMeeting()
+stopMeeting()
+resetMeeting()
+changeAttendeeCount()
+changeAverageWage()
+changePurpose()
+getTotalCost()
+getTotalTime()
+getMaxAttendees()
+burnPerSecond()
+burnPerMinute()
+timeElapsedInSeconds()
-pushIncrement()
+static defaultObject
}
Meeting --> Increment : uses >

Additional Notes


This file provides the foundational data model and logic for managing meetings in the application, supporting precise, real-time cost tracking as meetings progress and parameters evolve dynamically.