Skip to content

Commit

Permalink
Add missing customer attributes to sylius_shop_api_me
Browse files Browse the repository at this point in the history
- Added `birthday`, `gender`, `phoneNumber` and `subscribedToNewsletter` to sylius_shop_api_me response
- Updated LoggedInCustomerDetails on doc/swagger.yml, to include the new attributes
- Updated tests
  • Loading branch information
cboita committed Feb 8, 2019
1 parent 50b745a commit 5e1222c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
13 changes: 13 additions & 0 deletions doc/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1547,6 +1547,19 @@ definitions:
email:
type: "string"
example: "sherlock@holmes.com"
birthday:
type: "string"
example: "2017-08-12"
gender:
type: "string"
example: "m"
phoneNumber:
type: "string"
example: "+490000000000"
subscribedToNewsletter:
type: "integer"
example: 0

LoggedInCustomerAddressBook:
type: "array"
items:
Expand Down
4 changes: 4 additions & 0 deletions src/Controller/Customer/LoggedInCustomerDetailsAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ public function __invoke(Request $request): Response
'firstName' => $customer->getFirstName(),
'lastName' => $customer->getLastName(),
'email' => $customer->getEmail(),
'gender' => $customer->getGender(),
'birthday' => $customer->getBirthday(),
'phoneNumber' => $customer->getPhoneNumber(),
'subscribedToNewsletter' => $customer->isSubscribedToNewsletter(),
], Response::HTTP_OK));
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"firstName": "Oliver",
"lastName": "Queen",
"email": "oliver@queen.com"
"email": "oliver@queen.com",
"gender": "m",
"phoneNumber": "0212115512",
"subscribedToNewsletter": false
}

0 comments on commit 5e1222c

Please sign in to comment.