Skip to content

Instantly share code, notes, and snippets.

@veresh
Created October 16, 2023 09:51
Show Gist options
  • Save veresh/1d53857ee3472fbc07815ca2b630b5bd to your computer and use it in GitHub Desktop.
Save veresh/1d53857ee3472fbc07815ca2b630b5bd to your computer and use it in GitHub Desktop.
{
"openapi" : "3.0.1",
"info" : {
"title" : "API Specifications",
"contact" : {
"email" : "apiteam@swagger.io"
},
"version" : "1.0"
},
"servers" : [ {
"url" : "/digx-pfm/budget/v1"
} ],
"security" : [ {
"bearerAuth" : [ ]
} ],
"tags" : [ {
"name" : "Budget",
"description" : "Budget management."
} ],
"paths" : {
"/budget/{budgetId}" : {
"put" : {
"tags" : [ "Budget" ],
"summary" : "Updates an existing budget details.",
"description" : "Update method is used to update the details of an existing budget. User can able to update amount, name, frequency and periodicity of the budget. Following are the possible cases while updating the budget When user want to update the amount, frequency, periodicity of the budget or periodicity of the budget from current month to recursive then end date of the budget will be modified accordingly.",
"operationId" : "com.ofss.digx.appx.budget.service.Budget.update",
"parameters" : [ {
"name" : "budgetId",
"in" : "path",
"description" : "Unique id to update budget.",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"requestBody" : {
"description" : "Represents the Data transfer Object (DTO) class to update an existing budget.",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/BudgetDTO"
}
}
},
"required" : true
},
"responses" : {
"200" : {
"description" : "Transaction Successful",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/TransactionStatus"
}
}
}
},
"400" : {
"description" : "Validation Failure",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Status"
}
}
}
},
"500" : {
"description" : "Internal Server Error",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Status"
}
}
}
}
}
},
"delete" : {
"tags" : [ "Budget" ],
"summary" : "Deletes an existing budget.",
"description" : "User can delete the budget if it is not required.",
"operationId" : "com.ofss.digx.appx.budget.service.Budget.delete",
"parameters" : [ {
"name" : "budgetId",
"in" : "path",
"description" : "Unique id to delete budget details.",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"200" : {
"description" : "Transaction Successful",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/TransactionStatus"
}
}
}
},
"400" : {
"description" : "Validation Failure",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Status"
}
}
}
},
"500" : {
"description" : "Internal Server Error",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Status"
}
}
}
}
}
}
},
"/budget" : {
"get" : {
"tags" : [ "Budget" ],
"summary" : "List budgets as per filter criteria.",
"description" : "List the details of the current budgets using start date, end date and category ids. Budget contains details like category id, amount, version id, category name, start date, end date, frequency, periodicity etc.",
"operationId" : "com.ofss.digx.appx.budget.service.Budget.list",
"parameters" : [ {
"name" : "categoryIds",
"in" : "query",
"description" : "List of the budget category ids to be display.",
"required" : true,
"schema" : {
"type" : "array",
"items" : {
"type" : "string"
}
}
}, {
"name" : "startDate",
"in" : "query",
"description" : "Start date of the budget.",
"required" : true,
"schema" : {
"$ref" : "#/components/schemas/Date"
}
}, {
"name" : "endDate",
"in" : "query",
"description" : "End date of the budget.",
"required" : true,
"schema" : {
"$ref" : "#/components/schemas/Date"
}
} ],
"responses" : {
"200" : {
"description" : "Transaction Successful",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/BudgetListResponse"
}
}
}
},
"400" : {
"description" : "Validation Failure",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Status"
}
}
}
},
"500" : {
"description" : "Internal Server Error",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Status"
}
}
}
}
}
},
"post" : {
"tags" : [ "Budget" ],
"summary" : "Creates a budget.",
"description" : "Creates a budget for the customer.",
"operationId" : "com.ofss.digx.appx.budget.service.Budget.create",
"requestBody" : {
"description" : "Represents the Data transfer Object (DTO) class to create budget.",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/BudgetDTO"
}
}
},
"required" : true
},
"responses" : {
"201" : {
"description" : "Budget Created Successfully",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/BudgetCreateResponse"
}
}
}
},
"400" : {
"description" : "Validation Failure",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Status"
}
}
}
},
"500" : {
"description" : "Internal Server Error",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Status"
}
}
}
}
}
}
}
},
"components" : {
"schemas" : {
"Status" : {
"type" : "object",
"properties" : {
"result" : {
"type" : "string",
"enum" : [ "SUCCESSFUL", "FAILED", "ACCEPTED", "EXPECTATION_FAILED" ]
},
"referenceNumber" : {
"type" : "string"
},
"externalReferenceNumber" : {
"type" : "string"
},
"contextID" : {
"type" : "string"
},
"message" : {
"$ref" : "#/components/schemas/Message"
},
"receiptAvailable" : {
"type" : "boolean"
},
"lastKnownError" : {
"type" : "object",
"properties" : {
"stackTrace" : {
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"methodName" : {
"type" : "string"
},
"fileName" : {
"type" : "string"
},
"lineNumber" : {
"type" : "integer",
"format" : "int32"
},
"className" : {
"type" : "string"
},
"nativeMethod" : {
"type" : "boolean"
}
}
}
},
"message" : {
"type" : "string"
},
"localizedMessage" : {
"type" : "string"
},
"suppressed" : {
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"stackTrace" : {
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"methodName" : {
"type" : "string"
},
"fileName" : {
"type" : "string"
},
"lineNumber" : {
"type" : "integer",
"format" : "int32"
},
"className" : {
"type" : "string"
},
"nativeMethod" : {
"type" : "boolean"
}
}
}
},
"message" : {
"type" : "string"
},
"localizedMessage" : {
"type" : "string"
}
}
}
}
}
},
"apiType" : {
"type" : "string"
}
}
},
"Dictionary" : {
"type" : "object",
"properties" : {
"nameValuePairDTOArray" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/NameValuePairDTO"
}
},
"fullyQualifiedClassName" : {
"type" : "string"
}
}
},
"BudgetCreateResponse" : {
"type" : "object",
"properties" : {
"dictionaryArray" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/Dictionary"
}
},
"refLinks" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/HateoasLinkDTO"
}
},
"status" : {
"$ref" : "#/components/schemas/Status"
},
"budgetId" : {
"type" : "string"
},
"versionId" : {
"type" : "string"
}
}
},
"Message" : {
"type" : "object",
"properties" : {
"title" : {
"type" : "string"
},
"detail" : {
"type" : "string"
},
"code" : {
"type" : "string"
},
"validationError" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/ValidationError"
}
},
"relatedMessage" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/Message"
}
},
"type" : {
"type" : "string",
"enum" : [ "INFO", "WARNING", "ERROR" ]
}
}
},
"NameValuePairDTO" : {
"type" : "object",
"properties" : {
"name" : {
"type" : "string"
},
"genericName" : {
"type" : "string"
},
"value" : {
"type" : "string"
},
"datatype" : {
"type" : "string"
}
}
},
"TransactionStatus" : {
"type" : "object",
"properties" : {
"isOverriden" : {
"type" : "boolean"
},
"replyCode" : {
"type" : "integer",
"format" : "int64"
},
"replyText" : {
"type" : "string"
},
"memo" : {
"type" : "string"
},
"externalReferenceNo" : {
"type" : "string"
},
"internalReferenceNumber" : {
"type" : "string"
},
"postingDate" : {
"title" : "Date",
"type" : "string",
"format" : "date-time"
},
"relatedStatus" : {
"$ref" : "#/components/schemas/TransactionStatus"
},
"errorCode" : {
"type" : "string"
},
"extendedReply" : {
"$ref" : "#/components/schemas/ExtendedReply"
},
"validationErrors" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/ValidationError"
}
},
"userReferenceNumber" : {
"type" : "string"
}
}
},
"ExtendedReply" : {
"type" : "object",
"properties" : {
"messages" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/ReplyMessage"
}
}
}
},
"ReplyMessage" : {
"type" : "object",
"properties" : {
"code" : {
"type" : "string",
"enum" : [ "586", "1051", "1052", "32", "37", "94", "1019", "24", "83", "12", "74", "84", "77", "52", "95", "27", "34", "106", "33", "0", "42", "92", "82", "75", "85", "1023", "5", "46", "D101", "111", "110", "47", "105", "4", "11", "30", "49", "53", "1011", "31", "101", "39", "71", "96", "63", "61", "78", "44", "59", "1017", "45", "2", "15", "40", "1022", "79", "62", "56", "1028", "23", "80", "90", "18", "22", "91", "1001", "48", "51", "50", "93", "69", "97", "28", "14", "58", "20", "60", "19", "64", "81", "26", "9", "41", "65", "86", "STR_DDA_001", "25", "29", "38", "10", "73", "88", "89", "21", "43", "1002", "66", "68", "118", "16", "35", "100", "72", "99", "1018", "114", "3", "76", "17", "1000", "8", "67", "87", "7", "36", "1", "11", "70", "1050", "6", "57", "1042", "98", "54", "55", "1016", "9", "-1" ]
},
"message" : {
"type" : "string"
}
}
},
"CurrencyAmount" : {
"type" : "object",
"properties" : {
"currency" : {
"type" : "string"
},
"amount" : {
"type" : "number"
}
},
"description" : " Holds the budget amount"
},
"Date" : {
"title" : "Date",
"type" : "object",
"properties" : {
"year" : {
"type" : "integer",
"format" : "int32"
},
"month" : {
"type" : "integer",
"format" : "int32"
},
"dayOfMonth" : {
"type" : "integer",
"format" : "int32"
},
"time" : {
"type" : "integer",
"format" : "int64"
},
"timestamp" : {
"type" : "string",
"format" : "date-time"
},
"dayOfYear" : {
"type" : "integer",
"format" : "int32"
},
"dayOfWeek" : {
"type" : "integer",
"format" : "int32"
},
"leapYear" : {
"type" : "boolean"
},
"millis" : {
"type" : "integer",
"format" : "int64"
},
"monthDate" : {
"type" : "integer",
"format" : "int32"
},
"calendarDayOfWeek" : {
"type" : "string",
"enum" : [ "1", "2", "3", "4", "5", "6", "7" ]
},
"monthDateTime" : {
"type" : "integer",
"format" : "int64"
},
"yearMonthDate" : {
"type" : "integer",
"format" : "int64"
},
"yearMonth" : {
"type" : "integer",
"format" : "int64"
},
"weekOfYear" : {
"type" : "integer",
"format" : "int32"
},
"sqlDate" : {
"type" : "string",
"format" : "date-time"
},
"lastDayOfMonth" : {
"type" : "integer",
"format" : "int32"
},
"sqltimestamp" : {
"type" : "string",
"format" : "date-time"
},
"dateString" : {
"type" : "string"
},
"infinite" : {
"type" : "boolean"
},
"null" : {
"type" : "boolean"
}
},
"format" : "date-time",
"example" : "2018-06-15T10:10:00"
},
"BudgetListResponse" : {
"type" : "object",
"properties" : {
"dictionaryArray" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/Dictionary"
}
},
"refLinks" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/HateoasLinkDTO"
}
},
"status" : {
"$ref" : "#/components/schemas/Status"
},
"budgetDTOs" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/BudgetDTO"
}
}
}
},
"ValidationError" : {
"type" : "object",
"properties" : {
"objectName" : {
"type" : "string"
},
"attributeName" : {
"type" : "string"
},
"attributeValue" : {
"type" : "string"
},
"errorCode" : {
"type" : "string"
},
"errorMessage" : {
"type" : "string"
},
"methodName" : {
"type" : "string"
},
"applicableAttributes" : {
"type" : "string"
},
"errorMessageParams" : {
"type" : "array",
"items" : {
"type" : "string"
}
}
}
},
"HateoasLinkDTO" : {
"type" : "object",
"properties" : {
"href" : {
"type" : "string"
},
"rel" : {
"type" : "string"
},
"method" : {
"type" : "string"
}
}
},
"BudgetDTO" : {
"title" : "BudgetDTO",
"required" : [ "amount", "categoryId", "frequency", "periodicity" ],
"type" : "object",
"properties" : {
"dictionaryArray" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/Dictionary"
}
},
"refLinks" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/HateoasLinkDTO"
}
},
"budgetId" : {
"type" : "string"
},
"categoryId" : {
"type" : "string",
"description" : " Holds the category Id"
},
"versionId" : {
"type" : "string"
},
"name" : {
"type" : "string"
},
"partyId" : {
"type" : "string"
},
"amount" : {
"$ref" : "#/components/schemas/CurrencyAmount"
},
"frequency" : {
"type" : "string",
"description" : " Holds the frequency of the budget",
"enum" : [ "Weekly", "Monthly", "Quarterly", "HalfYearly", "Annually" ]
},
"periodicity" : {
"type" : "string",
"description" : " Holds the periodicity of the budget",
"enum" : [ "Once", "Custom", "Recursive" ]
},
"customPeriodicityValue" : {
"type" : "integer",
"format" : "int32"
},
"startDate" : {
"title" : "Date",
"type" : "string",
"description" : " Holds the start date of the budget",
"format" : "date-time"
},
"endDate" : {
"title" : "Date",
"type" : "string",
"description" : " Holds the end date of the budget",
"format" : "date-time"
},
"categoryName" : {
"type" : "string"
}
}
}
},
"securitySchemes" : {
"bearerAuth" : {
"type" : "oauth2",
"flows" : {
"password" : {
"tokenUrl" : "/digx-auth/v1/token",
"refreshUrl" : "/digx-auth/v1/token"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment