1.5.2 • Published 3 years ago

admin-tags v1.5.2

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

image

Admin tags microservice

Table of contents

Description

This microservice handles the CRUD operations for player tags

Technologies

  • TypeScript- version 3.7.3
  • NestJS- version 6.10.14
  • Mongoose - version 6.1.2
  • gRPC - version 1.24.2

Setup

Install the dependencies

$ npm install

Create a .env file in the root of the project and add the following lines

# DB CONNECTION STRING
DB_HOST = ""

# GRPC SERVICE URL
SERVICE_URL = ""

The values of these variables are in here.

Run the project

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Features

  • CRUD Operations for tags
  • CRUD Operations for tags categories
  • Operations for assign tags to a players

Status

Project is: in progress because we are still developing

Documentation

See documentation on Confluence

Enums

Bulk Request Type

PLAYERS = 1,
USERNAMES = 2,

Bulk Error Code

TAG_ALREADY_ASSIGNED = 10,
TAG_NOT_ASSIGNED = 20,
PLAYERID_NOT_FOUND = 30,
USERNAME_NOT_FOUND = 40,

Event Type

ASSIGNATION = 1,
UNNASIGNATION = 2,

Category Type

CRM = 1,
PLAYERCARD = 2,

Database Migrations

Add the following variable to the environment file:

# SAME STRING CONNECTION FOR DB_HOST
MIGRATE_dbConnectionUri = ""

Current Migrations

NameWhat does it do?
updateCategoriesAdds categoryType field and value to categories
rewardShopCategoryCreates a new category called reward_shop
tags_account_statusesCreates the new functional tags called Withdraw Blocked,Login Blocked,Deposit Blocked and Play Blocked

Execute migrations

  1. Execute the migration command in the project console (See activate migration and rollback migration)
  2. Select the migration (use arrow keys to navigate and press spacebar to select)
  3. Press enter to execute the migration

Execute the migrations in the order that they appear in the section current Migrations

Activate a migration

# Active migration
node_modules/.bin/migrate up <migration name>

Replace <migration name> with the name of the migration you want to execute

Rollback a migration

# Rollback migration
node_modules/.bin/migrate down <migration name>

Replace <migration name> with the name of the migration you want to execute

gRPC Requests

Get Tag Categories by filter

Request

{
  "name": "some name",
  "page": 1,
  "limit": 25,
  "order": "ASC"
}

name property is optional

Response

{
  "docs": [
    {
      "id": "5eb9cdc7a44e321ed7e33141",
      "name": "Like search",
      "createdBy": {
        "userId": "a7652c26-6943-4855-9e46-3851a24825fd",
        "username": "juan.carballo"
      },
      "categoryType": 2,
      "createdAt": "Mon May 11 2020 16:12:23 GMT-0600 (GMT-06:00)",
      "updatedAt": "Mon May 11 2020 16:12:23 GMT-0600 (GMT-06:00)"
    },
    {
      "id": "5eb58deadc4cb132294b0b71",
      "name": "Test",
      "createdBy": {
        "userId": "440c6de5-feca-4818-8f50-74f02d2879f4",
        "username": "fabricio.vargas"
      },
      "categoryType": 2,
      "createdAt": "Fri May 08 2020 10:50:50 GMT-0600 (GMT-06:00)",
      "updatedAt": "Fri May 08 2020 10:50:50 GMT-0600 (GMT-06:00)"
    }
  ],
  "total": 2,
  "limit": 10,
  "page": 1,
  "pages": 1
}

Get a single Tag Category

Request

{
  "id": "de8bf717-994d-432c-8026-57d5db61ebf6"
}

Response

{
  "id": "5eb58deadc4cb132294b0b71",
  "name": "Test",
  "createdBy": {
    "userId": "440c6de5-feca-4818-8f50-74f02d2879f4",
    "username": "fabricio.vargas"
  },
  "categoryType": 2,
  "createdAt": "Fri May 08 2020 10:50:50 GMT-0600 (GMT-06:00)",
  "updatedAt": "Fri May 08 2020 10:50:50 GMT-0600 (GMT-06:00)"
}

Create Tag Category

Request

