Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

Commit

Permalink
Merge pull request #16 from beohoang98/feature/partner_management
Browse files Browse the repository at this point in the history
Feature/partner management
  • Loading branch information
Hoang Dan An authored Jul 27, 2020
2 parents 2bd140d + 085b0ee commit a269a35
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 20 deletions.
18 changes: 9 additions & 9 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
"format": "prettier --write \"src/**/*.{ts,vue,js}\""
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.29",
"@fortawesome/free-solid-svg-icons": "^5.13.1",
"@fortawesome/fontawesome-svg-core": "^1.2.30",
"@fortawesome/free-solid-svg-icons": "^5.14.0",
"@fortawesome/vue-fontawesome": "^0.1.10",
"axios": "^0.19.2",
"core-js": "^3.6.5",
"element-theme-dark": "^1.0.3",
"element-ui": "^2.13.2",
"register-service-worker": "^1.7.1",
"vee-validate": "^3.3.6",
"vee-validate": "^3.3.7",
"vue": "^2.6.11",
"vue-class-component": "^7.2.3",
"vue-class-component": "^7.2.5",
"vue-property-decorator": "^8.5.1",
"vue-recaptcha": "^1.3.0",
"vue-router": "^3.3.4",
Expand All @@ -28,9 +28,9 @@
"vuex-class": "^0.3.2"
},
"devDependencies": {
"@types/jest": "^26.0.3",
"@typescript-eslint/eslint-plugin": "^3.5.0",
"@typescript-eslint/parser": "^3.5.0",
"@types/jest": "^26.0.7",
"@typescript-eslint/eslint-plugin": "^3.7.0",
"@typescript-eslint/parser": "^3.7.0",
"@vue/cli-plugin-babel": "~4.4.6",
"@vue/cli-plugin-eslint": "~4.4.6",
"@vue/cli-plugin-pwa": "~4.4.6",
Expand All @@ -44,7 +44,7 @@
"@vue/test-utils": "^1.0.3",
"babel-plugin-component": "^1.1.1",
"dotenv": "^8.2.0",
"eslint": "^7.3.1",
"eslint": "^7.5.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-vue": "^6.2.2",
Expand All @@ -53,7 +53,7 @@
"node-sass": "^4.14.1",
"prettier": "^2.0.5",
"sass-loader": "^8.0.2",
"typescript": "^3.9.5",
"typescript": "^3.9.7",
"vue-template-compiler": "^2.6.11"
},
"gitHooks": {
Expand Down
18 changes: 9 additions & 9 deletions packages/client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -850,14 +850,14 @@
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.30.tgz#2f1cc5b46bd76723be41d0013a8450c9ba92b777"
integrity sha512-TsRwpTuKwFNiPhk1UfKgw7zNPeV5RhNp2Uw3pws+9gDAkPGKrtjR1y2lI3SYn7+YzyfuNknflpBA1LRKjt7hMg==

"@fortawesome/fontawesome-svg-core@^1.2.29":
"@fortawesome/fontawesome-svg-core@^1.2.30":
version "1.2.30"
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.30.tgz#f56dc6791861fe5d1af04fb8abddb94658c576db"
integrity sha512-E3sAXATKCSVnT17HYmZjjbcmwihrNOCkoU7dVMlasrcwiJAHxSKeZ+4WN5O+ElgO/FaYgJmASl8p9N7/B/RttA==
dependencies:
"@fortawesome/fontawesome-common-types" "^0.2.30"

"@fortawesome/free-solid-svg-icons@^5.13.1":
"@fortawesome/free-solid-svg-icons@^5.14.0":
version "5.14.0"
resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.14.0.tgz#970453f5e8c4915ad57856c3a0252ac63f6fec18"
integrity sha512-M933RDM8cecaKMWDSk3FRYdnzWGW7kBBlGNGfvqLVwcwhUPNj9gcw+xZMrqBdRqxnSXdl3zWzTCNNGEtFUq67Q==
Expand Down Expand Up @@ -1173,7 +1173,7 @@
dependencies:
jest-diff "^24.3.0"

"@types/jest@^26.0.3":
"@types/jest@^26.0.7":
version "26.0.7"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.7.tgz#495cb1d1818c1699dbc3b8b046baf1c86ef5e324"
integrity sha512-+x0077/LoN6MjqBcVOe1y9dpryWnfDZ+Xfo3EqGeBcfPRJlQp3Lw62RvNlWxuGv7kOEwlHriAa54updi3Jvvwg==
Expand Down Expand Up @@ -1255,7 +1255,7 @@
dependencies:
"@types/yargs-parser" "*"

"@typescript-eslint/eslint-plugin@^3.5.0":
"@typescript-eslint/eslint-plugin@^3.7.0":
version "3.7.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.7.0.tgz#0f91aa3c83d019591719e597fbdb73a59595a263"
integrity sha512-4OEcPON3QIx0ntsuiuFP/TkldmBGXf0uKxPQlGtS/W2F3ndYm8Vgdpj/woPJkzUc65gd3iR+qi3K8SDQP/obFg==
Expand All @@ -1278,7 +1278,7 @@
eslint-scope "^5.0.0"
eslint-utils "^2.0.0"

"@typescript-eslint/parser@^3.5.0":
"@typescript-eslint/parser@^3.7.0":
version "3.7.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.7.0.tgz#3e9cd9df9ea644536feb6e5acdb8279ecff96ce9"
integrity sha512-2LZauVUt7jAWkcIW7djUc3kyW+fSarNEuM3RF2JdLHR9BfX/nDEnyA4/uWz0wseoWVZbDXDF7iF9Jc342flNqQ==
Expand Down Expand Up @@ -4299,7 +4299,7 @@ eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e"
integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==

eslint@^7.3.1:
eslint@^7.5.0:
version "7.5.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.5.0.tgz#9ecbfad62216d223b82ac9ffea7ef3444671d135"
integrity sha512-vlUP10xse9sWt9SGRtcr1LAC67BENcQMFeV+w5EvLEoFe3xJ8cF1Skd0msziRx/VMC+72B4DxreCE+OR12OA6Q==
Expand Down Expand Up @@ -10507,7 +10507,7 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=

typescript@^3.9.5:
typescript@^3.9.7:
version "3.9.7"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa"
integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==
Expand Down Expand Up @@ -10722,7 +10722,7 @@ vary@~1.1.2:
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=

vee-validate@^3.3.6:
vee-validate@^3.3.7:
version "3.3.7"
resolved "https://registry.yarnpkg.com/vee-validate/-/vee-validate-3.3.7.tgz#e9c3230cd17caa4a679f56ca8dd6acb1fa46f977"
integrity sha512-s0CfIO8U+YSAzn7q+WnNtPignsndWKQlrbp8qbJ/zCw6QMO/OKDxhFXYRdWeNWRbRktVGCkiIaYktQiY/YL3TQ==
Expand All @@ -10746,7 +10746,7 @@ vm-browserify@^1.0.1:
resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0"
integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==

vue-class-component@^7.1.0, vue-class-component@^7.2.3:
vue-class-component@^7.1.0, vue-class-component@^7.2.5:
version "7.2.5"
resolved "https://registry.yarnpkg.com/vue-class-component/-/vue-class-component-7.2.5.tgz#212b3548c4fdd3314774c4adbc1c3792a40b52d0"
integrity sha512-0CSftHY0bDTD+4FbYkuFf6+iKDjZ4h2in2YYJDRMk5daZIjrgT9LjFHvP7Rzqy9/s1pij3zDtTSLRUjsPWMwqg==
Expand Down
5 changes: 5 additions & 0 deletions packages/server/src/modules/client/client.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
ApiAcceptedResponse,
ApiBadRequestResponse,
ApiBasicAuth,
ApiBody,
ApiCreatedResponse,
ApiForbiddenResponse,
ApiHeader,
Expand Down Expand Up @@ -60,6 +61,9 @@ export class ClientController {
constructor(private readonly clientService: ClientService) {}

@Post("check-account")
@ApiBody({
type: CheckAccountDto,
})
@ApiCreatedResponse({ type: CheckAccountResponseDto })
@TransformClassToPlain({ groups: ["partner"] })
checkAccountInfo(@Body() body: CheckAccountDto) {
Expand All @@ -80,6 +84,7 @@ export class ClientController {
}

@Post("send/v2")
@ApiBody({ type: SendMoneyRequestV2Dto })
@ApiAcceptedResponse({ description: "Accepted send request" })
@UseInterceptors(ClientRequestInterceptor)
@TransformClassToPlain({ groups: ["partner"] })
Expand Down
8 changes: 6 additions & 2 deletions packages/server/src/modules/client/client.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@ export class ClientService {
return this.clientRepository.findOne(args);
}

checkProfile(accountNumber: string) {
return this.userService.findByAccountNumber(accountNumber);
async checkProfile(accountNumber: string) {
const user = await this.userService.findByAccountNumber(accountNumber);
if (!user) {
throw new BadRequestException("User not found");
}
return user;
}

async createTransaction(
Expand Down

1 comment on commit a269a35

@vercel
Copy link

@vercel vercel bot commented on a269a35 Jul 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.