{ "swagger": "2.0", "info": { "title": "API Documentation", "version": "1.0.0", "contact": {} }, "paths": { "/moods": { "get": { "description": "Get details of all moods", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "moods" ], "summary": "Get all moods", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.Mood" } } } } }, "post": { "description": "Create a new mood with the input payload", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "moods" ], "summary": "Create a new mood", "parameters": [ { "description": "Mood", "name": "mood", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.Mood" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Mood" } } } } }, "/moods/{id}": { "get": { "description": "Get details of a mood by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "moods" ], "summary": "Get a mood by ID", "parameters": [ { "type": "integer", "description": "Mood ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Mood" } } } }, "put": { "description": "Update details of a mood by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "moods" ], "summary": "Update a mood by ID", "parameters": [ { "type": "integer", "description": "Mood ID", "name": "id", "in": "path", "required": true }, { "description": "Mood", "name": "mood", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.Mood" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Mood" } } } }, "delete": { "description": "Delete a mood by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "moods" ], "summary": "Delete a mood by ID", "parameters": [ { "type": "integer", "description": "Mood ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" } } } }, "/students": { "get": { "description": "Get details of all students", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "students" ], "summary": "Get all students", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.Student" } } } } }, "post": { "description": "Create a new student with the input payload", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "students" ], "summary": "Create a new student", "parameters": [ { "description": "Student", "name": "student", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.Student" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Student" } } } } }, "/students/{id}": { "get": { "description": "Get details of a student by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "students" ], "summary": "Get a student by ID", "parameters": [ { "type": "integer", "description": "Student ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Student" } } } }, "put": { "description": "Update details of a student by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "students" ], "summary": "Update a student by ID", "parameters": [ { "type": "integer", "description": "Student ID", "name": "id", "in": "path", "required": true }, { "description": "Student", "name": "student", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.Student" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Student" } } } }, "delete": { "description": "Delete a student by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "students" ], "summary": "Delete a student by ID", "parameters": [ { "type": "integer", "description": "Student ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" } } } }, "/attendance/{id}": { "post": { "description": "Post attendance for a student by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "attendance" ], "summary": "Post attendance for a student by ID", "parameters": [ { "type": "integer", "description": "Attendance ID", "name": "id", "in": "path", "required": true }, { "description": "Attendance", "name": "attendance", "in": "body", "required": true, "schema": { "type": "object", "properties": { "student_id": { "type": "integer" }, "date": { "type": "string" }, "status": { "type": "string" } } } } ], "responses": { "200": { "description": "OK" } } } }, "/employers": { "post": { "description": "Create a new employer with the input payload", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "employers" ], "summary": "Create a new employer", "parameters": [ { "description": "Employer", "name": "employer", "in": "body", "required": true, "schema": { "type": "object", "properties": { "name": { "type": "string" }, "address": { "type": "string" }, "contact_number": { "type": "string" } } } } ], "responses": { "200": { "description": "OK" } } } }, "/employers/{id}": { "get": { "description": "Get details of an employer by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "employers" ], "summary": "Get an employer by ID", "parameters": [ { "type": "integer", "description": "Employer ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" } } }, "put": { "description": "Update details of an employer by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "employers" ], "summary": "Update an employer by ID", "parameters": [ { "type": "integer", "description": "Employer ID", "name": "id", "in": "path", "required": true }, { "description": "Employer", "name": "employer", "in": "body", "required": true, "schema": { "type": "object", "properties": { "name": { "type": "string" }, "address": { "type": "string" }, "contact_number": { "type": "string" } } } } ], "responses": { "200": { "description": "OK" } } }, "delete": { "description": "Delete an employer by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "employers" ], "summary": "Delete an employer by ID", "parameters": [ { "type": "integer", "description": "Employer ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" } } } }, "/supervisors": { "get": { "description": "Get details of all supervisors", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "supervisors" ], "summary": "Get all supervisors", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.Supervisor" } } } } }, "post": { "description": "Create a new supervisor with the input payload", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "supervisors" ], "summary": "Create a new supervisor", "parameters": [ { "description": "Supervisor", "name": "supervisor", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.Supervisor" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Supervisor" } } } } }, "/supervisors/{id}": { "get": { "description": "Get details of a supervisor by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "supervisors" ], "summary": "Get a supervisor by ID", "parameters": [ { "type": "integer", "description": "Supervisor ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Supervisor" } } } }, "put": { "description": "Update details of a supervisor by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "supervisors" ], "summary": "Update a supervisor by ID", "parameters": [ { "type": "integer", "description": "Supervisor ID", "name": "id", "in": "path", "required": true }, { "description": "Supervisor", "name": "supervisor", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.Supervisor" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Supervisor" } } } }, "delete": { "description": "Delete a supervisor by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "supervisors" ], "summary": "Delete a supervisor by ID", "parameters": [ { "type": "integer", "description": "Supervisor ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" } } } } }, "definitions": { "models.Mood": { "type": "object", "properties": { "emotion": { "type": "string" }, "id": { "type": "integer" }, "is_daily": { "type": "boolean" }, "recorded_at": { "type": "string" }, "student_id": { "type": "integer" } } }, "models.Student": { "type": "object", "properties": { "address_line1": { "type": "string" }, "address_line2": { "type": "string" }, "city": { "type": "string" }, "contact_number": { "type": "string" }, "contact_number_guardian": { "type": "string" }, "dob": { "type": "string" }, "employer_id": { "type": "integer" }, "first_name": { "type": "string" }, "gender": { "type": "string" }, "home_coordinates": { "type": "string" }, "id": { "type": "integer" }, "last_name": { "type": "string" }, "photo": { "type": "array", "items": { "type": "integer" } }, "remarks": { "type": "string" }, "supervisor_id": { "type": "integer" } } }, "models.Supervisor": { "type": "object", "properties": { "contact_number": { "type": "string" }, "email_address": { "type": "string" }, "first_name": { "type": "string" }, "last_name": { "type": "string" }, "student_id": { "type": "integer" }, "supervisor_id": { "type": "integer" } } } } }