{
  "name": "New Category",
  "createdBy": {
    "userId": "eee5c814-f55e-4404-86dc-7c7bc426f13d",
    "username": "fabricio.vargas"
  },
  "categoryType": 2
}

All properties are required

Response

{
  "id": "5eb9d2d0efce2a2bf5e58136",
  "name": "New Category",
  "createdBy": {
    "userId": "eee5c814-f55e-4404-86dc-7c7bc426f13d",
    "username": "fabricio.vargas"
  },
  "categoryType": 2,
  "createdAt": "Mon May 11 2020 16:33:52 GMT-0600 (GMT-06:00)",
  "updatedAt": "Mon May 11 2020 16:33:52 GMT-0600 (GMT-06:00)"
}

Update Tag Category

Request

{
  "id": "5eb58deadc4cb132294b0b71",
  "name": "Hello",
  "categoryType": 2
}

Property id is required

Response

{
  "id": "5eb58deadc4cb132294b0b71",
  "name": "Hello",
  "createdBy": {
    "userId": "440c6de5-feca-4818-8f50-74f02d2879f4",
    "username": "fabricio.vargas"
  },
  "categoryType": 2,
  "createdAt": "Fri May 08 2020 10:50:50 GMT-0600 (GMT-06:00)",
  "updatedAt": "Mon May 11 2020 16:34:42 GMT-0600 (GMT-06:00)"
}

Delete Tag Category

Request

{
  "id": "5eb58deadc4cb132294b0b71"
}

Property id is required

Response

{
  "id": "5eb58deadc4cb132294b0b71",
  "name": "Hello",
  "createdBy": {
    "userId": "440c6de5-feca-4818-8f50-74f02d2879f4",
    "username": "fabricio.vargas"
  },
  "categoryType": 2,
  "createdAt": "Fri May 08 2020 10:50:50 GMT-0600 (GMT-06:00)",
  "updatedAt": "Mon May 11 2020 16:34:42 GMT-0600 (GMT-06:00)"
}

Delete operation will always return the deleted element

Get Tags by filter

Request

{
  "name": "Some name",
  "page": 1,
  "limit": 10,
  "order": "ASC"
}

Property name is optional

Response

{
  "docs": [
    {
      "id": "5eb58eb72716906361008fe2",
      "name": "Test-Tag",
      "description": "This is an example of a tag",
      "rules": {
        "title": "",
        "description": ""
      },
      "category": {
        "id": "5eb9cdc7a44e321ed7e33141",
        "name": "Like search",
        "createdBy": {
          "userId": "a7652c26-6943-4855-9e46-3851a24825fd",
          "username": "juan.carballo"
        },
        "createdAt": "Mon May 11 2020 16:12:23 GMT-0600 (GMT-06:00)",
        "updatedAt": "Mon May 11 2020 16:12:23 GMT-0600 (GMT-06:00)"
      },
      "type": "UNKNOWN",
      "createdBy": {
        "userId": "4f3a1e7a-0a1d-4787-8601-14eab26899d3",
        "username": "juan.carballo"
      },
      "createdAt": "Fri May 08 2020 10:54:15 GMT-0600 (GMT-06:00)",
      "updatedAt": "Fri May 08 2020 10:54:15 GMT-0600 (GMT-06:00)"
    }
  ],
  "total": 1,
  "limit": 10,
  "page": 1,
  "pages": 1
}

Get Tags by category

Request

{
  "category": "5f330bc5b2442524661141b8"
}

Response

{
  "tags": [
    {
      "_id": "5f15cfb24c9c5b6f0ed7b73f",
      "name": "test account"
    },
    {
      "_id": "5f3479f26424ec6930197c4b",
      "name": "pc test"
    },
    {
      "_id": "5f4d7047eba7a542fcaa5d35",
      "name": "pc test 2"
    }
  ]
}

Get a single Tag

Request

{
  "id": "5eb58eb72716906361008fe2"
}

Response

