detailed tournament backend stuff

This commit is contained in:
Sendou 2020-03-26 01:59:00 +02:00
parent 56f6db8c04
commit a3a1e66ade
8 changed files with 195 additions and 128 deletions

View File

@ -1202,25 +1202,25 @@
}
},
"@chakra-ui/core": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/@chakra-ui/core/-/core-0.6.1.tgz",
"integrity": "sha512-hZ2wB3u5PS/93s05IJqx1tiyrKC6ARpVFoRnmSo+DP/aacrqQ8+FjW19ZTBpFDp1520g2W0Ow5b69zOIyO7pRg==",
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/@chakra-ui/core/-/core-0.7.0.tgz",
"integrity": "sha512-Ph6y9ds7ejuAom7imEwEEhYqTz3EM23mYuRu5qtZxF6b2tvAVbTZ2CjecaUbwZbCVxxiAVCkC2O+cWokeqBEDA==",
"requires": {
"@reach/auto-id": "0.2.0",
"@styled-system/css": "5.0.13",
"@styled-system/should-forward-prop": "5.0.12",
"@types/styled-system": "5.0.1",
"@reach/auto-id": "0.9.0",
"@styled-system/css": "5.1.5",
"@styled-system/should-forward-prop": "5.1.5",
"@types/styled-system": "5.1.9",
"aria-hidden": "^1.1.1",
"body-scroll-lock": "^2.6.4",
"color": "3.1.2",
"copy-to-clipboard": "3.3.1",
"exenv": "^1.2.2",
"popper.js": "^1.15.0",
"react-animate-height": "2.0.9",
"react-animate-height": "2.0.20",
"react-focus-lock": "^2.2.1",
"react-spring": "^8.0.27",
"styled-system": "5.0.5",
"toasted-notes": "3.0.0",
"styled-system": "5.1.5",
"toasted-notes": "3.2.0",
"use-dark-mode": "2.3.1"
}
},
@ -1606,9 +1606,13 @@
}
},
"@reach/auto-id": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/@reach/auto-id/-/auto-id-0.2.0.tgz",
"integrity": "sha512-lVK/svL2HuQdp7jgvlrLkFsUx50Az9chAhxpiPwBqcS83I2pVWvXp98FOcSCCJCV++l115QmzHhFd+ycw1zLBg=="
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/@reach/auto-id/-/auto-id-0.9.0.tgz",
"integrity": "sha512-9/aXl+dT0pOenvpkB2kkmQnpMDlmSk8ZkBYmYFzFz3eA4PZFNuXcHVzQevFRhc0HVlskPjxwPNf92EkI9rdFOw==",
"requires": {
"@reach/utils": "^0.9.0",
"tslib": "^1.10.0"
}
},
"@reach/component-component": {
"version": "0.1.3",
@ -1626,6 +1630,15 @@
"react-lifecycles-compat": "^3.0.4"
}
},
"@reach/utils": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/@reach/utils/-/utils-0.9.0.tgz",
"integrity": "sha512-cmiykRaxuCysVTsSY3PgrLjySnEIt1PLiSYKh5rAH8nYyEmaOCtw0vaNItFAiqQIjfrxkixmcUE8dyD8kqVuJA==",
"requires": {
"tslib": "^1.10.0",
"warning": "^4.0.3"
}
},
"@reach/visually-hidden": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/@reach/visually-hidden/-/visually-hidden-0.1.4.tgz",
@ -1679,9 +1692,9 @@
}
},
"@styled-system/css": {
"version": "5.0.13",
"resolved": "https://registry.npmjs.org/@styled-system/css/-/css-5.0.13.tgz",
"integrity": "sha512-BN/d/zYw5jpBuhzRVpPLfqsFH6TaTjcROtiJcLzFkhc8RUM+AFp3n3pGTY0yoIqLEhYSU+z5frQ4yi7V5xb7NQ=="
"version": "5.1.5",
"resolved": "https://registry.npmjs.org/@styled-system/css/-/css-5.1.5.tgz",
"integrity": "sha512-XkORZdS5kypzcBotAMPBoeckDs9aSZVkvrAlq5K3xP8IMAUek+x2O4NtwoSgkYkWWzVBu6DGdFZLR790QWGG+A=="
},
"@styled-system/flexbox": {
"version": "5.1.2",
@ -1724,35 +1737,13 @@
}
},
"@styled-system/should-forward-prop": {
"version": "5.0.12",
"resolved": "https://registry.npmjs.org/@styled-system/should-forward-prop/-/should-forward-prop-5.0.12.tgz",
"integrity": "sha512-522JcIdL6cCgyhUjFTj+2/3roNnZiG0u/o4uPbMuQ/G1MjHoWccuayoYXk+sdLc9K4JbJKyVCXJD2oVw0BfxDA==",
"version": "5.1.5",
"resolved": "https://registry.npmjs.org/@styled-system/should-forward-prop/-/should-forward-prop-5.1.5.tgz",
"integrity": "sha512-+rPRomgCGYnUIaFabDoOgpSDc4UUJ1KsmlnzcEp0tu5lFrBQKgZclSo18Z1URhaZm7a6agGtS5Xif7tuC2s52Q==",
"requires": {
"@emotion/is-prop-valid": "^0.8.1",
"@emotion/memoize": "^0.7.1",
"styled-system": "^5.0.12"
},
"dependencies": {
"styled-system": {
"version": "5.1.5",
"resolved": "https://registry.npmjs.org/styled-system/-/styled-system-5.1.5.tgz",
"integrity": "sha512-7VoD0o2R3RKzOzPK0jYrVnS8iJdfkKsQJNiLRDjikOpQVqQHns/DXWaPZOH4tIKkhAT7I6wIsy9FWTWh2X3q+A==",
"requires": {
"@styled-system/background": "^5.1.2",
"@styled-system/border": "^5.1.5",
"@styled-system/color": "^5.1.2",
"@styled-system/core": "^5.1.2",
"@styled-system/flexbox": "^5.1.2",
"@styled-system/grid": "^5.1.2",
"@styled-system/layout": "^5.1.2",
"@styled-system/position": "^5.1.2",
"@styled-system/shadow": "^5.1.2",
"@styled-system/space": "^5.1.2",
"@styled-system/typography": "^5.1.2",
"@styled-system/variant": "^5.1.5",
"object-assign": "^4.1.1"
}
}
"styled-system": "^5.1.5"
}
},
"@styled-system/space": {
@ -1778,13 +1769,6 @@
"requires": {
"@styled-system/core": "^5.1.2",
"@styled-system/css": "^5.1.5"
},
"dependencies": {
"@styled-system/css": {
"version": "5.1.5",
"resolved": "https://registry.npmjs.org/@styled-system/css/-/css-5.1.5.tgz",
"integrity": "sha512-XkORZdS5kypzcBotAMPBoeckDs9aSZVkvrAlq5K3xP8IMAUek+x2O4NtwoSgkYkWWzVBu6DGdFZLR790QWGG+A=="
}
}
},
"@svgr/babel-plugin-add-jsx-attribute": {
@ -2007,34 +1991,33 @@
}
},
"@testing-library/jest-dom": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.1.1.tgz",
"integrity": "sha512-7xnmBFcUmmUVAUhFiZ/u3CxFh1e46THAwra4SiiKNCW4By26RedCRwEk0rtleFPZG0wlTSNOKDvJjWYy93dp0w==",
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.2.0.tgz",
"integrity": "sha512-ugXtbRmH5wJhx9FzkV5X5hw1RDZPEm9LR08eRdLqaGWWmUpu4KdazJdPwGN0C0szNtZUc/ox2RIQUv9QZeTXbg==",
"requires": {
"@babel/runtime": "^7.8.3",
"@types/testing-library__jest-dom": "^5.0.0",
"@babel/runtime": "^7.9.2",
"@types/testing-library__jest-dom": "^5.0.2",
"chalk": "^3.0.0",
"css": "^2.2.4",
"css.escape": "^1.5.1",
"jest-diff": "^25.1.0",
"jest-matcher-utils": "^25.1.0",
"lodash": "^4.17.15",
"pretty-format": "^25.1.0",
"redent": "^3.0.0"
},
"dependencies": {
"@babel/runtime": {
"version": "7.8.4",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.8.4.tgz",
"integrity": "sha512-neAp3zt80trRVBI1x0azq6c57aNBqYZH8KhMm3TaB7wEI5Q4A2SHfBHE8w9gOhI/lrqxtEbXZgQIrHP+wvSGwQ==",
"version": "7.9.2",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.2.tgz",
"integrity": "sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q==",
"requires": {
"regenerator-runtime": "^0.13.2"
"regenerator-runtime": "^0.13.4"
}
},
"@jest/types": {
"version": "25.1.0",
"resolved": "https://registry.npmjs.org/@jest/types/-/types-25.1.0.tgz",
"integrity": "sha512-VpOtt7tCrgvamWZh1reVsGADujKigBUFTi19mlRjqEGsE8qH4r3s+skY33dNdXOwyZIvuftZ5tqdF1IgsMejMA==",
"version": "25.2.0",
"resolved": "https://registry.npmjs.org/@jest/types/-/types-25.2.0.tgz",
"integrity": "sha512-RLWBAON8LEjzD60Cn0XFmvMNTuV+scKlufIUApnG7VF7oA2jCEk5J0uzEchx6xuOwhrHohQM28K4CmEjgtDEwg==",
"requires": {
"@types/istanbul-lib-coverage": "^2.0.0",
"@types/istanbul-reports": "^1.1.1",
@ -2043,9 +2026,9 @@
}
},
"@types/yargs": {
"version": "15.0.3",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.3.tgz",
"integrity": "sha512-XCMQRK6kfpNBixHLyHUsGmXrpEmFFxzMrcnSXFMziHd8CoNJo8l16FkHyQq4x+xbM7E2XL83/O78OD8u+iZTdQ==",
"version": "15.0.4",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.4.tgz",
"integrity": "sha512-9T1auFmbPZoxHz0enUFlUuKRy3it01R+hlggyVUMtnCTQRunsQYifnSGb8hET4Xo8yiC0o0r1paW3ud5+rbURg==",
"requires": {
"@types/yargs-parser": "*"
}
@ -2082,9 +2065,9 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"diff-sequences": {
"version": "25.1.0",
"resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-25.1.0.tgz",
"integrity": "sha512-nFIfVk5B/NStCsJ+zaPO4vYuLjlzQ6uFvPxzYyHlejNZ/UGa7G/n7peOXVrVNvRuyfstt+mZQYGpjxg9Z6N8Kw=="
"version": "25.2.0",
"resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-25.2.0.tgz",
"integrity": "sha512-qTbUrz80F9q6rmEZjUoK2/SQTwgaOvnE5WjKlemKuod1iuB4WlSjY5ft2VUXacsqD9pXrWmERMPLi+j9RldxGg=="
},
"has-flag": {
"version": "4.0.0",
@ -2092,14 +2075,14 @@
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
},
"jest-diff": {
"version": "25.1.0",
"resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-25.1.0.tgz",
"integrity": "sha512-nepXgajT+h017APJTreSieh4zCqnSHEJ1iT8HDlewu630lSJ4Kjjr9KNzm+kzGwwcpsDE6Snx1GJGzzsefaEHw==",
"version": "25.2.0",
"resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-25.2.0.tgz",
"integrity": "sha512-4qNJ9ELNECVeApQ62d8HWGyWzLOXwO81awCoKkHA34Kz8jyP8fQE1lQiZDmLmZRnzoFfIZAAo84u2DlBQ8SrsQ==",
"requires": {
"chalk": "^3.0.0",
"diff-sequences": "^25.1.0",
"diff-sequences": "^25.2.0",
"jest-get-type": "^25.1.0",
"pretty-format": "^25.1.0"
"pretty-format": "^25.2.0"
}
},
"jest-get-type": {
@ -2108,27 +2091,32 @@
"integrity": "sha512-yWkBnT+5tMr8ANB6V+OjmrIJufHtCAqI5ic2H40v+tRqxDmE0PGnIiTyvRWFOMtmVHYpwRqyazDbTnhpjsGvLw=="
},
"jest-matcher-utils": {
"version": "25.1.0",
"resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-25.1.0.tgz",
"integrity": "sha512-KGOAFcSFbclXIFE7bS4C53iYobKI20ZWleAdAFun4W1Wz1Kkej8Ng6RRbhL8leaEvIOjGXhGf/a1JjO8bkxIWQ==",
"version": "25.2.0",
"resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-25.2.0.tgz",
"integrity": "sha512-8E2ggFOJ5h1DPUqAswp78rasfqPap2Iryt06wtwrYXNJrbX0R5pi76eYdduSpPXn1atIbK+uxeJNmqYXLpddog==",
"requires": {
"chalk": "^3.0.0",
"jest-diff": "^25.1.0",
"jest-diff": "^25.2.0",
"jest-get-type": "^25.1.0",
"pretty-format": "^25.1.0"
"pretty-format": "^25.2.0"
}
},
"pretty-format": {
"version": "25.1.0",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-25.1.0.tgz",
"integrity": "sha512-46zLRSGLd02Rp+Lhad9zzuNZ+swunitn8zIpfD2B4OPCRLXbM87RJT2aBLBWYOznNUML/2l/ReMyWNC80PJBUQ==",
"version": "25.2.0",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-25.2.0.tgz",
"integrity": "sha512-BzmuH01b/lm0nl3M7Lcnku9Cv2UNMk9FgIrAiSuIus2QrjzV7Lf2DW+88SgEQUXQNkYWGtBV1289AuF6yMCtCQ==",
"requires": {
"@jest/types": "^25.1.0",
"@jest/types": "^25.2.0",
"ansi-regex": "^5.0.0",
"ansi-styles": "^4.0.0",
"react-is": "^16.12.0"
}
},
"regenerator-runtime": {
"version": "0.13.5",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz",
"integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA=="
},
"supports-color": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
@ -2478,11 +2466,18 @@
"integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw=="
},
"@types/styled-system": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@types/styled-system/-/styled-system-5.0.1.tgz",
"integrity": "sha512-LulwelnGe9yU95yDqB+g9uD0gAn1S3KQyWWKXAOl6uwWtd4lS+q+oGlyHENL+m5zYBNbM5Qi1zoYYLelW29/pg==",
"version": "5.1.9",
"resolved": "https://registry.npmjs.org/@types/styled-system/-/styled-system-5.1.9.tgz",
"integrity": "sha512-QlWv6tmQV8dqk8s+LSLb9QAtmuQEnfv4f8lKKZkMgDqRFVmxJDBwEw0u4zhpxp56u0hdR+TCIk9dGfOw3TkCoQ==",
"requires": {
"csstype": "^2.6.4"
"csstype": "^2.6.9"
},
"dependencies": {
"csstype": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.9.tgz",
"integrity": "sha512-xz39Sb4+OaTsULgUERcCk+TJj8ylkL4aSVDQiX/ksxbELSqwkgt4d4RD7fovIdgJGSuNYqwZEiVjYY5l0ask+Q=="
}
}
},
"@types/testing-library__dom": {
@ -2494,9 +2489,9 @@
}
},
"@types/testing-library__jest-dom": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.0.1.tgz",
"integrity": "sha512-GiPXQBVF9O4DG9cssD2d266vozBJvC5Tnv6aeH5ujgYJgys1DYm9AFCz7YC+STR5ksGxq3zCt+yP8T1wbk2DFg==",
"version": "5.0.2",
"resolved": "https://registry.npmjs.org/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.0.2.tgz",
"integrity": "sha512-dZP+/WHndgCSmdaImITy0KhjGAa9c0hlGGkzefbtrPFpnGEPZECDA0zyvfSp8RKhHECJJSKHFExjOwzo0rHyIA==",
"requires": {
"@types/jest": "*"
}
@ -3902,9 +3897,9 @@
}
},
"body-scroll-lock": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/body-scroll-lock/-/body-scroll-lock-2.6.4.tgz",
"integrity": "sha512-NP08WsovlmxEoZP9pdlqrE+AhNaivlTrz9a0FF37BQsnOrpN48eNqivKkE7SYpM9N+YIPjsdVzfLAUQDBm6OQw=="
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/body-scroll-lock/-/body-scroll-lock-2.7.1.tgz",
"integrity": "sha512-hS53SQ8RhM0e4DsQ3PKz6Gr2O7Kpdh59TWU98GHjaQznL7y4dFycEPk7pFQAikqBaUSCArkc5E3pe7CWIt2fZA=="
},
"bonjour": {
"version": "3.5.0",
@ -12215,9 +12210,9 @@
}
},
"react-animate-height": {
"version": "2.0.9",
"resolved": "https://registry.npmjs.org/react-animate-height/-/react-animate-height-2.0.9.tgz",
"integrity": "sha512-zIM8+TNw17ZgKo2Q5J342epAmZTjeUOZULoqOSIWz2xFn6UbSSTlLahFJS8RPndTjY2/BdBCGzDbi2aWIELtJw==",
"version": "2.0.20",
"resolved": "https://registry.npmjs.org/react-animate-height/-/react-animate-height-2.0.20.tgz",
"integrity": "sha512-gs6j9oSiWNAnquEVpPMdTe/kwsdVORkRYsgPju4VfM1wKwai7pdmwob//1ECmCQTD8S0NfRDDBk0l7MJGFNmbw==",
"requires": {
"classnames": "^2.2.5",
"prop-types": "^15.6.1"
@ -14639,22 +14634,22 @@
}
},
"styled-system": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/styled-system/-/styled-system-5.0.5.tgz",
"integrity": "sha512-ylAQlaknwcjWPLmZeceKKe3Q8EsGZgKtgj7RHiL/ETBq/KzC+mNcpIcoPQwviuOx0O/yjcDwA/JUAVIbEAYArg==",
"version": "5.1.5",
"resolved": "https://registry.npmjs.org/styled-system/-/styled-system-5.1.5.tgz",
"integrity": "sha512-7VoD0o2R3RKzOzPK0jYrVnS8iJdfkKsQJNiLRDjikOpQVqQHns/DXWaPZOH4tIKkhAT7I6wIsy9FWTWh2X3q+A==",
"requires": {
"@styled-system/background": "^5.0.5",
"@styled-system/border": "^5.0.5",
"@styled-system/color": "^5.0.5",
"@styled-system/core": "^5.0.5",
"@styled-system/flexbox": "^5.0.5",
"@styled-system/grid": "^5.0.5",
"@styled-system/layout": "^5.0.5",
"@styled-system/position": "^5.0.5",
"@styled-system/shadow": "^5.0.5",
"@styled-system/space": "^5.0.5",
"@styled-system/typography": "^5.0.5",
"@styled-system/variant": "^5.0.5",
"@styled-system/background": "^5.1.2",
"@styled-system/border": "^5.1.5",
"@styled-system/color": "^5.1.2",
"@styled-system/core": "^5.1.2",
"@styled-system/flexbox": "^5.1.2",
"@styled-system/grid": "^5.1.2",
"@styled-system/layout": "^5.1.2",
"@styled-system/position": "^5.1.2",
"@styled-system/shadow": "^5.1.2",
"@styled-system/space": "^5.1.2",
"@styled-system/typography": "^5.1.2",
"@styled-system/variant": "^5.1.5",
"object-assign": "^4.1.1"
}
},
@ -15031,9 +15026,9 @@
}
},
"toasted-notes": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/toasted-notes/-/toasted-notes-3.0.0.tgz",
"integrity": "sha512-gjL18/1aNP+bgipt1YbCBFeinFYExubltm8HIAJIYmlzDquC+YpajYOfhVysUCnBGwkX0w1V1AF5whpHGqohkQ==",
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/toasted-notes/-/toasted-notes-3.2.0.tgz",
"integrity": "sha512-PucSn+SUdFSYNaaL1eNw7wYkEMJ7LULCR6j1YXPlRySHgWVgf+bXjq4dYd3hdA4mvmGz9HANmI1RnzhZ8av52Q==",
"requires": {
"@reach/alert": "^0.1.2",
"@types/react": "^16.8.10",

View File

@ -4,13 +4,13 @@
"private": true,
"dependencies": {
"@apollo/react-hooks": "^3.1.3",
"@chakra-ui/core": "^0.6.1",
"@chakra-ui/core": "^0.7.0",
"@emotion/core": "^10.0.28",
"@emotion/styled": "^10.0.27",
"@reach/router": "^1.3.3",
"@rehooks/local-storage": "^2.3.0",
"@sendou/react-sketch": "^0.5.2",
"@testing-library/jest-dom": "^5.1.1",
"@testing-library/jest-dom": "^5.2.0",
"@testing-library/react": "^10.0.1",
"@testing-library/user-event": "^10.0.0",
"@types/jest": "^25.1.4",

View File

@ -5,6 +5,8 @@ const {
} = require("apollo-server-express")
const DetailedTournament = require("../mongoose-models/detailedtournament")
const DetailedMatch = require("../mongoose-models/detailedmatch")
const Leaderboard = require("../mongoose-models/leaderboard")
const PlayerStat = require("../mongoose-models/playerstat")
const {
validateDetailedTournamentInput,
validateDetailedMapInput,
@ -26,6 +28,7 @@ const typeDef = gql`
date: String!
top_3_team_names: [String!]!
top_3_discord_ids: [[String!]!]!
participant_discord_ids: [String!]!
}
type DetailedTournament {
@ -34,7 +37,7 @@ const typeDef = gql`
date: String!
top_3_team_names: [String!]!
top_3_discord_ids: [[String!]!]!
participants_discord_ids: [String!]!
participant_discord_ids: [String!]!
type: EventType!
}
@ -108,20 +111,39 @@ const typeDef = gql`
gear: [String!]!
}
type DraftLeaderboard {
players: [DraftPlayer!]!
plus_server: PlusServer!
type Leaderboard {
players: [TournamentPlayer!]!
type: EventType!
}
type DraftPlayer {
type TournamentPlayer {
discord_id: String!
"Number of first places"
first: Int!
"Number of second places"
second: Int!
"Number of third places"
third: Int!
}
type PlayerStat {
discord_id: String!
"Weapon of the stat. ALL if stat is all weapon stats summed up"
weapon: String!
kills: Int!
assists: Int!
deaths: Int!
specials: Int!
paint: Int!
seconds_played: Int!
games_played: Int!
wins: Int!
type: EventType!
}
enum EventType {
PLUSDRAFT
DRAFTONE
DRAFTTWO
}
`
@ -139,17 +161,33 @@ const resolvers = {
match.map_details.map(map => validateDetailedMapInput(map))
)
console.log("tournamentInputProblems", tournamentInputProblems)
console.log("maptInputProblems", maptInputProblems.flat(3))
const problems = [
...tournamentInputProblems,
...maptInputProblems.flat(3),
]
if (problems.length > 0) {
/*if (problems.length > 0) {
throw new UserInputError(problems.join(","))
}
}*/
const eventType = args.plus_server === "TWO" ? "DRAFTTWO" : "DRAFTONE"
/*type DetailedTournament {
name: String!
bracket_url: String!
date: String!
top_3_team_names: [String!]!
top_3_discord_ids: [[String!]!]!
participant_discord_ids: [String!]!
type: EventType!
}*/
const tournament = args.tournament
tournament.type = eventType
//const savedTournament = await DetailedTournament.create(tournament)
console.log("savedTournament", savedTournament._id)
return true
//put tourney in db

View File

@ -35,6 +35,7 @@ const detailedMatchSchema = new mongoose.Schema({
round_number: Number,
round_name: String,
match_details: [Map],
type: String,
})
module.exports = mongoose.model("DetailedMatch", detailedMatchSchema)

View File

@ -4,8 +4,10 @@ const detailedTournamentSchema = new mongoose.Schema({
name: String,
bracket_url: String,
date: Date,
top_3_team_names: [[String]],
top_3_team_names: [String],
top_3_discord_ids: [[String]],
participant_discord_ids: [String],
type: String,
})
module.exports = mongoose.model("DetailedTournament", detailedTournamentSchema)

View File

@ -0,0 +1,15 @@
const mongoose = require("mongoose")
const Player = {
discord_id: String,
first: Number,
second: Number,
third: Number,
}
const leaderboardSchema = new mongoose.Schema({
players: [Player],
type: String,
})
module.exports = mongoose.model("Leaderboard", leaderboardSchema)

View File

@ -0,0 +1,17 @@
const mongoose = require("mongoose")
const playerStatSchema = new mongoose.Schema({
discord_id: String,
weapon: String,
kills: Number,
assists: Number,
deaths: Number,
specials: Number,
paint: Number,
seconds_played: Number,
games_played: Number,
wins: Number,
type: String,
})
module.exports = mongoose.model("PlayerStat", playerStatSchema)

View File

@ -86,7 +86,6 @@ function validateDetailedPlayerInput(input, problems) {
}
if (input.sub_abilities.flat().length !== 9) {
console.log("input.sub", input.sub_abilities)
problems.push(
`Invalid sub abilities length: ${input.sub_abilities.flat().length}`
)