// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package data;

import java.util.*;

/** A class representing a billing vendor object. */
public class Vendor {
  private String vendorID;
  private String legacyVendorID;
  private int nextGenVendorID;
  private ArrayList<Account> accountList;

  public Vendor() {
    accountList = new ArrayList<Account>();
  }

  public Vendor(String vendorID, String legacyVendorID, int nextGenVendorID) {
    this.vendorID = vendorID;
    this.legacyVendorID = legacyVendorID;
    this.nextGenVendorID = nextGenVendorID;
    accountList = new ArrayList<Account>();
  }

  public String getVendorID() {
    return vendorID; 
  }

  public void setVendorID(String vendorID) {
    this.vendorID = vendorID;
  }

  public String getLegacyVendorID() {
    return legacyVendorID;
  } 

  public void setLegacyVendorID(String legacyVendorID) {
    this.legacyVendorID = legacyVendorID;
  }

  public int getNextGenVendorID() {
    return nextGenVendorID;
  }
 
  public void setNextGenVendorID(int nextGenVendorID) {
    this.nextGenVendorID = nextGenVendorID;
  }

  public void addAccount(Account account) {
    accountList.add(account);
  }

  public ArrayList<Account> getAccounts() {
    return accountList;
  }
}
@@ -596,16 +596,93 @@
  data;%0A%0A
+import servlets.BillingConfig;%0Aimport javax.servlet.http.HttpServletRequest;%0A
 import j
@@ -1208,32 +1208,560 @@
 ccount%3E();%0A  %7D%0A%0A
+  public Vendor(HttpServletRequest request, String vendorID, int numAccounts) %7B%0A    // where does the account ID come from?%0A    this.vendorID = vendorID;%0A    String accountID = %22dummy%22;%0A    this.legacyVendorID = request.getParameter(BillingConfig.LEGACY_CUSTOMER_ID);%0A    this.nextGenVendorID = Integer.parseInt(%0A            request.getParameter(BillingConfig.NEXT_GEN_CUSTOMER_ID));%0A    Account newAccount = new Account(request, accountID, vendorID);%0A    accountList = new ArrayList%3C%3E();%0A    accountList.add(newAccount);%0A%0A  %7D%0A%0A
   public String 

Add vendor constructor that uses HTTP request