Admin Site (app.commandit.com)
...
Service Desk
Outages
8 min
developer guide 1\ introduction this document provides a detailed technical specification for building the outage dashboard and its associated management screens the core design principle is a seamless user experience where the system intelligently handles the distinction between standalone, master, and child outages based on user actions, rather than requiring explicit choices 2\ core data model & required schema the entire feature is powered by two primary tables outage and outage update outage the single source of truth for all outage records outage update the chronological log for each outage's timeline it is assumed the outage table includes an affected location ids uuid\[] column to support location specific outages 3\ part 1 main outage dashboard screen (/outages) data fetching & display logic the main table provides a high level summary and must only display master and standalone outages child outages are intentionally hidden from this view to reduce clutter primary sql query select o id, o title, o status, o start time utc, o is master, v name as vendor name, org name as organization name, t ticket number, (select count( ) from outage child where child parent outage id = o id) as child count from outage o left join vendor v on o vendor id = v id left join organization org on o organization id = org id left join ticket t on o related ticket id = t id where o parent outage id is null and o status not in ('resolved', 'closed') order by o start time utc desc; row rendering logic (client side) for each row returned by the query if is master is true affected client(s) display the child count value (e g , "3 clients") this should be a link that, when clicked, shows a popover with the names of the affected clients affected locations display a static summary string like "multiple" linked ticket display a hyphen ( ) if is master is false affected client(s) display the organization name from the query affected locations fetch the names of the locations from the location table using the ids in the affected location ids array and display them as a comma separated list linked ticket display the ticket number 4\ part 2 view/manage outage screen (/outages/{id}) this screen is the central command center for a specific outage the content is determined by whether the loaded outage (id) is a master or a standalone record data fetching on page load, fetch the primary outage record by its id then, perform subsequent queries to populate the different sections component breakdown & logic header displays title, status, vendor name, and a dynamically calculated duration from the primary outage record details section displays editable fields from the primary outage record an update query is triggered on the outage table when a field is saved affected organizations section if master outage this section is populated by select o id, org name, o affected location ids from outage o join organization org on o organization id = org id where o parent outage id = ? if standalone outage this section lists the single client from the primary outage record's organization id timeline section if master outage the timeline must be comprehensive the query should be select from outage update where outage id = ? or outage id in (select id from outage where parent outage id = ?) order by posted at utc desc this combines updates from the master and all its children if standalone outage the query is simpler select from outage update where outage id = ? order by posted at utc desc related tickets section if master outage the query is select t ticket number, org name from outage o join ticket t on o related ticket id = t id join organization org on o organization id = org id where o parent outage id = ? if standalone outage displays the single ticket from the primary outage record's related ticket id 5\ part 3 detailed modal & workflow logic "add outage" modal (from main dashboard) ui logic the "affected location(s)" dropdown is dynamically populated based on the organization(s) selected if multiple organizations are selected, the location dropdown is disabled and shows "all locations will be affected" backend logic on "add outage" button click if 1 organization is selected insert a single record into the outage table set is master = false, parent outage id = null save the selected organization id and the array of affected location ids if "create and link a new ticket" is toggled, create a ticket and update this new outage record with the ticket id if >1 organization is selected insert one master record into outage set is master = true and organization id to the msp's own id loop through the selected organizations and insert multiple child records, setting parent outage id to the new master id affected location ids can be set to all locations for each client if "create and link a new ticket" is toggled, create a ticket for each child outage and update each child record with its respective ticket id "add organization" modal (from view screen) pre condition this workflow is only available when viewing a master outage backend logic on "add" button click insert a new child outage record set its parent outage id to the id of the master outage being viewed if the ticket toggle is on, create a linked ticket for this new child outage "add update" modal (from view screen) backend logic on "add update" button click insert a new record into outage update outage id is the id of the outage being viewed (the master record) event type is 'note' "resolve outage" wizard modal backend logic on "confirm and resolve" button click start transaction gather ids get the id of the master outage and all of its child outage ids update outages update outage set status = 'resolved', end time utc = ? where id in ( ) using the collected ids and the end time from step 1 post final updates insert into outage update for the master outage, using the resolution summary from step 1 insert into outage update for the master outage, using the update message from step 3 problem management loop through the choices from step 2 for each organization if "new record", insert into problem and then insert into problem incident link if "existing record", find the problem id and insert into problem incident link send notifications if the "send notification" toggle was on in step 3, generate and send a notice linked to the master outage (target entity type = 'outage', target entity id = master outage id) commit transaction time tracking