niki/docs/swagger.yaml

871 lines
20 KiB
YAML
Raw Normal View History

2024-05-14 13:07:09 +00:00
definitions:
addressparam.BenefactorAddAddressRequest:
properties:
address:
example: tehran
type: string
benefactor_id:
example: 1
type: integer
city_id:
example: 1
type: integer
lat:
example: 22.23
type: number
lon:
example: 22.22
type: number
postal_code:
example: "1234567890"
type: string
province_id:
example: 1
type: integer
type: object
addressparam.BenefactorAddAddressResponse:
properties:
address:
$ref: '#/definitions/entity.Address'
type: object
addressparam.GetAllCitiesResponse:
properties:
cities:
items:
$ref: '#/definitions/entity.City'
type: array
type: object
addressparam.GetAllProvincesResponse:
properties:
provinces:
items:
$ref: '#/definitions/entity.Province'
type: array
type: object
2024-05-15 07:38:39 +00:00
adminkindboxreqparam.AssignSenderRequest:
properties:
kind_box_req_id:
type: integer
sender_agent_id:
type: integer
type: object
adminkindboxreqparam.DeliverKindBoxReqResponse:
type: object
adminkindboxreqparam.KindBoxReqAcceptRequest:
properties:
count_accepted:
type: integer
id:
type: integer
type: object
adminkindboxreqparam.KindBoxReqAcceptResponse:
properties:
count_accepted:
type: integer
count_requested:
type: integer
deliver_address_id:
type: integer
deliver_refer_date:
type: string
kind_box_req_id:
type: integer
kind_box_req_status:
$ref: '#/definitions/entity.KindBoxReqStatus'
type: object
adminkindboxreqparam.KindBoxReqGetAllResponse:
properties:
allKindBoxReq:
items:
$ref: '#/definitions/entity.KindBoxReq'
type: array
pagination:
$ref: '#/definitions/param.PaginationResponse'
type: object
adminkindboxreqparam.KindBoxReqRejectRequest:
properties:
description:
type: string
id:
type: integer
type: object
adminkindboxreqparam.KindBoxReqRejectResponse:
properties:
benefactor_id:
type: integer
count_requested:
type: integer
deliver_address_id:
type: integer
deliver_refer_date:
type: string
description:
type: string
id:
type: integer
kind_box_type:
$ref: '#/definitions/entity.KindBoxType'
status:
$ref: '#/definitions/entity.KindBoxReqStatus'
type: object
adminserviceparam.LoginWithPhoneNumberRequest:
properties:
password:
type: string
phone_number:
type: string
type: object
adminserviceparam.LoginWithPhoneNumberResponse:
properties:
admin:
$ref: '#/definitions/entity.Admin'
tokens:
$ref: '#/definitions/adminserviceparam.Tokens'
type: object
adminserviceparam.RegisterRequest:
properties:
description:
type: string
email:
type: string
first_name:
type: string
gender:
$ref: '#/definitions/entity.Gender'
last_name:
type: string
password:
type: string
phone_number:
type: string
role:
$ref: '#/definitions/entity.AdminRole'
status:
$ref: '#/definitions/entity.AdminStatus'
type: object
adminserviceparam.RegisterResponse:
properties:
admin:
$ref: '#/definitions/entity.Admin'
type: object
adminserviceparam.Tokens:
properties:
access_token:
type: string
refresh_token:
type: string
type: object
2024-05-14 13:07:09 +00:00
benefactoreparam.BenefactroInfo:
properties:
first_name:
example: mehdi
type: string
id:
example: 1
type: integer
last_name:
example: rez
type: string
role:
example: benefactor
type: string
type: object
benefactoreparam.LoginOrRegisterRequest:
properties:
phone_number:
example: "09198829528"
type: string
verification_code:
example: "123456"
type: string
type: object
benefactoreparam.LoginOrRegisterResponse:
properties:
benefactore_info:
$ref: '#/definitions/benefactoreparam.BenefactroInfo'
tokens:
$ref: '#/definitions/benefactoreparam.Tokens'
type: object
benefactoreparam.SendOtpRequest:
properties:
phone_number:
example: "09198829528"
type: string
type: object
benefactoreparam.SendOtpResponse:
properties:
code:
description: "this just use in test .env\n\t\tTODO - remove it after test"
type: string
phone_number:
example: "09198829528"
type: string
type: object
benefactoreparam.Tokens:
properties:
access_token:
type: string
refresh_token:
type: string
type: object
2024-05-15 07:38:39 +00:00
benefactorkindboxparam.KindBoxGetResponse:
properties:
amount:
type: integer
benefactorID:
type: integer
deliverAddressID:
type: integer
deliverReferDate:
type: string
deliveredAt:
type: string
id:
type: integer
kindBoxReqID:
type: integer
receiverAgentID:
type: integer
returnAddressID:
type: integer
returnReferDate:
type: string
returnedAt:
type: string
senderAgentID:
type: integer
serialNumber:
type: string
status:
$ref: '#/definitions/entity.KindBoxStatus'
type:
$ref: '#/definitions/entity.KindBoxType'
type: object
benefactorkindboxreqparam.KindBoxReqAddRequest:
properties:
benefactor_id:
type: integer
count_requested:
type: integer
deliver_address_id:
type: integer
deliver_refer_date:
type: string
type_id:
$ref: '#/definitions/entity.KindBoxType'
type: object
benefactorkindboxreqparam.KindBoxReqAddResponse:
properties:
kind_box_req:
$ref: '#/definitions/entity.KindBoxReq'
type: object
benefactorkindboxreqparam.KindBoxReqGetResponse:
properties:
benefactorID:
type: integer
countAccepted:
type: integer
countRequested:
type: integer
deliverAddressID:
type: integer
deliverReferDate:
type: string
deliveredAt:
type: string
description:
type: string
id:
type: integer
kindBoxType:
$ref: '#/definitions/entity.KindBoxType'
senderAgentID:
type: integer
status:
$ref: '#/definitions/entity.KindBoxReqStatus'
type: object
2024-05-14 13:07:09 +00:00
entity.Address:
properties:
address:
type: string
benefactorID:
type: integer
cityID:
type: integer
id:
type: integer
isMain:
type: boolean
lat:
type: number
lon:
type: number
postalCode:
type: string
provinceID:
type: integer
type: object
2024-05-15 07:38:39 +00:00
entity.Admin:
properties:
description:
type: string
email:
type: string
firstName:
type: string
gender:
$ref: '#/definitions/entity.Gender'
id:
type: integer
lastName:
type: string
password:
type: string
phoneNumber:
type: string
role:
$ref: '#/definitions/entity.AdminRole'
status:
$ref: '#/definitions/entity.AdminStatus'
type: object
entity.AdminRole:
enum:
- 1
- 2
- 3
type: integer
x-enum-varnames:
- AdminSuperAdminRole
- AdminAdminRole
- AdminAgentRole
entity.AdminStatus:
enum:
- 1
- 2
type: integer
x-enum-varnames:
- AdminActiveStatus
- AdminInactiveStatus
2024-05-14 13:07:09 +00:00
entity.City:
properties:
id:
type: integer
name:
type: string
provinceID:
type: integer
type: object
2024-05-15 07:38:39 +00:00
entity.Gender:
enum:
- 1
- 2
type: integer
x-enum-varnames:
- MaleGender
- FemaleGender
entity.KindBoxReq:
properties:
benefactorID:
type: integer
countAccepted:
type: integer
countRequested:
type: integer
deliverAddressID:
type: integer
deliverReferDate:
type: string
deliveredAt:
type: string
description:
type: string
id:
type: integer
kindBoxType:
$ref: '#/definitions/entity.KindBoxType'
senderAgentID:
type: integer
status:
$ref: '#/definitions/entity.KindBoxReqStatus'
type: object
entity.KindBoxReqStatus:
enum:
- 1
- 2
- 3
- 4
- 5
type: integer
x-enum-varnames:
- KindBoxReqPendingStatus
- KindBoxReqAcceptedStatus
- KindBoxReqAssignedSenderAgentStatus
- KindBoxReqRejectedStatus
- KindBoxReqDeliveredStatus
entity.KindBoxStatus:
enum:
- 1
- 2
- 3
- 4
- 5
type: integer
x-enum-varnames:
- KindBoxDeliveredStatus
- KindBoxReadyToReturnStatus
- KindBoxAssignedReceiverAgentStatus
- KindBoxReturnedStatus
- KindBoxEnumeratedStatus
entity.KindBoxType:
enum:
- 1
- 2
- 3
type: integer
x-enum-varnames:
- KindBoxOnTable
- KindBoxCylindrical
- KindBoxStandUp
2024-05-14 13:07:09 +00:00
entity.Province:
properties:
id:
type: integer
name:
type: string
type: object
2024-05-15 07:38:39 +00:00
param.PaginationResponse:
properties:
pageNumber:
type: integer
pageSize:
type: integer
total:
type: integer
type: object
2024-05-14 13:07:09 +00:00
info:
contact: {}
paths:
/address/:
post:
consumes:
- application/json
parameters:
- description: Add Address benefactor
in: body
name: Request
required: true
schema:
$ref: '#/definitions/addressparam.BenefactorAddAddressRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/addressparam.BenefactorAddAddressResponse'
"400":
description: Bad request
schema:
type: string
security:
2024-05-15 07:38:39 +00:00
- AuthBearerBenefactor: []
2024-05-14 13:07:09 +00:00
summary: Add Address benefactor
tags:
2024-05-15 07:38:39 +00:00
- address
2024-05-14 13:07:09 +00:00
/address/cities:
get:
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/addressparam.GetAllCitiesResponse'
"400":
description: Bad request
schema:
type: string
summary: get all cities
tags:
2024-05-15 07:38:39 +00:00
- address
2024-05-14 13:07:09 +00:00
/address/provinces:
get:
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/addressparam.GetAllProvincesResponse'
"400":
description: Bad request
schema:
type: string
summary: get all provinces
tags:
2024-05-15 07:38:39 +00:00
- address
/admin/kindboxreqs/:
get:
consumes:
- application/json
parameters:
- description: page_number
in: query
name: page_number
type: integer
- description: page_size
in: query
name: page_size
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/adminkindboxreqparam.KindBoxReqGetAllResponse'
"400":
description: Bad request
schema:
type: string
security:
- AuthBearerAdmin: []
summary: admin get All kindboxreq
tags:
- kindboxreq
/admin/kindboxreqs/accept-kind-box-req/{id}:
patch:
consumes:
- application/json
parameters:
- description: Id
in: path
name: id
required: true
type: integer
- description: admin Accept kindboxreq
in: body
name: Request
required: true
schema:
$ref: '#/definitions/adminkindboxreqparam.KindBoxReqAcceptRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/adminkindboxreqparam.KindBoxReqAcceptResponse'
"400":
description: Bad request
schema:
type: string
security:
- AuthBearerAdmin: []
summary: admin Accept kindboxreq
tags:
- kindboxreq
/admin/kindboxreqs/assign-sender-agent/{id}:
patch:
consumes:
- application/json
parameters:
- description: Id
in: path
name: id
required: true
type: integer
- description: admin AssignSenderAgent kindboxreq
in: body
name: Request
required: true
schema:
$ref: '#/definitions/adminkindboxreqparam.AssignSenderRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/adminkindboxreqparam.DeliverKindBoxReqResponse'
"400":
description: Bad request
schema:
type: string
security:
- AuthBearerAdmin: []
summary: admin AssignSenderAgent kindboxreq
tags:
- kindboxreq
/admin/kindboxreqs/deliver-kind-box-req/{id}:
patch:
consumes:
- application/json
parameters:
- description: Id
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/adminkindboxreqparam.DeliverKindBoxReqResponse'
"400":
description: Bad request
schema:
type: string
security:
- AuthBearerAdmin: []
summary: admin Deliver kindboxreq
tags:
- kindboxreq
/admin/kindboxreqs/reject-kind-box-req/{id}:
patch:
consumes:
- application/json
parameters:
- description: Id
in: path
name: id
required: true
type: integer
- description: admin Reject kindboxreq
in: body
name: Request
required: true
schema:
$ref: '#/definitions/adminkindboxreqparam.KindBoxReqRejectRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/adminkindboxreqparam.KindBoxReqRejectResponse'
"400":
description: Bad request
schema:
type: string
security:
- AuthBearerAdmin: []
summary: admin Reject kindboxreq
tags:
- kindboxreq
/admins/login-by-phone:
post:
consumes:
- application/json
parameters:
- description: Login By PhoneNumber admin
in: body
name: Request
required: true
schema:
$ref: '#/definitions/adminserviceparam.LoginWithPhoneNumberRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/adminserviceparam.LoginWithPhoneNumberResponse'
"400":
description: Bad request
schema:
type: string
summary: Login By PhoneNumber admin
tags:
- admin
/admins/register:
post:
consumes:
- application/json
parameters:
- description: super-admin register admin
in: body
name: Request
required: true
schema:
$ref: '#/definitions/adminserviceparam.RegisterRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/adminserviceparam.RegisterResponse'
"400":
description: Bad request
schema:
type: string
summary: super-admin register admin
tags:
- admin
/benefactor/kindboxes/:
get:
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/benefactorkindboxparam.KindBoxGetResponse'
"400":
description: Bad request
schema:
type: string
security:
- AuthBearerBenefactor: []
summary: benefactor get All kindbox
tags:
- kindbox
/benefactor/kindboxes/{id}:
get:
consumes:
- application/json
parameters:
- description: id
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/benefactorkindboxparam.KindBoxGetResponse'
"400":
description: Bad request
schema:
type: string
security:
- AuthBearerBenefactor: []
summary: benefactor get kindbox
tags:
- kindbox
/benefactor/kindboxreqs/:
post:
consumes:
- application/json
parameters:
- description: benefactor Add kindboxreq
in: body
name: Request
required: true
schema:
$ref: '#/definitions/benefactorkindboxreqparam.KindBoxReqAddRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/benefactorkindboxreqparam.KindBoxReqAddResponse'
"400":
description: Bad request
schema:
type: string
security:
- AuthBearerBenefactor: []
summary: benefactor Add kindboxreq
tags:
- kindboxreq
/benefactor/kindboxreqs/{id}:
get:
consumes:
- application/json
parameters:
- description: Id
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/benefactorkindboxreqparam.KindBoxReqGetResponse'
"400":
description: Bad request
schema:
type: string
security:
- AuthBearerBenefactor: []
summary: benefactor get kindboxreq
tags:
- kindboxreq
2024-05-14 13:07:09 +00:00
/benefactor/login-register:
post:
consumes:
- application/json
parameters:
- description: login Or Register benefactor
in: body
name: Request
required: true
schema:
$ref: '#/definitions/benefactoreparam.LoginOrRegisterRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/benefactoreparam.LoginOrRegisterResponse'
"400":
description: Bad request
schema:
type: string
summary: login Or Register benefactor
tags:
- benefactor
/benefactor/send-otp:
post:
consumes:
- application/json
parameters:
- description: send otp benefactor
in: body
name: Request
required: true
schema:
$ref: '#/definitions/benefactoreparam.SendOtpRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/benefactoreparam.SendOtpResponse'
"400":
description: Bad request
schema:
type: string
summary: send otp benefactor
tags:
- benefactor
securityDefinitions:
2024-05-15 07:38:39 +00:00
AuthBearerAdmin:
in: header
name: Authorization admin
type: apiKey
AuthBearerBenefactor:
2024-05-14 13:07:09 +00:00
in: header
2024-05-15 07:38:39 +00:00
name: Authorization Benefactor
2024-05-14 13:07:09 +00:00
type: apiKey
swagger: "2.0"