{
  "id": "5eb58eb72716906361008fe2",
  "name": "Test-Tag",
  "description": "This is an example of a tag",
  "rules": {
    "title": "",
    "description": ""
  },
  "category": {
    "id": "5eb9cdc7a44e321ed7e33141",
    "name": "Like search",
    "createdBy": {
      "userId": "a7652c26-6943-4855-9e46-3851a24825fd",
      "username": "juan.carballo"
    },
    "createdAt": "Mon May 11 2020 16:12:23 GMT-0600 (GMT-06:00)",
    "updatedAt": "Mon May 11 2020 16:12:23 GMT-0600 (GMT-06:00)"
  },
  "type": "UNKNOWN",
  "createdBy": {
    "userId": "4f3a1e7a-0a1d-4787-8601-14eab26899d3",
    "username": "juan.carballo"
  },
  "createdAt": "Fri May 08 2020 10:54:15 GMT-0600 (GMT-06:00)",
  "updatedAt": "Fri May 08 2020 10:54:15 GMT-0600 (GMT-06:00)"
}

Create Tag

Request

{
  "name": "New Tag",
  "description": "This is a new tag!",
  "category": "5eb9cdc7a44e321ed7e33141",
  "createdBy": {
    "userId": "34543b9f-4853-496e-804b-be7fe91bcdae",
    "username": "fabricio.vargas"
  }
}

All properties are required

Response

{
  "id": "5eb9e62e7780e308e11a283d",
  "name": "Hello4",
  "description": "Hello",
  "rules": {
    "title": "",
    "description": ""
  },
  "category": {
    "id": "5eb9cdc7a44e321ed7e33141",
    "name": "Like search",
    "createdBy": {
      "userId": "a7652c26-6943-4855-9e46-3851a24825fd",
      "username": "juan.carballo"
    },
    "createdAt": "Mon May 11 2020 16:12:23 GMT-0600 (GMT-06:00)",
    "updatedAt": "Mon May 11 2020 16:12:23 GMT-0600 (GMT-06:00)"
  },
  "type": "UNKNOWN",
  "createdBy": {
    "userId": "34543b9f-4853-496e-804b-be7fe91bcdae",
    "username": "fabricio.vargas"
  },
  "createdAt": "Mon May 11 2020 17:56:30 GMT-0600 (GMT-06:00)",
  "updatedAt": "Mon May 11 2020 17:56:30 GMT-0600 (GMT-06:00)"
}

Update a Tag

Request

{
  "id": "5eb58eb72716906361008fe2",
  "name": "Another Name",
  "description": "Another description",
  "category": "5eb9cdc7a44e321ed7e33141",
  "type": 2
}

Property id is required

Response

{
  "id": "5eb58eb72716906361008fe2",
  "name": "Another Name",
  "description": "This is an example of a tag",
  "rules": {
    "title": "",
    "description": ""
  },
  "category": {
    "id": "5eb9cdc7a44e321ed7e33141",
    "name": "Like search",
    "createdBy": {
      "userId": "a7652c26-6943-4855-9e46-3851a24825fd",
      "username": "juan.carballo"
    },
    "createdAt": "Mon May 11 2020 16:12:23 GMT-0600 (GMT-06:00)",
    "updatedAt": "Mon May 11 2020 16:12:23 GMT-0600 (GMT-06:00)"
  },
  "type": "UNKNOWN",
  "createdBy": {
    "userId": "4f3a1e7a-0a1d-4787-8601-14eab26899d3",
    "username": "juan.carballo"
  },
  "createdAt": "Fri May 08 2020 10:54:15 GMT-0600 (GMT-06:00)",
  "updatedAt": "Mon May 11 2020 18:03:08 GMT-0600 (GMT-06:00)"
}

Delete a Tag

Request

{
  "id": "5eb9e62e7780e308e11a283d"
}

The property id is required

Response

{
  "id": "5eb9e62e7780e308e11a283d",
  "name": "Hello4",
  "description": "Hello",
  "rules": {
    "title": "",
    "description": ""
  },
  "category": null,
  "type": "UNKNOWN",
  "createdBy": {
    "userId": "34543b9f-4853-496e-804b-be7fe91bcdae",
    "username": "Hello"
  },
  "createdAt": "Mon May 11 2020 17:56:30 GMT-0600 (GMT-06:00)",
  "updatedAt": "Mon May 11 2020 17:56:30 GMT-0600 (GMT-06:00)"
}

Assign a Tag to Player

Request

