syntax = "v1"

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

import "../types.api"

type (
	GetInviteManageListRequest {
		Page      int    `form:"page"`
		Size      int    `form:"size"`
		Search    string `form:"search"`
		InviterId int64  `form:"inviter_id"`
		InviteeId int64  `form:"invitee_id"`
	}
	InviteManageRecord {
		InviterId         int64  `json:"inviter_id"`
		InviterIdentifier string `json:"inviter_identifier"`
		InviterDeviceNo   string `json:"inviter_device_no"`
		InviteeId         int64  `json:"invitee_id"`
		InviteeIdentifier string `json:"invitee_identifier"`
		InviteeDeviceNo   string `json:"invitee_device_no"`
		InviteeAvatar     string `json:"invitee_avatar"`
		InviteeEnable     bool   `json:"invitee_enable"`
		InvitedAt         int64  `json:"invited_at"`
		OrderCount        int64  `json:"order_count"`
		HasPurchased      bool   `json:"has_purchased"`
		InviterCommission int64  `json:"inviter_commission"`
		InviterGiftDays   int64  `json:"inviter_gift_days"`
		InviteeGiftDays   int64  `json:"invitee_gift_days"`
	}
	GetInviteManageListResponse {
		Total int64                `json:"total"`
		List  []InviteManageRecord `json:"list"`
	}
)

@server (
	prefix:     v1/admin/invite
	group:      admin/invite
	middleware: AuthMiddleware
)
service ppanel {
	@doc "Get invite manage list"
	@handler GetInviteManageList
	get /list (GetInviteManageListRequest) returns (GetInviteManageListResponse)
}
