syntax = "v1"

info (
	title:   "Order API"
	desc:    "API for ppanel"
	author:  "Tension"
	email:   "tension@ppanel.com"
	version: "0.0.1"
)

import "../types.api"

@server (
	prefix:     v1/public/order
	group:      public/order
	middleware: AuthMiddleware,DeviceMiddleware
)
service ppanel {
	@doc "Pre create order"
	@handler PreCreateOrder
	post /pre (PurchaseOrderRequest) returns (PreOrderResponse)

	@doc "purchase Subscription"
	@handler Purchase
	post /purchase (PurchaseOrderRequest) returns (PurchaseOrderResponse)

	@doc "Renewal Subscription"
	@handler Renewal
	post /renewal (RenewalOrderRequest) returns (RenewalOrderResponse)

	@doc "Reset traffic"
	@handler ResetTraffic
	post /reset (ResetTrafficOrderRequest) returns (ResetTrafficOrderResponse)

	@doc "Recharge"
	@handler Recharge
	post /recharge (RechargeOrderRequest) returns (RechargeOrderResponse)

	@doc "Close order"
	@handler CloseOrder
	post /close (CloseOrderRequest)

	@doc "Get order"
	@handler QueryOrderDetail
	get /detail (QueryOrderDetailRequest) returns (OrderDetail)

	@doc "Get order list"
	@handler QueryOrderList
	get /list (QueryOrderListRequest) returns (QueryOrderListResponse)
}

