AsyncAPI for campaign service 0.0.1 documentation
- Protobuf File Spec: ecommerce.proto
Published Messages (campaignManagement)
The service publishes one of these messages below.
campaignCreated
Message is sent when campaign is created. Contains fields from event and the following payload.
Example value
{
"payload": {
"campaign": {
"id": "string",
"type": "REDEMPTION",
"namespace": "string",
"name": "string",
"description": "string",
"tags": [
"string"
],
"status": "ACTIVE",
"redeemStart": "2019-08-24T14:15:22Z",
"redeemEnd": "2019-08-24T14:15:22Z",
"maxRedeemCountPerCode": 0,
"maxRedeemCountPerCodePerUser": 0,
"maxRedeemCountPerCampaignPerUser": 0,
"maxSaleCount": 0,
"redeemType": "ITEM",
"items": [
{
"itemId": "string",
"itemName": "string",
"quantity": 0,
"extraSubscriptionDays": 0
}
],
"boothName": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}
payload
Name | Type | Description |
---|---|---|
campaign | campaign | - |
campaignUpdated
Message is sent when campaign is updated. Contains fields from event and the following payload.
Example value
{
"payload": {
"campaign": {
"id": "string",
"type": "REDEMPTION",
"namespace": "string",
"name": "string",
"description": "string",
"tags": [
"string"
],
"status": "ACTIVE",
"redeemStart": "2019-08-24T14:15:22Z",
"redeemEnd": "2019-08-24T14:15:22Z",
"maxRedeemCountPerCode": 0,
"maxRedeemCountPerCodePerUser": 0,
"maxRedeemCountPerCampaignPerUser": 0,
"maxSaleCount": 0,
"redeemType": "ITEM",
"items": [
{
"itemId": "string",
"itemName": "string",
"quantity": 0,
"extraSubscriptionDays": 0
}
],
"boothName": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
},
"oldCampaign": {
"id": "string",
"type": "REDEMPTION",
"namespace": "string",
"name": "string",
"description": "string",
"tags": [
"string"
],
"status": "ACTIVE",
"redeemStart": "2019-08-24T14:15:22Z",
"redeemEnd": "2019-08-24T14:15:22Z",
"maxRedeemCountPerCode": 0,
"maxRedeemCountPerCodePerUser": 0,
"maxRedeemCountPerCampaignPerUser": 0,
"maxSaleCount": 0,
"redeemType": "ITEM",
"items": [
{
"itemId": "string",
"itemName": "string",
"quantity": 0,
"extraSubscriptionDays": 0
}
],
"boothName": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}
payload
Name | Type | Description |
---|---|---|
campaign | campaign | - |
oldCampaign | campaign | - |
codeCreated
Message is when redeem codes are created. Contains fields from event and the following payload.
Example value
{
"payload": {
"codeCreate": {
"campaignId": "string",
"campaignName": "string",
"quantity": 0
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}
payload
Name | Type | Description |
---|---|---|
codeCreate | object | - |
payload.codeCreate
Name | Type | Description |
---|---|---|
campaignId | string | campaign id of the code belong to |
campaignName | string | the campaign name |
quantity | integer | quantity of code created |
codeDisabled
Message is sent when code is disabled. Contains fields from event and the following payload.
Example value
{
"payload": {
"codeCondition": {
"campaignId": "string",
"batchNo": 0,
"value": "string"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}
payload
Name | Type | Description |
---|---|---|
codeCondition | codeCondition | - |
codeEnabled
Message is sent when redeem code is enabled. Contains fields from event and the following payload.
Example value
{
"payload": {
"codeCondition": {
"campaignId": "string",
"batchNo": 0,
"value": "string"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}
payload
Name | Type | Description |
---|---|---|
codeCondition | codeCondition | - |
codeBulkDisabled
Message is sent when bulk codes are disabled. Contains fields from event and the following payload.
Example value
{
"payload": {
"codeCondition": {
"campaignId": "string",
"batchNo": 0,
"value": "string"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}
payload
Name | Type | Description |
---|---|---|
codeCondition | codeCondition | - |
codeBulkEnabled
Message is sent when bulk codes are enabled. Contains fields from event and the following payload.
Example value
{
"payload": {
"codeCondition": {
"campaignId": "string",
"batchNo": 0,
"value": "string"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}
payload
Name | Type | Description |
---|---|---|
codeCondition | codeCondition | - |
Published Messages (keyGroupManagement)
The service publishes one of these messages below.
keyGroupCreated
Message is sent when key group is created. Contains fields from event and the following payload.
Example value
{
"payload": {
"keyGroup": {
"id": "string",
"namespace": "string",
"name": "string",
"description": "string",
"tags": [
"string"
],
"status": "ACTIVE",
"boothName": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}
payload
Name | Type | Description |
---|---|---|
keyGroup | keyGroup | - |
keyGroupUpdated
Message is sent when key group is updated. Contains fields from event and the following payload.
Example value
{
"payload": {
"keyGroup": {
"id": "string",
"namespace": "string",
"name": "string",
"description": "string",
"tags": [
"string"
],
"status": "ACTIVE",
"boothName": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
},
"oldKeyGroup": {
"id": "string",
"namespace": "string",
"name": "string",
"description": "string",
"tags": [
"string"
],
"status": "ACTIVE",
"boothName": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}
payload
Name | Type | Description |
---|---|---|
keyGroup | keyGroup | - |
oldKeyGroup | keyGroup | - |
keyUploaded
Message is sent when upload keys. Contains fields from event and the following payload.
Example value
{
"payload": {
"keyUpload": {
"keyGroupId": "string",
"keyGroupName": "string",
"quantity": 0
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}
payload
Name | Type | Description |
---|---|---|
keyUpload | object | - |
payload.keyUpload
Name | Type | Description |
---|---|---|
keyGroupId | string | key group id |
keyGroupName | string | the key group name |
quantity | integer | quantity of key uploaded |
Published Messages (codeRedemption)
The service publishes one of these messages below.
codeRedeemed
Message is sent when code is redeemed. Contains fields from event and the following payload.
Example value
{
"payload": {
"codeRedemption": {
"userId": "string",
"campaignId": "string",
"campaignName": "string",
"code": "string"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}
payload
Name | Type | Description |
---|---|---|
codeRedemption | object | - |
payload.codeRedemption
Name | Type | Description |
---|---|---|
userId | string | user id |
campaignId | string | the campaign id |
campaignName | string | the campaign name |
code | string | the code value |
Published Messages (ticketSale)
The service publishes one of these messages below.
ticketAcquired
Message is sent when ticket is acquired, for example, when user buy a code type item. Contains fields from event and the following payload.
Example value
{
"payload": {
"ticketAcquisition": {
"userId": "string",
"boothName": "string",
"count": 0,
"orderNo": "string"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}
payload
Name | Type | Description |
---|---|---|
ticketAcquisition | object | - |
payload.ticketAcquisition
Name | Type | Description |
---|---|---|
userId | string | user id |
boothName | string | booth name |
count | integer | purchase count |
orderNo | string | order no |
Schemas
campaign
Name | Type | Description |
---|---|---|
id | string | campaign id |
type | string | campaign type |
namespace | string | namespace of this campaign |
name | string | name of this campaign |
description | string | description of this campaign |
tags | array | tags of this campaign |
status | string | status of this campaign |
redeemStart | string (date-time) | redeem start time |
redeemEnd | string (date-time) | redeem end time |
maxRedeemCountPerCode | integer (int32) | max redeem count per code, -1 means UNLIMITED |
maxRedeemCountPerCodePerUser | integer (int32) | max redeem count per code per user, -1 mean UNLIMITED |
maxRedeemCountPerCampaignPerUser | integer (int32) | max redeem count per campaign per user, -1 mean UNLIMITED |
maxSaleCount | integer (int32) | max sale count, -1 mean UNLIMITED |
redeemType | string | redeem type |
items | array<object> | - |
boothName | string | booth name for sale |
createdAt | string (date-time) | time when campaign is created |
updatedAt | string (date-time) | time when campaign is updated |
items[number]
Name | Type | Description |
---|---|---|
itemId | string | The redeemable item id |
itemName | string | The redeemable item name |
quantity | integer (int32) | The redeemable item quantity, 1 for default |
extraSubscriptionDays | integer (int32) | Extra subscription days if the item is a subscription, 0 by default |
codeCondition
Name | Type | Description |
---|---|---|
campaignId | string | campaign id of the codes belong to |
batchNo | integer | code batch number |
value | string | code value |
keyGroup
Name | Type | Description |
---|---|---|
id | string | key group id |
namespace | string | namespace of this key group |
name | string | name of key group |
description | string | description of key group |
tags | array | tags of key group |
status | string | status of key group |
boothName | string | booth name for sale |
createdAt | string (date-time) | time when key group was created |
updatedAt | string (date-time) | time when key group was updated |
event
Name | Type | Description |
---|---|---|
id | string | event id |
version | integer | - |
name | string | event name |
namespace | string | event namespace |
parentNamespace | string | - |
timestamp | string (date-time) | - |
clientId | string | client id |
userId | string | the operator id |
traceId | string | trace id |
sessionId | string | session id |