Audit kitchen exhaust scope and photo evidence in TypeScript
The crew marks a duct section cleaned , but the photo index contains only its before photo. The same job records a rooftop fan as inaccessible . Both records need follow-up. One needs an after photo and the other needs an access plan. Bind each photo to its system and component Use the pair (systemId, componentId) as the scope key. Two kitchens can both have a HOOD-01 . Each photo ID resolves to…
The audit process for kitchen exhaust systems involves examining both before and after photos to ensure proper maintenance and functionality. The audit script, named "hoodcert-benchmark.ts", takes in an array of scope rows and photos. Each scope row contains information about the system ID, component ID, status (cleaned or inaccessible), and photo IDs. The photos are represented as objects with a unique ID, phase (before or after), and system/component information.
The script first creates a map of photos, asserting that each photo ID is unique and not a duplicate. It then iterates through the scope rows, checking for required system and component IDs, and storing the unique scope components in a set. Photos are then attached to their corresponding scope components, with assertions to verify that the photos belong to the expected system and component IDs. If any issues arise, such as missing or duplicate photos, the audit will generate follow-up tasks accordingly.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to