Add service_kyc
All checks were successful
Client CMS Check Build (NixCN CMS) TeamCity build finished
Backend Check Build (NixCN CMS) TeamCity build finished

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2026-02-01 13:15:17 +08:00
parent a2eb882398
commit 0ac96ab3e6
23 changed files with 1831 additions and 89 deletions

View File

@@ -1144,6 +1144,216 @@ const docTemplate = `{
}
}
},
"/kyc/query": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Checks the current state of a KYC session and updates local database if approved.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"KYC"
],
"summary": "Query KYC Status",
"parameters": [
{
"description": "KYC query data (KycId)",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/service_kyc.KycQueryData"
}
}
],
"responses": {
"200": {
"description": "Query processed (success/pending/failed)",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/service_kyc.KycQueryResponse"
}
}
}
]
}
},
"400": {
"description": "Invalid UUID or input",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"403": {
"description": "Unauthorized",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
}
}
}
},
"/kyc/session": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Initializes a KYC process (CNRid or Passport) and returns the status or redirect URI.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"KYC"
],
"summary": "Create KYC Session",
"parameters": [
{
"description": "KYC session data (Type and Base64 Identity)",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/service_kyc.KycSessionData"
}
}
],
"responses": {
"200": {
"description": "Session created successfully",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/service_kyc.KycSessionResponse"
}
}
}
]
}
},
"400": {
"description": "Invalid input or decode failed",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"403": {
"description": "Missing User ID",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"500": {
"description": "Internal Server Error / KYC Service Error",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
}
}
}
},
"/user/info": {
"get": {
"security": [
@@ -1739,6 +1949,54 @@ const docTemplate = `{
"properties": {
"event_id": {
"type": "string"
},
"kyc_id": {
"type": "string"
}
}
},
"service_kyc.KycQueryData": {
"type": "object",
"properties": {
"kyc_id": {
"type": "string"
}
}
},
"service_kyc.KycQueryResponse": {
"type": "object",
"properties": {
"status": {
"description": "success | pending | failed",
"type": "string"
}
}
},
"service_kyc.KycSessionData": {
"type": "object",
"properties": {
"identity": {
"description": "base64 json",
"type": "string"
},
"type": {
"description": "cnrid | passport",
"type": "string"
}
}
},
"service_kyc.KycSessionResponse": {
"type": "object",
"properties": {
"kyc_id": {
"type": "string"
},
"redirect_uri": {
"type": "string"
},
"status": {
"description": "success | processing",
"type": "string"
}
}
},