{"id":"cx-sla-credit-calc-json","audience":"customer-support","category":"support-work","technique":"format","track":"support","level":"advanced","title":"Compute SLA credits for three tickets as JSON","free":false,"task":"Compute the SLA credit for each ticket and return one JSON code block with an array of three objects, one per line. Keys: ticket, breached (true or false), minutes_over (a number, 0 if not breached), credit_usd (a number). Nothing outside the code block. At most 5 lines of code.","materialLabel":"Your material (attached to your prompt automatically)","material":"SLA TERMS (P1 tickets)\n- First response target: 60 minutes from ticket creation.\n- Credit: $100 for each FULL 30 minutes beyond the target. Maximum credit per ticket: $300.\n\nP1 TICKETS, OCTOBER\nP-1: created 01:00, first response 02:50\nP-2: created 09:00, first response 09:55\nP-3: created 20:00, first response 23:30\n\nExample: a ticket answered 70 minutes after the target gets 2 full blocks of 30 minutes = $200.\nAll times are the same day and the same time zone.\n\nFinance note: 'We usually round up partial blocks.' (Contract says FULL blocks only.)","rules":[{"type":"codeBlocks","count":1},{"type":"maxCodeLines","max":5}],"mistakes":[{"title":"Rounding partial blocks up","why":"The finance note says to round up; the contract says full blocks.","fix":"Say: \"Full 30-minute blocks only. Cap at $300.\"","checks":["r1"]},{"title":"Missing the cap","why":"The AI gives P-3 $500.","fix":"Say: \"Maximum credit per ticket is $300.\"","checks":["r2"]},{"title":"Extra text","why":"The AI adds a working section.","fix":"Say: \"One JSON code block, nothing else.\"","checks":["r0"]},{"title":"Skipping the code block shape","why":"The AI splits output into several code blocks or none.","fix":"Say \"exactly one code block and nothing else\".","checks":["codeBlocks"]},{"title":"Letting the code sprawl","why":"The AI adds extra lines and comments.","fix":"Say \"at most N lines of code\".","checks":["maxCodeLines"]}],"promptHints":[{"label":"Asks for one code block","patterns":["code block","```"]},{"label":"Caps the code length","patterns":["lines"]},{"label":"Names the keys","patterns":["ticket","breached","minutes_over","credit_usd"]},{"label":"States the credit rule","patterns":["full 30","\\$100","\\$300"]}],"hint":"Credits depend on exact rules. Give the target, the block size, the cap and the JSON shape.","rubricLabels":["The output is one JSON code block with three objects with the keys ticket, breached, minutes_over and credit_usd, and nothing outside the block","P-1 is breached with minutes_over 50 and credit_usd 100, and P-2 is not breached with minutes_over 0 and credit_usd 0","P-3 is breached with minutes_over 150 and credit_usd 300 (5 blocks capped at the maximum $300)"]}