diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..b28acea --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,20 @@ +.openapi-generator-ignore +README.md +models/error.proto +models/error_error.proto +models/get_all_issue_track_response.proto +models/get_all_issue_track_response_message_inner.proto +models/issue.proto +models/issue_post_req.proto +models/issue_post_req_message.proto +models/issue_raise_post202_response.proto +models/issue_raise_post202_response_message.proto +models/issue_track_response.proto +models/issue_track_response_message_inner.proto +models/order.proto +models/person.proto +models/reason.proto +models/reason_response.proto +models/reason_response_message_inner.proto +services/issue_service.proto +services/reason_service.proto diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..6d54bbd --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.0.1 \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..5e9e1b4 --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# gPRC for openapitools + +API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + +## Overview +These files were generated by the [OpenAPI Generator](https://openapi-generator.tech) project. + +- API version: 1.0.0 +- Package version: +- Build package: org.openapitools.codegen.languages.ProtobufSchemaCodegen + +## Usage + +Below are some usage examples for Go and Ruby. For other languages, please refer to https://grpc.io/docs/quickstart/. + +### Go +``` +# assuming `protoc-gen-go` has been installed with `go get -u github.com/golang/protobuf/protoc-gen-go` +mkdir /var/tmp/go/ +protoc --go_out=/var/tmp/go/ services/* +protoc --go_out=/var/tmp/go/ models/* +``` + +### Ruby +``` +# assuming `grpc_tools_ruby_protoc` has been installed via `gem install grpc-tools` +RUBY_OUTPUT_DIR="/var/tmp/ruby/openapitools" +mkdir $RUBY_OUTPUT_DIR +grpc_tools_ruby_protoc --ruby_out=$RUBY_OUTPUT_DIR --grpc_out=$RUBY_OUTPUT_DIR/lib services/* +grpc_tools_ruby_protoc --ruby_out=$RUBY_OUTPUT_DIR --grpc_out=$RUBY_OUTPUT_DIR/lib models/* +``` diff --git a/models/error.proto b/models/error.proto new file mode 100644 index 0000000..57d6b77 --- /dev/null +++ b/models/error.proto @@ -0,0 +1,21 @@ +/* + API for independant issue ticket system + + API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package openapitools; + +import public "models/error_error.proto"; + +message Error { + + ErrorError error = 96784904; + +} diff --git a/models/error_error.proto b/models/error_error.proto new file mode 100644 index 0000000..f670889 --- /dev/null +++ b/models/error_error.proto @@ -0,0 +1,37 @@ +/* + API for independant issue ticket system + + API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package openapitools; + + +message ErrorError { + + // Error type + enum TypeEnum { + TypeEnum_CONTEXT_ERROR = 0; + TypeEnum_DOMAIN_ERROR = 1; + TypeEnum_POLICY_ERROR = 2; + TypeEnum_JSON_SCHEMA_ERROR = 3; + } + + TypeEnum type = 3575610; + + // Describes an error object + string code = 3059181; + + // Path to json schema generating the error. Used only during json schema validation errors + string path = 3433509; + + // Human readable message describing the error + string message = 418054152; + +} diff --git a/models/get_all_issue_track_response.proto b/models/get_all_issue_track_response.proto new file mode 100644 index 0000000..a2cc397 --- /dev/null +++ b/models/get_all_issue_track_response.proto @@ -0,0 +1,21 @@ +/* + API for independant issue ticket system + + API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package openapitools; + +import public "models/get_all_issue_track_response_message_inner.proto"; + +message GetAllIssueTrackResponse { + + repeated GetAllIssueTrackResponseMessageInner message = 418054152; + +} diff --git a/models/get_all_issue_track_response_message_inner.proto b/models/get_all_issue_track_response_message_inner.proto new file mode 100644 index 0000000..38524ec --- /dev/null +++ b/models/get_all_issue_track_response_message_inner.proto @@ -0,0 +1,30 @@ +/* + API for independant issue ticket system + + API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package openapitools; + +import public "models/issue_id.proto"; +import public "models/issue_status.proto"; +import public "models/order_id.proto"; +import public "models/timestamp.proto"; + +message GetAllIssueTrackResponseMessageInner { + + IssueId issueUnderscoreid = 79087824; + + IssueStatus issueUnderscorestatus = 428440101; + + OrderId orderUnderscoreid = 34578371; + + Timestamp timestamp = 55126294; + +} diff --git a/models/issue.proto b/models/issue.proto new file mode 100644 index 0000000..5893497 --- /dev/null +++ b/models/issue.proto @@ -0,0 +1,53 @@ +/* + API for independant issue ticket system + + API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package openapitools; + + +message Issue { + + // unique issue id + int64 issueUnderscoreid = 79087824; + + // timestamp for issue + string timestamp = 55126294; + + // Issue Status + enum IssueUnderscorestatusEnum { + IssueUnderscorestatusEnum_ACKNOWLEDGE = 0; + IssueUnderscorestatusEnum_FULFILLED = 1; + IssueUnderscorestatusEnum_DECLINED = 2; + IssueUnderscorestatusEnum_IN_PROGRESS = 3; + IssueUnderscorestatusEnum_RETURN_INITIATED = 4; + IssueUnderscorestatusEnum_RETURN_INPROGRESS = 5; + IssueUnderscorestatusEnum_RETURN_COMPLETED = 6; + IssueUnderscorestatusEnum_RETURN_DECLINED = 7; + IssueUnderscorestatusEnum_REFUND_INITIATED = 8; + IssueUnderscorestatusEnum_REFUND_INPROGRESS = 9; + IssueUnderscorestatusEnum_REFUND_COMPLETED = 10; + IssueUnderscorestatusEnum_REFUND_DECLINED = 11; + } + + IssueUnderscorestatusEnum issueUnderscorestatus = 428440101; + + // message description the issue + string issueUnderscoremessage = 509305805; + + // request constants + enum RequestUnderscoreforEnum { + RequestUnderscoreforEnum_REFUND = 0; + RequestUnderscoreforEnum_RETURN = 1; + } + + RequestUnderscoreforEnum requestUnderscorefor = 191040131; + +} diff --git a/models/issue_post_req.proto b/models/issue_post_req.proto new file mode 100644 index 0000000..d0325ee --- /dev/null +++ b/models/issue_post_req.proto @@ -0,0 +1,21 @@ +/* + API for independant issue ticket system + + API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package openapitools; + +import public "models/issue_post_req_message.proto"; + +message IssuePostReq { + + IssuePostReqMessage message = 418054152; + +} diff --git a/models/issue_post_req_message.proto b/models/issue_post_req_message.proto new file mode 100644 index 0000000..139176b --- /dev/null +++ b/models/issue_post_req_message.proto @@ -0,0 +1,44 @@ +/* + API for independant issue ticket system + + API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package openapitools; + +import public "models/issue_message.proto"; +import public "models/order_id.proto"; +import public "models/reason_id.proto"; +import public "models/request_for.proto"; +import public "models/timestamp.proto"; + +message IssuePostReqMessage { + + OrderId orderUnderscoreid = 34578371; + + ReasonId reasonUnderscoreid = 433264200; + + Timestamp timestamp = 55126294; + + IssueMessage issueUnderscoremessage = 509305805; + + RequestFor requestUnderscorefor = 191040131; + + // preference contact detail + enum PreferenceUnderscorecontactEnum { + PreferenceUnderscorecontactEnum_MOBILE = 0; + PreferenceUnderscorecontactEnum_EMAIL = 1; + } + + PreferenceUnderscorecontactEnum preferenceUnderscorecontact = 350228344; + + // callback function url + string callbackUnderscoreurl = 378636241; + +} diff --git a/models/issue_raise_post202_response.proto b/models/issue_raise_post202_response.proto new file mode 100644 index 0000000..579fff8 --- /dev/null +++ b/models/issue_raise_post202_response.proto @@ -0,0 +1,21 @@ +/* + API for independant issue ticket system + + API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package openapitools; + +import public "models/issue_raise_post202_response_message.proto"; + +message IssueRaisePost202Response { + + IssueRaisePost202ResponseMessage message = 418054152; + +} diff --git a/models/issue_raise_post202_response_message.proto b/models/issue_raise_post202_response_message.proto new file mode 100644 index 0000000..4b1c79a --- /dev/null +++ b/models/issue_raise_post202_response_message.proto @@ -0,0 +1,29 @@ +/* + API for independant issue ticket system + + API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package openapitools; + + +message IssueRaisePost202ResponseMessage { + + // response code + string code = 3059181; + + // response status + enum StatusEnum { + StatusEnum_ACK = 0; + StatusEnum_NACK = 1; + } + + StatusEnum status = 355610639; + +} diff --git a/models/issue_track_response.proto b/models/issue_track_response.proto new file mode 100644 index 0000000..a63c9fe --- /dev/null +++ b/models/issue_track_response.proto @@ -0,0 +1,21 @@ +/* + API for independant issue ticket system + + API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package openapitools; + +import public "models/issue_track_response_message_inner.proto"; + +message IssueTrackResponse { + + repeated IssueTrackResponseMessageInner message = 418054152; + +} diff --git a/models/issue_track_response_message_inner.proto b/models/issue_track_response_message_inner.proto new file mode 100644 index 0000000..53ece68 --- /dev/null +++ b/models/issue_track_response_message_inner.proto @@ -0,0 +1,50 @@ +/* + API for independant issue ticket system + + API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package openapitools; + +import public "models/issue_id.proto"; +import public "models/issue_message.proto"; +import public "models/issue_status.proto"; +import public "models/order_id.proto"; +import public "models/person.proto"; +import public "models/reason.proto"; +import public "models/request_for.proto"; +import public "models/timestamp.proto"; + +message IssueTrackResponseMessageInner { + + IssueId issueUnderscoreid = 79087824; + + IssueStatus issueUnderscorestatus = 428440101; + + OrderId orderUnderscoreid = 34578371; + + Timestamp timestamp = 55126294; + + Reason reason = 398093757; + + RequestFor requestUnderscorefor = 191040131; + + // preference contact detail + enum PerferenceUnderscorecontactEnum { + PerferenceUnderscorecontactEnum_MOBILE = 0; + PerferenceUnderscorecontactEnum_EMAIL = 1; + } + + PerferenceUnderscorecontactEnum perferenceUnderscorecontact = 160080134; + + IssueMessage issueUnderscoremessage = 509305805; + + Person assignedUnderscoreto = 429680549; + +} diff --git a/models/order.proto b/models/order.proto new file mode 100644 index 0000000..98cff12 --- /dev/null +++ b/models/order.proto @@ -0,0 +1,41 @@ +/* + API for independant issue ticket system + + API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package openapitools; + + +message Order { + + // Unique identifier for Order schema + string orderUnderscoreid = 34578371; + + // Order state + enum StateEnum { + StateEnum_CREATED = 0; + StateEnum_PACKED = 1; + StateEnum_SHIPPED = 2; + StateEnum_OUT_FOR_DELIVERY = 3; + StateEnum_DELIVERED = 4; + StateEnum_RTO_INITIATED = 5; + StateEnum_RTO_DELIVERED = 6; + StateEnum_CANCELLED = 7; + } + + StateEnum state = 109757585; + + // created at date + string createdUnderscoreat = 450625678; + + // updated at date + string updatedUnderscoreat = 22101193; + +} diff --git a/models/person.proto b/models/person.proto new file mode 100644 index 0000000..bec2277 --- /dev/null +++ b/models/person.proto @@ -0,0 +1,30 @@ +/* + API for independant issue ticket system + + API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package openapitools; + + +message Person { + + // Unique identifier for Person schema + string personUnderscoreid = 397992267; + + // Name of the person + string name = 3373707; + + // Issue assigned to the person + string issueUnderscoreassignedUnderscoreid = 6077241; + + // Timestap for person + string timestamp = 55126294; + +} diff --git a/models/reason.proto b/models/reason.proto new file mode 100644 index 0000000..11bb05a --- /dev/null +++ b/models/reason.proto @@ -0,0 +1,31 @@ +/* + API for independant issue ticket system + + API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package openapitools; + + +message Reason { + + // Unique identifier for reason schema + string reasonUnderscoreid = 433264200; + + // Reason to be specified + enum ReasonEnum { + ReasonEnum_DAMAGED_DURING_SHIPPING = 0; + ReasonEnum_PRODUCT_ARRIVED_TOO_LATE = 1; + ReasonEnum_CUSTOMER_NO_LONGER_NEEDED_THE_PRODUCT = 2; + ReasonEnum_PRODUCT_DID_NOT_MATCH_THE_DESCRIPTION = 3; + } + + ReasonEnum reason = 398093757; + +} diff --git a/models/reason_response.proto b/models/reason_response.proto new file mode 100644 index 0000000..9a2f496 --- /dev/null +++ b/models/reason_response.proto @@ -0,0 +1,21 @@ +/* + API for independant issue ticket system + + API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package openapitools; + +import public "models/reason_response_message_inner.proto"; + +message ReasonResponse { + + repeated ReasonResponseMessageInner message = 418054152; + +} diff --git a/models/reason_response_message_inner.proto b/models/reason_response_message_inner.proto new file mode 100644 index 0000000..8312fba --- /dev/null +++ b/models/reason_response_message_inner.proto @@ -0,0 +1,24 @@ +/* + API for independant issue ticket system + + API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package openapitools; + +import public "models/reason.proto"; +import public "models/reason_id.proto"; + +message ReasonResponseMessageInner { + + ReasonId reasonUnderscoreid = 433264200; + + Reason reason = 398093757; + +} diff --git a/services/issue_service.proto b/services/issue_service.proto new file mode 100644 index 0000000..9670ae9 --- /dev/null +++ b/services/issue_service.proto @@ -0,0 +1,42 @@ +/* + API for independant issue ticket system + + API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package openapitools.services.issueservice; + +import "google/protobuf/empty.proto"; +import public "models/error.proto"; +import public "models/get_all_issue_track_response.proto"; +import public "models/issue_post_req.proto"; +import public "models/issue_raise_post202_response.proto"; +import public "models/issue_track_response.proto"; + +service IssueService { + rpc IssueRaisePost (IssueRaisePostRequest) returns (IssueRaisePost202Response); + + rpc IssueTrackGet (google.protobuf.Empty) returns (GetAllIssueTrackResponse); + + rpc IssueTrackIssueIdGet (IssueTrackIssueIdGetRequest) returns (IssueTrackResponse); + +} + +message IssueRaisePostRequest { + // Buyer raise an issue for a specific order + IssuePostReq issuePostReq = 1; + +} + +message IssueTrackIssueIdGetRequest { + // ID of issue to return + int64 issueId = 1; + +} + diff --git a/services/reason_service.proto b/services/reason_service.proto new file mode 100644 index 0000000..c891ce3 --- /dev/null +++ b/services/reason_service.proto @@ -0,0 +1,23 @@ +/* + API for independant issue ticket system + + API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package openapitools.services.reasonservice; + +import "google/protobuf/empty.proto"; +import public "models/error.proto"; +import public "models/reason_response.proto"; + +service ReasonService { + rpc ReasonGet (google.protobuf.Empty) returns (ReasonResponse); + +} + diff --git a/spec.yaml b/spec.yaml new file mode 100644 index 0000000..914432b --- /dev/null +++ b/spec.yaml @@ -0,0 +1,555 @@ +openapi: 3.0.0 +info: + title: API for independant issue ticket system + description: API flow for raiseing, tracking and getting specific information regaring the issue raised and order related to that issue. + version: 1.0.0 + +paths: + /reason/: + get: + tags: + - Reason + description: Fetch all the reasons. + responses: + '200': + description: Reason list + content: + application/json: + schema: + $ref: '#/components/schemas/ReasonResponse' + '400': + description: Invalid ID supplied + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Issue not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '405': + description: Validation exception + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '502': + description: Bad Gateway + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '504': + description: Gateway Time Out + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - BearerAuth: + - read:issue + /issue/raise: + post: + tags: + - Issue + description: Raise an issue for a particular Order ID + requestBody: + description: Buyer raise an issue for a specific order + content: + application/json: + schema: + $ref: '#/components/schemas/IssuePostReq' + responses: + '202': + description: Acknowledgement of message received + content: + application/json: + schema: + type: object + properties: + message: + type: object + properties: + code: + type: string + example: 7765 + description: response code + status: + type: string + enum: + - ACK + - NACK + example: ACK + description: response status + required: + - code + - status + required: + - message + '400': + description: Invalid Order ID + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Order not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '405': + description: Validation exception + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '502': + description: Bad Gateway + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '504': + description: Gateway Time Out + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + callbacks: + issueraise: + '{$request.body.callback_url}/issue': + post: + summary: 'Issue raised against an order' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IssuePostReq' + responses: + 200: + description: 'Issue successfully raised' + content: + text/plain: + examples: + success: + value: true + security: + - BearerAuth: + - write:issue + - api_key: [] + /issue/track/: + get: + tags: + - Issue + description: Fetch all the issue raised by the user. + responses: + '200': + description: Issue list + content: + application/json: + schema: + $ref: '#/components/schemas/GetAllIssueTrackResponse' + '400': + description: Invalid ID supplied + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Issue not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '405': + description: Validation exception + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '502': + description: Bad Gateway + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '504': + description: Gateway Time Out + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - BearerAuth: + - read:issue + /issue/track/{issue_id}: + get: + tags: + - Issue + description: Get details for the specific raised issue. + parameters: + - name: issue_id + in: path + description: ID of issue to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: Status of the Issue + content: + application/json: + schema: + $ref: '#/components/schemas/IssueTrackResponse' + '400': + description: Invalid ID supplied + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Issue not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '405': + description: Validation exception + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '502': + description: Bad Gateway + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '504': + description: Gateway Time Out + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - BearerAuth: + - read:issue +components: + schemas: + Reason: + description: Describes the reasons of issue + type: object + properties: + reason_id: + type: string + description: Unique identifier for reason schema + example: 101 + reason: + type: string + description: Reason to be specified + enum: + - damaged-during-shipping + - product-arrived-too-late + - customer-no-longer-needed-the-product + - product-did-not-match-the-description + example: damaged-during-shipping + Order: + description: Describes the details of an order + type: object + properties: + order_id: + type: string + description: Unique identifier for Order schema + example: 191 + state: + type: string + enum: + - CREATED + - PACKED + - SHIPPED + - OUT fOR DELIVERY + - DELIVERED + - RTO INITIATED + - RTO DELIVERED + - CANCELLED + description: Order state + example: CREATED + created_at: + type: string + format: date-time + description: created at date + example: '2022-08-30T17:22:38' + updated_at: + type: string + format: date-time + description: updated at date + example: '2022-08-30T17:22:38' + Issue: + type: object + properties: + issue_id: + type: integer + format: int64 + example: 5466654433 + description: unique issue id + timestamp: + type: string + format: date-time + example: '2022-08-30T17:22:38' + description: timestamp for issue + issue_status: + type: string + description: Issue Status + example: ACKNOWLEDGE + enum: + - ACKNOWLEDGE + - FULFILLED + - DECLINED + - IN_PROGRESS + - RETURN_INITIATED + - RETURN_INPROGRESS + - RETURN_COMPLETED + - RETURN_DECLINED + - REFUND_INITIATED + - REFUND_INPROGRESS + - REFUND_COMPLETED + - REFUND_DECLINED + issue_message: + type: string + description: message description the issue + example: 'this item is defecitve' + request_for: + type: string + description: request constants + enum: + - REFUND + - RETURN + example: REFUND + Error: + description: Describes an error object + type: object + properties: + error: + type: object + properties: + type: + type: string + enum: + - CONTEXT_ERROR + - DOMAIN_ERROR + - POLICY_ERROR + - JSON_SCHEMA_ERROR + description: Error type + code: + type: string + description: Describes an error object + example: 8678 + path: + type: string + description: Path to json schema generating the error. Used only during json schema validation errors + message: + type: string + description: Human readable message describing the error + example: Invalid Request + required: + - type + - code + required: + - error + ReasonResponse: + description: Describes the reasons of issue + type: object + properties: + message: + type: array + items: + properties: + reason_id: + $ref: '#/components/schemas/Reason/properties/reason_id' + reason: + $ref: '#/components/schemas/Reason/properties/reason' + required: + - reason_id + - reason + IssuePostReq: + type: object + properties: + message: + type: object + properties: + order_id: + $ref: '#/components/schemas/Order/properties/order_id' + reason_id: + $ref: '#/components/schemas/Reason/properties/reason_id' + timestamp: + $ref: '#/components/schemas/Issue/properties/timestamp' + issue_message: + $ref: '#/components/schemas/Issue/properties/issue_message' + request_for: + $ref: '#/components/schemas/Issue/properties/request_for' + preference_contact: + type: string + example: MOBILE + description: preference contact detail + enum: + - MOBILE + - EMAIL + callback_url: + type: string + format: uri + example: 'https://myserver/track/issue' + description: callback function url + required: + - order_id + - reason_id + - timestamp + - issue_message + - request_for + - callback_url + required: + - message + GetAllIssueTrackResponse: + type: object + properties: + message: + type: array + items: + properties: + issue_id: + $ref: '#/components/schemas/Issue/properties/issue_id' + issue_status: + $ref: '#/components/schemas/Issue/properties/issue_status' + order_id: + $ref: '#/components/schemas/Order/properties/order_id' + timestamp: + $ref: '#/components/schemas/Issue/properties/timestamp' + required: + - issue_status + - issue_id + - order_id + - timestamp + required: + - message + IssueTrackResponse: + type: object + properties: + message: + type: array + items: + properties: + issue_id: + $ref: '#/components/schemas/Issue/properties/issue_id' + issue_status: + $ref: '#/components/schemas/Issue/properties/issue_status' + order_id: + $ref: '#/components/schemas/Order/properties/order_id' + timestamp: + $ref: '#/components/schemas/Issue/properties/timestamp' + reason: + $ref: '#/components/schemas/Reason/properties/reason' + request_for: + $ref: '#/components/schemas/Issue/properties/request_for' + perference_contact: + type: string + enum: + - MOBILE + - EMAIL + example: EMAIL + description: preference contact detail + issue_message: + $ref: '#/components/schemas/Issue/properties/issue_message' + assigned_to: + $ref: '#/components/schemas/Person' + required: + - issue_status + - issue_id + - order_id + - timestamp + - reason + - request_for + - issue_message + - assigned_to + required: + - message + Person: + description: Person schema details + type: object + properties: + person_id: + type: string + description: Unique identifier for Person schema + example: 193 + name: + type: string + description: Name of the person + example: Alan + issue_assigned_id: + type: string + description: Issue assigned to the person + example: 292 + timestamp: + type: string + format: date-time + example: '2022-08-30T17:22:38' + description: Timestap for person + securitySchemes: + BearerAuth: + type: http + scheme: bearer + api_key: + type: apiKey + name: api_key + in: header \ No newline at end of file