Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/dev/2.0' into 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrebenchuk committed Mar 2, 2017
2 parents 02249bd + 5bd9dab commit 0908027
Show file tree
Hide file tree
Showing 75 changed files with 10,196 additions and 639 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ before_script:
- composer require --no-update --dev "phpunit/phpunit:5.7.*"
- composer require --no-update --dev "squizlabs/php_codesniffer:2.7.*"
- composer require --no-update --dev "phpmd/phpmd:2.5.*"
- composer global show fxp/composer-asset-plugin 1.2.2 || composer global require fxp/composer-asset-plugin:1.2.2
- composer global require fxp/composer-asset-plugin
- travis_wait composer update --prefer-dist --optimize-autoloader --no-interaction --no-suggest --prefer-stable
- set +e; DIFF=$(git diff --name-only --diff-filter=ACMR $TRAVIS_COMMIT_RANGE | grep -e ".*\.php$"); set -e;

Expand Down
3 changes: 2 additions & 1 deletion src/Oro/Bundle/AccountBundle/Resources/config/oro/api.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
api:
entities:
Oro\Bundle\AccountBundle\Entity\Account: ~
Oro\Bundle\AccountBundle\Entity\Account:
documentation_resource: '@OroAccountBundle/Resources/doc/api/account.md'
379 changes: 379 additions & 0 deletions src/Oro/Bundle/AccountBundle/Resources/doc/api/account.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,379 @@
# Oro\Bundle\AccountBundle\Entity\Account

## ACTIONS

### get
Retrieve a specific account record.

{@inheritdoc}

### get_list

Retrieve a collection of account records.

{@inheritdoc}

### create

Create a new account record.
The created record is returned in the response.

{@inheritdoc}

{@request:json_api}
Example:

`</api/accounts>`

```JSON
{
"data":{
"type":"accounts",
"attributes":{
"extend_description":null,
"name":"Gartner management group"
},
"relationships":{
"owner":{
"data":{
"type":"users",
"id":"44"
}
},
"contacts":{
"data":[
{
"type":"contacts",
"id":"1"
},
{
"type":"contacts",
"id":"3"
},
{
"type":"contacts",
"id":"22"
}
]
},
"defaultContact":{
"data":{
"type":"contacts",
"id":"1"
}
},
"organization":{
"data":{
"type":"organizations",
"id":"1"
}
}
}
}
}
```
{@/request}

### update

Edit a specific account record.
The updated record is returned in the response.

{@inheritdoc}

{@request:json_api}
Example:

`</api/accounts/51>`

```JSON
{
"data":{
"type":"accounts",
"id":"51",
"attributes":{
"extend_description":null,
"name":"Life Plan Counselling"
},
"relationships":{
"owner":{
"data":{
"type":"users",
"id":"44"
}
},
"contacts":{
"data":[
{
"type":"contacts",
"id":"1"
},
{
"type":"contacts",
"id":"3"
},
{
"type":"contacts",
"id":"22"
}
]
},
"defaultContact":{
"data":{
"type":"contacts",
"id":"1"
}
},
"organization":{
"data":{
"type":"organizations",
"id":"1"
}
}
}
}
}
```
{@/request}

### delete

Delete a specific account record.

{@inheritdoc}

### delete_list

Delete a collection of account records.
The list of records that will be deleted, could be limited by filters.

{@inheritdoc}

## FIELDS

### name

#### create

{@inheritdoc}

**The required field**

#### update

{@inheritdoc}

**Please note:**

*This field is **required** and must remain defined.*

### id

#### update

{@inheritdoc}

**The required field**

## SUBRESOURCES

### contacts

#### get_subresource

Retrieve contact records assigned to a specific account record.

#### get_relationship

Retrieve contact IDs assigned to a specific account record.

#### add_relationship

Set contacts records for a specific account record.

{@request:json_api}
Example:

`</api/accounts/1/relationships/contacts>`

```JSON
{
"data": [
{
"type": "contacts",
"id": "1"
},
{
"type": "contacts",
"id": "3"
},
{
"type": "contacts",
"id": "22"
}
]
}
```
{@/request}

#### update_relationship

Replace the list of contacts assigned to a specific account record.

{@request:json_api}
Example:

`</api/accounts/1/relationships/contacts>`

```JSON
{
"data": [
{
"type": "contacts",
"id": "1"
},
{
"type": "contacts",
"id": "3"
},
{
"type": "contacts",
"id": "22"
}
]
}
```
{@/request}

#### delete_relationship

Remove contact records from a specific account record.

### defaultContact

#### get_subresource

Retrieve the contact record that is default for a specific account record.

#### get_relationship

Retrieve the ID of the default contact assigned to a specific account record.

#### update_relationship

Replace the default contact record assigned to a specific account record.

{@request:json_api}
Example:

`</api/accounts/1/relationships/defaultContact>`

```JSON
{
"data": {
"type": "contacts",
"id": "1"
}
}
```
{@/request}

### organization

#### get_subresource

Retrieve the record of the organization a specific account belongs to.

#### get_relationship

Retrieve the ID of the organization record that a specific account record belongs to.

#### update_relationship

Replace the organization a specific account belongs to.

{@request:json_api}
Example:

`</api/accounts/1/relationships/organization>`

```JSON
{
"data": {
"type": "organizations",
"id": "1"
}
}
```
{@/request}

### owner

#### get_subresource

Retrieve the record of the user who is the owner of a specific lead record.

#### get_relationship

Retrieve the ID of a user who is the owner of a specific account record.

#### update_relationship

Replace the owner of a specific account record.

{@request:json_api}
Example:

`</api/accounts/1/relationships/owner>`

```JSON
{
"data": {
"type": "users",
"id": "44"
}
}
```
{@/request}

### referredBy

#### get_subresource

Retrieve the account records that refer to a specific account record.

**Please note:**

*This parameter is currently unavailable via the OroCRM interface.*

#### get_relationship

Retrieve the IDs of account records that refer to a specific account record.

**Please note:**

*This parameter is currently unavailable via the OroCRM interface.*

#### update_relationship

Replace the account records that refer to a specific account record.

**Please note:**

*This parameter is currently unavailable via the OroCRM interface.*

{@request:json_api}
Example:

`</api/accounts/1/relationships/referredBy>`

```JSON
{
"data": {
"type": "accounts",
"id": "2"
}
}
```
{@/request}

0 comments on commit 0908027

Please sign in to comment.