{
  "tag": "5eb58eb72716906361008fe2",
  "assignDate": "2020-05-08T16:54:15.475Z",
  "player": "5eb58eb72716906361008fe2",
  "expirationDate": "2020-05-10T15:00:00.475Z",
  "createdBy": {
    "userId": "80f6df1a-a1a5-4b89-95dd-9524eab2ba10",
    "username": "carlos.vanegas"
  }
}

Response

{
  "id": "5eba29a433a388308415eea0",
  "tag": "5eb58eb72716906361008fe2",
  "assignDate": "Fri May 08 2020 10:54:15 GMT-0600 (GMT-06:00)",
  "player": "5eb58eb72716906361008fe2",
  "createdBy": {
    "userId": "80f6df1a-a1a5-4b89-95dd-9524eab2ba10",
    "username": "carlos.vanegas"
  },
  "createdAt": "Mon May 11 2020 22:44:20 GMT-0600 (GMT-06:00)",
  "updatedAt": "Mon May 11 2020 22:44:20 GMT-0600 (GMT-06:00)"
}

Assign a tag to CRM Entity

request

{
  "tag": "5f29c8d726c4a0d87c6d64a4",
  "assignDate": "2020-08-04T20:45:11.953Z",
  "crmEntityName": "deposit-template",
  "crmEntityId": "5f318355d6229edd18f15b85",
  "createdBy": {
    "userId": "4982fdc7-aaac-40e0-8909-e756e29b3650",
    "username": "test.user"
  }
}

response

{
  "_id": "5f3183bda11af26486956cdb",
  "tag": {
    "_id": "5f29cd617865d9f071a6c88e",
    "name": "test tags",
    "category": {
      "_id": "5f29c8d726c4a0d87c6d64a4",
      "name": "templates"
    }
  },
  "assignDate": "Tue Aug 04 2020 14:45:11 GMT-0600 (GMT-06:00)",
  "crmEntityName": "deposit-template",
  "crmEntityId": "5f318355d6229edd18f15b85",
  "createdBy": {
    "userId": "4982fdc7-aaac-40e0-8909-e756e29b3650",
    "username": "test.user"
  },
  "createdAt": "Mon Aug 10 2020 11:28:29 GMT-0600 (GMT-06:00)",
  "updatedAt": "Mon Aug 10 2020 11:28:29 GMT-0600 (GMT-06:00)"
}

Assign multiple Tags to player

request

{
  "tags": ["5ebc5a9b05468fe8f6f3b1a3", "5ebc5ac005468fe8f6f3b1a4"],
  "assignDate": "2020-05-13T21:40:34.812Z",
  "playerId": "579d2410-cc3c-4e75-9ed4-32c9e66c3f77",
  "expirationDate": "2020-05-15T15:00:00.475Z",
  "createdBy": {
    "userId": "fb4694d4-742e-44b8-aa99-2c4b59b934e0",
    "username": "eduardo.guerrero"
  }
}

response

{
  "tags": [
    {
      "id": "5ebc5a9b05468fe8f6f3b1a3",
      "name": "Sample Tag"
    },
    {
      "id": "5ebc5ac005468fe8f6f3b1a4",
      "name": "Sample Tag 2"
    }
  ],
  "playerId": "579d2410-cc3c-4e75-9ed4-32c9e66c3f77",
  "assignDate": "Wed May 13 2020 15:40:34 GMT-0600 (GMT-06:00)",
  "createdBy": {
    "userId": "fb4694d4-742e-44b8-aa99-2c4b59b934e0",
    "username": "eduardo.guerrero"
  }
}

Get Tags assigned to player

Request

{
  "playerId": "5eb58eb72716906361008fe2"
}

Response

{
  "tags": [
    {
      "id": "5eba286ba1183e2c7481840f",
      "tag": {
        "id": "5eb58eb72716906361008fe2",
        "name": "Another Name",
        "category": {
          "_id": "5ebc5a3705468fe8f6f3b1a1",
          "name": "Test Category"
        }
      },
      "assignDate": "Fri May 08 2020 10:54:15 GMT-0600 (GMT-06:00)",
      "playerId": "5eb58eb72716906361008fe2",
      "createdBy": {
        "userId": "80f6df1a-a1a5-4b89-95dd-9524eab2ba10",
        "username": "carlos.vanegas"
      },
      "createdAt": "Mon May 11 2020 22:39:07 GMT-0600 (GMT-06:00)",
      "updatedAt": "Mon May 11 2020 22:39:07 GMT-0600 (GMT-06:00)"
    }
  ]
}

