539 lines
12 KiB
JSON
539 lines
12 KiB
JSON
{
|
|
"openapi": "3.0.1",
|
|
"info": {
|
|
"title": "Attica Server Application v1",
|
|
"description": "Version 1 of Attica Server Application API",
|
|
"license": {
|
|
"name": "MIT",
|
|
"url": "https://opensource.org/licenses/MIT"
|
|
},
|
|
"version": "1.0.0"
|
|
},
|
|
"servers": [
|
|
{
|
|
"url": "http://localhost:3000/v0/"
|
|
},
|
|
{
|
|
"url": "https://erp-server.triadkube.com/v0/"
|
|
}
|
|
],
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
],
|
|
"components": {
|
|
"securitySchemes": {
|
|
"bearerAuth": {
|
|
"type": "http",
|
|
"scheme": "bearer",
|
|
"bearerFormat": "JWT"
|
|
}
|
|
}
|
|
},
|
|
"paths": {
|
|
"/user/create": {
|
|
"post": {
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"summary": "Create Account for New User",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
"id": {
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"required": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/user/login": {
|
|
"post": {
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"summary": "Login with Employee Id and Password",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"required": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/user/token/renew": {
|
|
"post": {
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"summary": "Login with Employee Code and Password",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"refreshToken": {
|
|
"type": "string",
|
|
"required": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/profile": {
|
|
"post": {
|
|
"tags": [
|
|
"Profile"
|
|
],
|
|
"summary": "Create or Edit Profile New User",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"user": {
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
"mobile": {
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
"address": {
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
"city": {
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
"state": {
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
"pincode": {
|
|
"type": "string",
|
|
"required": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {}
|
|
}
|
|
}
|
|
},
|
|
"get": {
|
|
"tags": [
|
|
"Profile"
|
|
],
|
|
"summary": "Get Profile for a User",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/location/create": {
|
|
"post": {
|
|
"tags": [
|
|
"Location"
|
|
],
|
|
"summary": "Create New Location",
|
|
"parameters": [
|
|
{
|
|
"in": "query",
|
|
"name": "key",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
"coordinates": {
|
|
"type": "array",
|
|
"required": true
|
|
},
|
|
"venue": {
|
|
"type": "string",
|
|
"required": false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/uploads/single/{folder}": {
|
|
"post": {
|
|
"tags": [
|
|
"Uploads"
|
|
],
|
|
"summary": "Endpoint to handle Single File",
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "folder"
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"multipart/form-data": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"file": {
|
|
"type": "string",
|
|
"format": "binary"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/access": {
|
|
"post": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"summary": "Create Access for an Employee",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"user": {
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
"designation": {
|
|
"type": "array",
|
|
"required": true
|
|
},
|
|
"department": {
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
"role": {
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
"branch": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"required": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/branches": {
|
|
"get": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"summary": "Get All Branches",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/designations": {
|
|
"get": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"summary": "Get All Designations",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/departments": {
|
|
"get": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"summary": "Get All Departments",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/roles": {
|
|
"get": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"summary": "Get All Roles",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/branch": {
|
|
"post": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"summary": "Create New Branch",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
"address": {
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
"city": {
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
"state": {
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
"pincode": {
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
"coordinates": {
|
|
"type": "object",
|
|
"required": true,
|
|
"properties": {
|
|
"latitude": {
|
|
"type": "number",
|
|
"required": true
|
|
},
|
|
"longitude": {
|
|
"type": "number",
|
|
"required": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/designation": {
|
|
"post": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"summary": "Create New Designation",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"required": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/department": {
|
|
"post": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"summary": "Create New Department",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"required": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/role": {
|
|
"post": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"summary": "Create New Role",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"required": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |