A Reporting Cycle is a series of reports owed to one recipient, e.g. quarterly to Comic Relief. Each Deadline is one report owed: which Report Template it answers, which projects and albums it covers (its Work to include), which timeframe, and when it is due.
+Every id must belong to the organisation: editor_ids and reporter_ids are its users, project_ids its projects you can view, album_ids its albums, and report_template_id a Report Template it can use. Dates are YYYY-MM-DD, and a Deadline's timeframe_from must be on or before its timeframe_to. Deleting a cycle is only on its page.
id, charity_id, name, recipient, editor_ids, reporter_ids, deadline_count, next_deadline and updated_at" },
+ { code: "404", cls: "response-4xx", desc: "No such organisation" }
+ ])}
+ ${endpointCard("GET", "/reporting_cycles/{id}", "Get a Reporting Cycle", true, [
+ { name: "id", in: "path", type: "integer", required: true, desc: "The Reporting Cycle" }
+ ], [
+ { code: "200", cls: "response-2xx", desc: "In data: name, recipient, reporting_guidance, nuance, editors, reporters and deadlines in due order, each with report_template, timeframe_from, timeframe_to, submission_deadline, projects, albums, exclusive_focus_filter_data, reporting_guidance, nuance, editors and reporters" },
+ { code: "404", cls: "response-4xx", desc: "Not found, or one you can't see" }
+ ])}
+ ${endpointCard("POST", "/reporting_cycles", "Create a Reporting Cycle", true, [
+ { name: "charity_id", in: "body", type: "integer", required: true, desc: "The organisation" },
+ { name: "name", in: "body", type: "string", required: true, desc: "e.g. Comic Relief 2027" },
+ { name: "recipient", in: "body", type: "string", required: false, desc: "Who the reports go to" },
+ { name: "reporting_guidance", in: "body", type: "string", required: false, desc: "What every report should cover" },
+ { name: "nuance", in: "body", type: "string", required: false, desc: "What the people writing the reports should bear in mind" },
+ { name: "editor_ids", in: "body", type: "array", required: false, desc: "Colleagues who may change the cycle" },
+ { name: "reporter_ids", in: "body", type: "array", required: false, desc: "Colleagues who contribute to its reports" },
+ { name: "deadlines", in: "body", type: "array", required: false, desc: "Each with name, report_template_id, timeframe_from, timeframe_to, submission_deadline, project_ids, album_ids, exclusive_focus_filter_data, reporting_guidance, nuance, editor_ids and reporter_ids" }
+ ], [
+ { code: "201", cls: "response-2xx", desc: "The new Reporting Cycle, in data" },
+ { code: "404", cls: "response-4xx", desc: "An organisation you aren't an Organisation Admin of" },
+ { code: "422", cls: "response-4xx", desc: "errors naming the Deadline, e.g. Deadline \"Q1\": Timeframe from must be on or before timeframe to" }
+ ])}
+ ${endpointCard("PATCH", "/reporting_cycles/{id}", "Change a Reporting Cycle", true, [
+ { name: "id", in: "path", type: "integer", required: true, desc: "The Reporting Cycle" },
+ { name: "deadlines", in: "body", type: "array", required: false, desc: "Give an existing Deadline's id to change it; Deadlines without one are added; {id, _destroy: true} removes one; Deadlines not listed are kept" }
+ ], [
+ { code: "200", cls: "response-2xx", desc: "The changed Reporting Cycle, in data" },
+ { code: "403", cls: "response-4xx", desc: "Not an Organisation Admin or an Editor of the cycle" },
+ { code: "404", cls: "response-4xx", desc: "Not found, or one you can't see" },
+ { code: "422", cls: "response-4xx", desc: "errors" }
+ ], "Fields left out stay as they are. editor_ids and reporter_ids, when given, replace the list.")}
+