Get Tags assigned to to multiple players

request

{
  "playersId": [
    "581613af-f2a4-4d03-a533-aefb3d3b7ec8",
    "e0ec61ed-8325-4827-9ab4-8d569614c2e5",
    "765d5435-1e1b-4977-aeb8-d4702fe53067"
  ],
  "page": 1,
  "limit": 10,
  "order": "ASC"
}

response

{
  "docs": [
    {
      "tags": [
        {
          "_id": "5f3479f26424ec6930197c4b",
          "name": "pc test",
          "createdBy": {
            "userId": "e2615603-12e7-4baa-99ca-e5b08e520dfd",
            "username": "user.test"
          }
        },
        {
          "_id": "5f4d7047eba7a542fcaa5d35",
          "name": "pc test 2",
          "createdBy": {
            "userId": "e2615603-12e7-4baa-99ca-e5b08e520dfd",
            "username": "user.test"
          }
        }
      ],
      "playerId": "581613af-f2a4-4d03-a533-aefb3d3b7ec8"
    },
    {
      "tags": [
        {
          "_id": "5f3479f26424ec6930197c4b",
          "name": "pc test",
          "createdBy": {
            "userId": "e2615603-12e7-4baa-99ca-e5b08e520dfd",
            "username": "user.test"
          }
        }
      ],
      "playerId": "e0ec61ed-8325-4827-9ab4-8d569614c2e5"
    },
    {
      "tags": [
        {
          "_id": "5f3479f26424ec6930197c4b",
          "name": "pc test",
          "createdBy": {
            "userId": "e2615603-12e7-4baa-99ca-e5b08e520dfd",
            "username": "user.test"
          }
        }
      ],
      "playerId": "765d5435-1e1b-4977-aeb8-d4702fe53067"
    }
  ],
  "total": 3,
  "limit": 10,
  "page": 1,
  "pages": 1
}

Get tags assigned to CRM entity

request

{
  "crmEntityId": "5f318355d6229edd18f15b85",
  "page": 1,
  "limit": 10,
  "order": "ASC"
}

response

{
  "docs": [
    {
      "_id": "5f3183bda11af26486956cdb",
      "tag": {
        "_id": "5f29cd617865d9f071a6c88e",
        "name": "test tags",
        "category": {
          "_id": "5f29c8d726c4a0d87c6d64a4",
          "name": "templates"
        }
      },
      "assignDate": "Tue Aug 04 2020 14:45:11 GMT-0600 (GMT-06:00)",
      "crmEntityName": "deposit-template",
      "crmEntityId": "5f318355d6229edd18f15b85",
      "createdBy": {
        "userId": "4982fdc7-aaac-40e0-8909-e756e29b3650",
        "username": "test.user"
      },
      "createdAt": "Mon Aug 10 2020 11:28:29 GMT-0600 (GMT-06:00)",
      "updatedAt": "Mon Aug 10 2020 11:28:29 GMT-0600 (GMT-06:00)"
    }
  ],
  "total": 1,
  "limit": 10,
  "page": 1,
  "pages": 1
}

Remove tag assigned to player

Request

{
  "playerId": "08afc77f-9515-4517-ab43-0e0a3b307d59",
  "tagId": "5eb58eb72716906361008fe2",
  "createdBy": {
    "userId": "4f2f6a06-8cb7-41d4-b9bb-21a544b4e87e",
    "username": "josue.jenkins"
  }
}

All properties are required

Response

{
  "result": 1
}

If the tag was succesfully removed the result will be 1 if not, and error will be thrown

Remove tag assigned to a CRM entity

Request

{
  "tagId": "5f29cd617865d9f071a6c88e",
  "entityId": "5f2dca91792bc820c695d137",
  "createdBy": {
    "userId": "46f5ff11-ddc1-44f1-b791-d8205e92f47c",
    "username": "user.test"
  }
}

All properties are required

Response

{
  "result": 1
}

Bulk assignment by players

Request

