---
# System prepended metadata

title: MANAGE ACCOUNTLIST(AL) - New Marketer UI 3.0

---

# MANAGE ACCOUNTLIST(AL) - New Marketer UI 3.0

### USER LEVEL DIAGRAM
![](https://i.imgur.com/nx1Fhkp.png)




(refer [requirement doc](https://docs.google.com/document/d/1d_Yz_Axvq_gVNQhgO0zFJsVojTX3a3OlWJQjmz_B0s8/edit#heading=h.e1qv64rmcg8u) for details for csv upload & salesforce sync procedure)

### ACCOUNTLIST 

#### MySql Schema 
![](https://i.imgur.com/xdDohqJ.png)


Note: Colored ones are new tables
#### OPERATIONS
*  edit: account description can be edited and more accounts can be added (via csv or salesforce sync)
* delete/flag: AL can be flagged if it is not associated with any active audience. 
3. fetch Accounts: fetch all the accounts related to the given account list.
5. create: create an account list object in the mysql and connect the id with all the accounts related.
### APIs

#### End points for account list
1. Get all the account list of a specific user Id
GET -  /users/{userId}/account-lists
    * path variable: User Id
    * filters      : **AccountListFilter**
    * response     : **AccountListResponse**
2. Create a new account list in RDS
POST -  /users/{userId}/account-lists
    * path variable: User Id
    * request      : **AccountListRequest** 
    * response     : **AccountListResponse**
3. Edit account list ( account desc can be edited)

* 
 ``` java
public class AccountListFilter {

	
	@ApiModelProperty(value = "key for universal search")
	private String searchKey;

	@ApiModelProperty(value = "The page number")
	private int number = 0;

	@ApiModelProperty(value = "The page size")
	private int size = 25;

	@ApiModelProperty(value = "id of parent site url")
	private Integer AccountListId;
	
	public Page getPage() {
		return new Page(number, size);
	}
}
```
* 
``` java
@ApiModel(description = "Details about account List")
public class AccoutListResponse extends ApiResponse<List<AccoutListResponse.AccountListData>> {

	@Getter
	@Setter
	public static class AccountListData {

		@ApiModelProperty(value = "unique id for the account list")
		private Integer id;

		@ApiModelProperty(value = "account list name")
		@NotEmpty
		private String accountName;
		
		@ApiModelProperty(value = "account list description")
		private String accountDesc;
	}

}

```
* 
``` java
public class AccountListRequest extends ApiRequest {

	@ApiModelProperty(value = "unique id for the account list")
	private Integer id;

	@ApiModelProperty(value = "account list name")
	@NotEmpty
	private String accountName;

	@ApiModelProperty(value = "account list description")
	private String accountDesc;
	

	@ApiModelProperty(value = "account list description")
	private boolean isArchive = false;
}

```

#### Enpoints for account 
Note: Editing and data fetching is done to instance account table ( company_account_attributes) and not the master account table

1. Get all the accounts related to a account list
PUT -  /users/{userId}/account
    * path variable: User Id
    * request      : **CompanyAccountAttributeFilter**
    * response     : **CompanyAccountAttributeResponse**
3. Edit account
PUT -  /users/{userId}/manage-accounts
    * path variable: User Id
    * request      : **CompanyAccountAttributeRequest**
    * response     : **CompanyAccountAttributeResponse**



```java 

public class CompanyAccountAttributeResponse
		extends ApiResponse<CompanyAccountAttributeResponse.CompanyAccountAttributeData> {

	public CompanyAccountAttributeResponse() {
		this.data = new CompanyAccountAttributeData();
	}

	@Getter
	@Setter
	@RequiredArgsConstructor
	public static class CompanyAccountAttributeData {

		@ApiModelProperty(value = "number of page libraries returned")
		private int totalCount;

		@ApiModelProperty(value = "Page Library details")
		private List<CompanyAccountAttributeInfo> list;

		@Getter
		@Setter
		@RequiredArgsConstructor
		public static class CompanyAccountAttributeInfo {

			@ApiModelProperty(value = "")
			private Integer companyAccountAttributeId;

			@ApiModelProperty(value = "")
			private Integer companyAccountId;

			@ApiModelProperty(value = "")
			private Integer userId;

			@ApiModelProperty(value = "")
			private String tier;

			@ApiModelProperty(value = "")
			private String salesRegion;

			@ApiModelProperty(value = "")
			private String accountOwner;

			@ApiModelProperty(value = "")
			private String industry;

			@ApiModelProperty(value = "")
			private String companySize;

			@ApiModelProperty(value = "")
			private String revenue;

			@ApiModelProperty(value = "")
			private String externalSystemId;

			@ApiModelProperty(value = "")
			private String externalAccountSource;

			@ApiModelProperty(value = "")
			private String accountStage;

			@ApiModelProperty(value = "")
			private String accountStatusExternal;

			@ApiModelProperty(value = "")
			private Integer accountRank;

			@ApiModelProperty(value = "")
			private String predictiveScore;

			@ApiModelProperty(value = "")
			private String accountSource;

			@ApiModelProperty(value = "")
			private String accountSDR;

			@ApiModelProperty(value = "")
			private String partnerName;

			@ApiModelProperty(value = "")
			private String partnerIPDomain;

			@ApiModelProperty(value = "")
			private String partnerLogoURL;

			@ApiModelProperty(value = "")
			private String kwanzooPartnerLogoURL;
		}
	}
}

```

```java

public class CompanyAccountAttributeRequest extends ApiRequest {

	@ApiModelProperty(value = "")
	private Integer companyAccountAttributeId;

	@ApiModelProperty(value = "")
	private Integer companyAccountId;

	@ApiModelProperty(value = "")
	private Integer userId;

	@ApiModelProperty(value = "")
	private String tier;

	@ApiModelProperty(value = "")
	private String salesRegion;

	@ApiModelProperty(value = "")
	private String accountOwner;

	@ApiModelProperty(value = "")
	private String industry;

	@ApiModelProperty(value = "")
	private String companySize;

	@ApiModelProperty(value = "")
	private String revenue;

	@ApiModelProperty(value = "")
	private String externalSystemId;

	@ApiModelProperty(value = "")
	private String externalAccountSource;

	@ApiModelProperty(value = "")
	private String accountStage;

	@ApiModelProperty(value = "")
	private String accountStatusExternal;

	@ApiModelProperty(value = "")
	private Integer accountRank;

	@ApiModelProperty(value = "")
	private String predictiveScore;

	@ApiModelProperty(value = "")
	private String accountSource;

	@ApiModelProperty(value = "")
	private String accountSDR;

	@ApiModelProperty(value = "")
	private String partnerName;

	@ApiModelProperty(value = "")
	private String partnerIPDomain;

	@ApiModelProperty(value = "")
	private String partnerLogoURL;

	@ApiModelProperty(value = "")
	private String kwanzooPartnerLogoURL;
	
}

```

``` java
public class CompanyAccountAttributeFilter {

	
	@ApiModelProperty(value = "key for universal search")
	private String searchKey;

	@ApiModelProperty(value = "The page number")
	private int number = 0;

	@ApiModelProperty(value = "The page size")
	private int size = 25;

	@ApiModelProperty(value = "id of parent site url")
	private Integer AccountListId;
	
	public Page getPage() {
		return new Page(number, size);
	}
}

```
### REFERENCES
* [requirement doc](https://docs.google.com/document/d/1d_Yz_Axvq_gVNQhgO0zFJsVojTX3a3OlWJQjmz_B0s8/edit#heading=h.e1qv64rmcg8u)
* [KT - Load Sync Process AL](https://drive.google.com/file/d/1asuzlclLTjB_3vxEDcfOn8EelOYjbd7K/view?usp=sharing)
* [Account status](https://drive.google.com/file/d/1kUpAhGgHhYsXpA8uYF5xAKhQqgA8H5qZ/view?usp=sharing)