Feat(ktm-booking): Initial commit
Some checks failed
ktm-booking-bot/ktm-booking-bot/pipeline/head Something is wrong with the build of this commit
Some checks failed
ktm-booking-bot/ktm-booking-bot/pipeline/head Something is wrong with the build of this commit
This commit is contained in:
387
backend/docs/swagger.yaml
Normal file
387
backend/docs/swagger.yaml
Normal file
@@ -0,0 +1,387 @@
|
||||
basePath: /
|
||||
definitions:
|
||||
common.ErrResponse:
|
||||
properties:
|
||||
code:
|
||||
description: application-specific error code
|
||||
type: integer
|
||||
error:
|
||||
description: application-level error message, for debugging
|
||||
type: string
|
||||
status:
|
||||
description: user-level status message
|
||||
type: string
|
||||
type: object
|
||||
common.TextResponse:
|
||||
properties:
|
||||
status:
|
||||
description: user-level status message
|
||||
type: string
|
||||
text:
|
||||
description: application-specific error code
|
||||
type: string
|
||||
type: object
|
||||
ktmtrainbot.BookingCreateRequest:
|
||||
properties:
|
||||
contact:
|
||||
type: string
|
||||
gender:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
passport:
|
||||
type: string
|
||||
passportExpiry:
|
||||
type: string
|
||||
timeCode:
|
||||
type: string
|
||||
travelDate:
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- passport
|
||||
- passportExpiry
|
||||
- travelDate
|
||||
type: object
|
||||
ktmtrainbot.BookingResponse:
|
||||
properties:
|
||||
contact:
|
||||
type: string
|
||||
gender:
|
||||
type: string
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
passport:
|
||||
type: string
|
||||
passportExpiry:
|
||||
type: string
|
||||
status:
|
||||
type: string
|
||||
timeCode:
|
||||
type: string
|
||||
travelDate:
|
||||
type: string
|
||||
type: object
|
||||
ktmtrainbot.ServerTimeResponse:
|
||||
properties:
|
||||
serverLocalTime:
|
||||
type: string
|
||||
type: object
|
||||
user.ProfileRequest:
|
||||
properties:
|
||||
ktmTrainCreditCard:
|
||||
type: string
|
||||
ktmTrainCreditCardCVV:
|
||||
type: string
|
||||
ktmTrainCreditCardExpiry:
|
||||
type: string
|
||||
ktmTrainCreditCardType:
|
||||
type: string
|
||||
ktmTrainPassword:
|
||||
type: string
|
||||
ktmTrainUsername:
|
||||
type: string
|
||||
type: object
|
||||
user.ProfileResponse:
|
||||
properties:
|
||||
ktmTrainCreditCard:
|
||||
type: string
|
||||
ktmTrainCreditCardCVV:
|
||||
type: string
|
||||
ktmTrainCreditCardExpiry:
|
||||
type: string
|
||||
ktmTrainCreditCardType:
|
||||
type: string
|
||||
ktmTrainPassword:
|
||||
type: string
|
||||
ktmTrainUsername:
|
||||
type: string
|
||||
type: object
|
||||
user.UserLoginRequest:
|
||||
properties:
|
||||
password:
|
||||
type: string
|
||||
username:
|
||||
maxLength: 100
|
||||
minLength: 2
|
||||
type: string
|
||||
required:
|
||||
- password
|
||||
- username
|
||||
type: object
|
||||
user.UserRegisterRequest:
|
||||
properties:
|
||||
password:
|
||||
maxLength: 100
|
||||
minLength: 6
|
||||
type: string
|
||||
username:
|
||||
maxLength: 100
|
||||
minLength: 2
|
||||
type: string
|
||||
required:
|
||||
- password
|
||||
- username
|
||||
type: object
|
||||
user.UserResponse:
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
profile:
|
||||
$ref: '#/definitions/user.ProfileResponse'
|
||||
username:
|
||||
type: string
|
||||
type: object
|
||||
info:
|
||||
contact:
|
||||
name: Samuel Pua
|
||||
url: https://git.samuelpua.com/telboon
|
||||
description: API for frontend - built on Go-chi
|
||||
title: KTM Train Booking Bot
|
||||
version: "1.0"
|
||||
paths:
|
||||
/:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Description
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
type: string
|
||||
"404":
|
||||
description: Not Found
|
||||
schema:
|
||||
type: string
|
||||
summary: This is test
|
||||
tags:
|
||||
- Base
|
||||
/api/v1/ktmtrainbot/booking:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Description
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/ktmtrainbot.BookingResponse'
|
||||
type: array
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/common.ErrResponse'
|
||||
summary: Get All Booking
|
||||
tags:
|
||||
- ktmtrainbot Booking
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Description
|
||||
parameters:
|
||||
- description: Booking Create Request
|
||||
in: body
|
||||
name: user
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/ktmtrainbot.BookingCreateRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/ktmtrainbot.BookingResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/common.ErrResponse'
|
||||
summary: Create New Booking
|
||||
tags:
|
||||
- ktmtrainbot Booking
|
||||
/api/v1/ktmtrainbot/booking/{bookingID}:
|
||||
delete:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Description
|
||||
parameters:
|
||||
- description: Booking ID
|
||||
in: path
|
||||
name: bookingID
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/ktmtrainbot.BookingResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/common.ErrResponse'
|
||||
summary: Delete booking
|
||||
tags:
|
||||
- ktmtrainbot Booking
|
||||
/api/v1/ktmtrainbot/current-time:
|
||||
get:
|
||||
description: Description
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/ktmtrainbot.ServerTimeResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/common.ErrResponse'
|
||||
summary: Get current server time
|
||||
tags:
|
||||
- Info
|
||||
/api/v1/user/login:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Description
|
||||
parameters:
|
||||
- description: User Login info
|
||||
in: body
|
||||
name: user
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/user.UserLoginRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/user.UserResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/common.ErrResponse'
|
||||
summary: For user login
|
||||
tags:
|
||||
- User
|
||||
/api/v1/user/logout:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Description
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/common.TextResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/common.ErrResponse'
|
||||
summary: For user logout
|
||||
tags:
|
||||
- User
|
||||
/api/v1/user/me:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Description
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/user.UserResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/common.ErrResponse'
|
||||
summary: Returns current logged in user
|
||||
tags:
|
||||
- User
|
||||
/api/v1/user/profile:
|
||||
put:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Description
|
||||
parameters:
|
||||
- description: User registration info
|
||||
in: body
|
||||
name: user
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/user.ProfileRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/user.UserResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/common.ErrResponse'
|
||||
summary: For setting current user profile
|
||||
tags:
|
||||
- User
|
||||
/api/v1/user/register:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Description
|
||||
parameters:
|
||||
- description: User registration info
|
||||
in: body
|
||||
name: user
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/user.UserRegisterRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/user.UserResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/common.ErrResponse'
|
||||
summary: For user registration
|
||||
tags:
|
||||
- User
|
||||
/health:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Description
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
type: string
|
||||
"404":
|
||||
description: Not Found
|
||||
schema:
|
||||
type: string
|
||||
summary: Responds to health check
|
||||
tags:
|
||||
- Base
|
||||
swagger: "2.0"
|
||||
Reference in New Issue
Block a user