{
  "tagId": "5ebc5a9b05468fe8f6f3b1a3",
  "requests": [
    "61db05ae-ba5e-11ea-b3de-0242ac130004",
    "6f9e1352-ba5e-11ea-b3de-0242ac130004",
    "7eb1f16a-ba5e-11ea-b3de-0242ac130004"
  ],
  "requestType": 1, // Bulk Request Type Enum
  "assignDate": "2020-05-13T20:37:47.927Z",
  "expirationDate": "2020-05-20T15:00:00.475Z",
  "createdBy": {
    "userId": "4f2f6a06-8cb7-41d4-b9bb-21a544b4e87e",
    "username": "josue.jenkins"
  }
}

Response

{
  "tag": {
    "_id": "5ebc5a9b05468fe8f6f3b1a3",
    "name": "",
    "category": {
      "_id": "5ebc5a3705468fe8f6f3b1a1",
      "name": "Test Category"
    }
  },
  "success": [
    "61db05ae-ba5e-11ea-b3de-0242ac130004"
  ],
  "errors": [
    {
      "entity": {
        "name": "player",
        "id": "7eb1f16a-ba5e-11ea-b3de-0242ac130004"
      }
      "message": "Invalid or unknown player",
      "code": 30
    },
    {
      "entity": {
        "name": "player",
        "id": "6f9e1352-ba5e-11ea-b3de-0242ac130004"
      }
      "message": "Already assigned",
      "code": 10
    }
  ],
  "assignDate": "2020-05-13T20:37:47.927Z",
  "createdBy": {
    "userId": "4f2f6a06-8cb7-41d4-b9bb-21a544b4e87e",
    "username": "josue.jenkins"
  }
}

Bulk assignment by usernames

Request

{
  "tagId": "5ebc5a9b05468fe8f6f3b1a3",
  "requests": ["red.tiger", "unknown.username"],
  "requestType": 2, // Bulk request type enum
  "assignDate": "2020-05-13T20:37:47.927Z",
  "expirationDate": "2020-05-20T15:00:00.475Z",
  "createdBy": {
    "userId": "4f2f6a06-8cb7-41d4-b9bb-21a544b4e87e",
    "username": "josue.jenkins"
  }
}

Response

{
  "tag": {
    "_id": "5ebc5a9b05468fe8f6f3b1a3",
    "name": "",
    "category": {
      "_id": "5ebc5a3705468fe8f6f3b1a1",
      "name": "Test Category"
    }
  },
  "success": [
    "red.tiger",
  ],
  "errors": [
    {
      "entity": {
        "name": "username",
        "id": "unknown.username"
      }
      "message": "Invalid or unknown player",
      "code": 30
    },
  ],
  "assignDate": "2020-05-13T20:37:47.927Z",
  "createdBy": {
    "userId": "4f2f6a06-8cb7-41d4-b9bb-21a544b4e87e",
    "username": "josue.jenkins"
  }
}

Bulk unnasignment by players

Request

{
  "tagId": "5ebc5a9b05468fe8f6f3b1a3",
  "requests": ["61db05ae-ba5e-11ea-b3de-0242ac130004", "7eb1f16a-ba5e-11ea-b3de-0242ac130004"],
  "requestType": 1, // Bulk Request Type Enum
  "createdBy": {
    "userId": "4f2f6a06-8cb7-41d4-b9bb-21a544b4e87e",
    "username": "josue.jenkins"
  }
}

Response

{
  "tag": {
    "_id": "5ebc5a9b05468fe8f6f3b1a3",
    "name": "",
    "category": {
      "_id": "5ebc5a3705468fe8f6f3b1a1",
      "name": "Test Category"
    }
  },
  "success": [
    "61db05ae-ba5e-11ea-b3de-0242ac130004"
  ],
  "errors": [
    {
      "entity": {
        "name": "player",
        "id": "7eb1f16a-ba5e-11ea-b3de-0242ac130004"
      }
      "message": "Invalid or unknown player",
      "code": 30
    }
  ],
}

Bulk unnasignment by usernames

Request

{
  "tagId": "5ebc5a9b05468fe8f6f3b1a3",
  "requests": ["red.tiger", "unknown.username"],
  "requestType": 2,
  "createdBy": {
    "userId": "4f2f6a06-8cb7-41d4-b9bb-21a544b4e87e",
    "username": "josue.jenkins"
  } // Bulk request type enum
}

Response

{
  "tag": {
    "_id": "5ebc5a9b05468fe8f6f3b1a3",
    "name": "",
    "category": {
      "_id": "5ebc5a3705468fe8f6f3b1a1",
      "name": "Test Category"
    }
  },
  "success": [
    "red.tiger",
  ],
  "errors": [
    {
      "entity": {
        "name": "username",
        "id": "unknown.username"
      }
      "message": "Invalid or unknown player",
      "code": 30
    },
  ],
}

Get historic by filter

Request

{
  "page": 1,
  "limit": 10,
  "order": "ASC"
}

Response

{
  "docs": [
    {
      "tags": ["test account"],
      "event": 1,
      "eventDate": "Thu Jul 23 2020 11:09:06 GMT-0600 (GMT-06:00)",
      "playerId": "4bf48f52-6b88-4094-9e25-2def7b528a31",
      "createdBy": {
        "userId": "dfb5322f-e88c-4f3c-b98f-dd7ff3f93851",
        "username": "user.test"
      }
    },
    {
      "tags": ["test account"],
      "event": 2,
      "eventDate": "Fri Jul 24 2020 12:33:24 GMT-0600 (GMT-06:00)",
      "playerId": "4bf48f52-6b88-4094-9e25-2def7b528a31",
      "createdBy": {
        "userId": "808de0f1-44de-4f9c-9ce7-7371550df069",
        "username": "user.test"
      }
    }
  ],
  "total": 2,
  "limit": 10,
  "page": 1,
  "pages": 1
}

Get a single historic record

Request

{
  "id": "5f1b296b86678cec57bc3c51"
}

Response

{
  "tags": ["test account"],
  "event": 1,
  "eventDate": "Thu Jul 23 2020 11:09:06 GMT-0600 (GMT-06:00)",
  "playerId": "4bf48f52-6b88-4094-9e25-2def7b528a31",
  "createdBy": {
    "userId": "dfb5322f-e88c-4f3c-b98f-dd7ff3f93851",
    "username": "user.test"
  }
}

Websockets

Get assigned tags

Request

{
  "path":"getTagsAssigned",
  "input":{
     "category": "Test category", // optional
     "playerId": "5eb58eb72716906361008fe2", // optional
     "tag": "5ec5b157ed495c225cf7faa6", // optional
     "page": 1,
     "limit": 10,
     "order": "ASC"
  }
  "meta": any; // Is Optional
}

Response

{
  "path": "getTagsAssigned",
  "input": {
    "message": {
      "docs": [
        {
          "createdBy": {
            "userId": "80f6df1a-a1a5-4b89-95dd-9524eab2ba10",
            "username": "carlos.vanegas"
          },
          "_id": "5f5688a5294e0dd633eabaf1",
          "tag": {
            "_id": "5f56862d294e0dd633eabaef",
            "name": "tag from 7-09",
            "category": {
              "_id": "5ecfee39163635685c45cfab",
              "name": "Test Category"
            }
          },
          "assignDate": "2020-09-07T16:54:15.475Z",
          "playerId": "196a17b5-2159-4f83-b7e7-e4c8300872b4",
          "createdAt": "2020-09-07T19:23:17.258Z",
          "updatedAt": "2020-09-07T19:23:17.258Z",
          "__v": 0
        }
      ],
      "page": 1,
      "limit": 1,
      "total": 1,
      "pages": 1
    },
    "resolved": true
  },
  "meta": "80afd59c-f912-4f61-ae36-d195f6a4b0e" // Is Optional
}

ERROR

{
  "path": "getTagsAssigned",
  "input": {
    "resolved": false,
    "error": {
      "message": [
        {
          "target": {
            "playerId": "196a17b5-2159-4f83-b7e7-e4c8300872b4",
            "page": 1,
            "limit": 1
          },
          "property": "order",
          "children": [],
          "constraints": {
            "isEnum": "The pagination order is invalid",
            "isNotEmpty": "order should not be empty"
          }
        }
      ],
      "status": 400,
      "typeLog": "warn"
    }
  },
  "meta": "80afd59c-f912-4f61-ae36-d195f6a4b0e" // IS OPTIONAL
}

Contact