Skip to content

Commit

Permalink
added many pay bill entites and associations (#380)
Browse files Browse the repository at this point in the history
Co-authored-by: hubda <[email protected]>
  • Loading branch information
hubda and dhuberBH authored May 18, 2022
1 parent a08d408 commit 8933dff
Show file tree
Hide file tree
Showing 30 changed files with 2,439 additions and 200 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.bullhorn</groupId>
<artifactId>sdk-rest</artifactId>
<version>1.4.40</version>
<version>1.4.41</version>
<packaging>jar</packaging>

<name>Bullhorn REST SDK</name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package com.bullhornsdk.data.model.entity.association;

import com.bullhornsdk.data.model.entity.association.paybill.BillingProfileAssociations;
import com.bullhornsdk.data.model.entity.association.paybill.InvoiceTermAssociations;
import com.bullhornsdk.data.model.entity.association.paybill.LocationAssociations;
import com.bullhornsdk.data.model.entity.association.paybill.UnbilledRevenueDistributionAssociations;
import com.bullhornsdk.data.model.entity.association.paybill.*;
import com.bullhornsdk.data.model.entity.association.standard.*;
import com.bullhornsdk.data.model.entity.core.paybill.BillingProfile;
import com.bullhornsdk.data.model.entity.core.paybill.Location;
import com.bullhornsdk.data.model.entity.core.paybill.distribution.UnbilledRevenueDistribution;
import com.bullhornsdk.data.model.entity.core.paybill.invoice.InvoiceTerm;
import com.bullhornsdk.data.model.entity.core.paybill.invoice.*;
import com.bullhornsdk.data.model.entity.core.standard.*;
import com.bullhornsdk.data.model.entity.core.type.AssociationEntity;
import com.bullhornsdk.data.model.entity.core.type.BullhornEntity;
Expand Down Expand Up @@ -40,6 +37,11 @@ public class AssociationFactory {
private static final BillingProfileAssociations billingProfileAssociations = BillingProfileAssociations.getInstance();
private static final LocationAssociations locationAssociations = LocationAssociations.getInstance();
private static final InvoiceTermAssociations invoiceTermAssociations = InvoiceTermAssociations.getInstance();
private static final InvoiceStatementAssociations invoiceStatementAssociations = InvoiceStatementAssociations.getInstance();
private static final InvoiceStatementBatchAssociations invoiceStatementBatchAssociations = InvoiceStatementBatchAssociations.getInstance();
private static final InvoiceStatementDistributionBatchAssociations invoiceStatementDistributionBatchAssociations = InvoiceStatementDistributionBatchAssociations.getInstance();
private static final InvoiceStatementLineItemAssociations invoiceStatementLineItemAssociations = InvoiceStatementLineItemAssociations.getInstance();
private static final InvoiceTermVersionAssociations invoiceTermVersionAssociations = InvoiceTermVersionAssociations.getInstance();
private static final UnbilledRevenueDistributionAssociations unbilledRevenueDistributionAssociations = UnbilledRevenueDistributionAssociations.getInstance();

/**
Expand Down Expand Up @@ -137,6 +139,30 @@ private static <T extends AssociationEntity> EntityAssociations<T> getEntityAsso
return (EntityAssociations<T>) invoiceTermAssociations;
}

if (type == InvoiceTermVersion.class) {
return (EntityAssociations<T>) invoiceTermVersionAssociations;
}

if (type == InvoiceStatement.class) {
return (EntityAssociations<T>) invoiceStatementAssociations;
}

if (type == InvoiceStatementBatch.class) {
return (EntityAssociations<T>) invoiceStatementBatchAssociations;
}

if (type == InvoiceStatementDistributionBatch.class) {
return (EntityAssociations<T>) invoiceStatementDistributionBatchAssociations;
}

if (type == InvoiceStatementLineItem.class) {
return (EntityAssociations<T>) invoiceStatementLineItemAssociations;
}

if (type == InvoiceTermVersion.class) {
return (EntityAssociations<T>) invoiceTermVersionAssociations;
}

if (type == Location.class) {
return (EntityAssociations<T>) locationAssociations;
}
Expand Down Expand Up @@ -316,6 +342,51 @@ public static WorkersCompensationAssociations workersCompensationAssociations()
return workersCompensationAssociations;
}

/**
* Returns the associations for InvoiceTermVersion
*
* @return
*/
public static InvoiceTermVersionAssociations invoiceTermVersionAssociations() {
return invoiceTermVersionAssociations;
}

/**
* Returns the associations for InvoiceStatement
*
* @return
*/
public static InvoiceStatementAssociations invoiceStatementAssociations() {
return invoiceStatementAssociations;
}

/**
* Returns the associations for InvoiceTermVersion
*
* @return
*/
public static InvoiceStatementLineItemAssociations invoiceStatementLineItemAssociations() {
return invoiceStatementLineItemAssociations;
}

/**
* Returns the associations for InvoiceStatementBatch
*
* @return
*/
public static InvoiceStatementBatchAssociations invoiceStatementBatchAssociations() {
return invoiceStatementBatchAssociations;
}

/**
* Returns the associations for InvoiceStatementDistributionBatch
*
* @return
*/
public static InvoiceStatementDistributionBatchAssociations invoiceStatementDistributionBatchAssociations() {
return invoiceStatementDistributionBatchAssociations;
}

/**
* Returns the associations for UnbilledRevenueDistributionAssociations
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
package com.bullhornsdk.data.model.entity.association.paybill;

import com.bullhornsdk.data.model.entity.association.AssociationField;
import com.bullhornsdk.data.model.entity.association.EntityAssociations;
import com.bullhornsdk.data.model.entity.association.standard.StandardAssociationField;
import com.bullhornsdk.data.model.entity.core.paybill.charge.BillableCharge;
import com.bullhornsdk.data.model.entity.core.paybill.invoice.*;
import com.bullhornsdk.data.model.entity.core.paybill.optionslookup.SpecializedOptionsLookup;
import com.bullhornsdk.data.model.entity.core.paybill.transaction.BillMasterTransaction;
import com.bullhornsdk.data.model.entity.core.standard.Candidate;
import com.bullhornsdk.data.model.entity.core.standard.Person;
import com.bullhornsdk.data.model.entity.core.type.BullhornEntity;
import com.bullhornsdk.data.model.entity.file.InvoiceStatementExport;

import java.util.ArrayList;
import java.util.List;

/**
* Created by fayranne.lipton 4/10/2020
*/
public class InvoiceStatementAssociations implements EntityAssociations<InvoiceStatement> {

private final AssociationField<InvoiceStatement, Person> bccRecipients = instantiateAssociationField("bccRecipients", Person.class);
private final AssociationField<InvoiceStatement, BillableCharge> billableCharges = instantiateAssociationField("billableCharges", BillableCharge.class);
private final AssociationField<InvoiceStatement, Candidate> candidates = instantiateAssociationField("candidates", Candidate.class);
private final AssociationField<InvoiceStatement, Person> ccRecipients = instantiateAssociationField("ccRecipients", Person.class);
private final AssociationField<InvoiceStatement, InvoiceStatementDiscount> discounts = instantiateAssociationField("discounts", InvoiceStatementDiscount.class);
private final AssociationField<InvoiceStatement, SpecializedOptionsLookup> fileTypesForInvoicing = instantiateAssociationField("fileTypesForInvoicing", SpecializedOptionsLookup.class);
private final AssociationField<InvoiceStatement, InvoiceStatementExport> invoiceStatementExports = instantiateAssociationField("invoiceStatementExports", InvoiceStatementExport.class);
private final AssociationField<InvoiceStatement, InvoiceStatementExportBatch> invoiceStatementExportsBatches = instantiateAssociationField("invoiceStatementExportsBatches", InvoiceStatementExportBatch.class);
private final AssociationField<InvoiceStatement, InvoiceStatementLineDistribution> invoiceStatementLineDistributions = instantiateAssociationField("invoiceStatementLineDistributions", InvoiceStatementLineDistribution.class);
private final AssociationField<InvoiceStatement, InvoiceStatementLineItem> lineItems = instantiateAssociationField("lineItems", InvoiceStatementLineItem.class);
private final AssociationField<InvoiceStatement, InvoiceStatementSplitBy> splitBys = instantiateAssociationField("splitBys", InvoiceStatementSplitBy.class);
private final AssociationField<InvoiceStatement, InvoiceStatementSurcharge> surcharges = instantiateAssociationField("surcharges", InvoiceStatementSurcharge.class);
private final AssociationField<InvoiceStatement, InvoiceStatementTax> taxes = instantiateAssociationField("taxes", InvoiceStatementTax.class);
private List<AssociationField<InvoiceStatement, ? extends BullhornEntity>> allAssociations;

private static final InvoiceStatementAssociations INSTANCE = new InvoiceStatementAssociations();

private InvoiceStatementAssociations() {
super();
}

public static InvoiceStatementAssociations getInstance() {
return INSTANCE;
}

public AssociationField<InvoiceStatement, Person> bccRecipients() {
return bccRecipients;
}

public AssociationField<InvoiceStatement, BillableCharge> billableCharges() {
return billableCharges;
}

public AssociationField<InvoiceStatement, Candidate> candidates() {
return candidates;
}

public AssociationField<InvoiceStatement, Person> ccRecipients() {
return ccRecipients;
}

public AssociationField<InvoiceStatement, InvoiceStatementDiscount> discounts() {
return discounts;
}

public AssociationField<InvoiceStatement, SpecializedOptionsLookup> fileTypesForInvoicing() {
return fileTypesForInvoicing;
}

public AssociationField<InvoiceStatement, InvoiceStatementExport> invoiceStatementExports() {
return invoiceStatementExports;
}

public AssociationField<InvoiceStatement, InvoiceStatementExportBatch> invoiceStatementExportsBatches() {
return invoiceStatementExportsBatches;
}

public AssociationField<InvoiceStatement, InvoiceStatementLineDistribution> invoiceStatementLineDistributions() {
return invoiceStatementLineDistributions;
}

public AssociationField<InvoiceStatement, InvoiceStatementLineItem> lineItems() {
return lineItems;
}

public AssociationField<InvoiceStatement, InvoiceStatementSplitBy> splitBys() {
return splitBys;
}

public AssociationField<InvoiceStatement, InvoiceStatementSurcharge> surcharges() {
return surcharges;
}

public AssociationField<InvoiceStatement, InvoiceStatementTax> taxes() {
return taxes;
}

private <E extends BullhornEntity> AssociationField<InvoiceStatement, E> instantiateAssociationField(String associationName, Class<E> associationType) {
return new StandardAssociationField<InvoiceStatement, E>(associationName, associationType);
}

@Override
public List<AssociationField<InvoiceStatement, ? extends BullhornEntity>> allAssociations() {
if (allAssociations == null) {
allAssociations = new ArrayList<AssociationField<InvoiceStatement, ? extends BullhornEntity>>();
allAssociations.add(bccRecipients());
allAssociations.add(billableCharges());
allAssociations.add(candidates());
allAssociations.add(ccRecipients());
allAssociations.add(discounts());
allAssociations.add(fileTypesForInvoicing());
allAssociations.add(invoiceStatementExports());
allAssociations.add(invoiceStatementExportsBatches());
allAssociations.add(invoiceStatementLineDistributions());
allAssociations.add(lineItems());
allAssociations.add(splitBys());
allAssociations.add(surcharges());
allAssociations.add(taxes());
}
return allAssociations;
}

@Override
public AssociationField<InvoiceStatement, ? extends BullhornEntity> getAssociation(String associationName) {
for (AssociationField<InvoiceStatement, ? extends BullhornEntity> associationField : allAssociations()) {
if (associationName.equalsIgnoreCase(associationField.getAssociationFieldName())) {
return associationField;
}
}

throw new IllegalArgumentException("There is no association on entity InvoiceStatement called: " + associationName);
}
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package com.bullhornsdk.data.model.entity.association.paybill;

import com.bullhornsdk.data.model.entity.association.AssociationField;
import com.bullhornsdk.data.model.entity.association.EntityAssociations;
import com.bullhornsdk.data.model.entity.association.standard.StandardAssociationField;
import com.bullhornsdk.data.model.entity.core.paybill.charge.BillableCharge;
import com.bullhornsdk.data.model.entity.core.paybill.invoice.*;
import com.bullhornsdk.data.model.entity.core.paybill.transaction.BillMasterTransaction;
import com.bullhornsdk.data.model.entity.core.type.BullhornEntity;

import java.util.ArrayList;
import java.util.List;

/**
* Created by fayranne.lipton 4/10/2020
*/
public class InvoiceStatementBatchAssociations implements EntityAssociations<InvoiceStatementBatch> {

private final AssociationField<InvoiceStatementBatch, BillMasterTransaction> billMasterTransactions = instantiateAssociationField("billMasterTransactions", BillMasterTransaction.class);
private final AssociationField<InvoiceStatementBatch, BillableCharge> billableCharges = instantiateAssociationField("billableCharges", BillableCharge.class);
private List<AssociationField<InvoiceStatementBatch, ? extends BullhornEntity>> allAssociations;

private static final InvoiceStatementBatchAssociations INSTANCE = new InvoiceStatementBatchAssociations();

private InvoiceStatementBatchAssociations() {
super();
}

public static InvoiceStatementBatchAssociations getInstance() {
return INSTANCE;
}

public AssociationField<InvoiceStatementBatch, BillMasterTransaction> billMasterTransactions() {
return billMasterTransactions;
}

public AssociationField<InvoiceStatementBatch, BillableCharge> billableCharges() {
return billableCharges;
}

private <E extends BullhornEntity> AssociationField<InvoiceStatementBatch, E> instantiateAssociationField(String associationName, Class<E> associationType) {
return new StandardAssociationField<InvoiceStatementBatch, E>(associationName, associationType);
}

@Override
public List<AssociationField<InvoiceStatementBatch, ? extends BullhornEntity>> allAssociations() {
if (allAssociations == null) {
allAssociations = new ArrayList<AssociationField<InvoiceStatementBatch, ? extends BullhornEntity>>();
allAssociations.add(billMasterTransactions());
allAssociations.add(billableCharges());
}
return allAssociations;
}

@Override
public AssociationField<InvoiceStatementBatch, ? extends BullhornEntity> getAssociation(String associationName) {
for (AssociationField<InvoiceStatementBatch, ? extends BullhornEntity> associationField : allAssociations()) {
if (associationName.equalsIgnoreCase(associationField.getAssociationFieldName())) {
return associationField;
}
}

throw new IllegalArgumentException("There is no association on entity InvoiceStatementBatch called: " + associationName);
}
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package com.bullhornsdk.data.model.entity.association.paybill;

import com.bullhornsdk.data.model.entity.association.AssociationField;
import com.bullhornsdk.data.model.entity.association.EntityAssociations;
import com.bullhornsdk.data.model.entity.association.standard.StandardAssociationField;
import com.bullhornsdk.data.model.entity.core.paybill.charge.BillableCharge;
import com.bullhornsdk.data.model.entity.core.paybill.invoice.InvoiceStatement;
import com.bullhornsdk.data.model.entity.core.paybill.invoice.InvoiceStatementDistributionBatch;
import com.bullhornsdk.data.model.entity.core.paybill.invoice.InvoiceStatementDistributionBatch;
import com.bullhornsdk.data.model.entity.core.paybill.invoice.InvoiceStatementLineDistribution;
import com.bullhornsdk.data.model.entity.core.paybill.transaction.BillMasterTransaction;
import com.bullhornsdk.data.model.entity.core.type.BullhornEntity;

import java.util.ArrayList;
import java.util.List;

/**
* Created by fayranne.lipton 4/10/2020
*/
public class InvoiceStatementDistributionBatchAssociations implements EntityAssociations<InvoiceStatementDistributionBatch> {

private final AssociationField<InvoiceStatementDistributionBatch, InvoiceStatementLineDistribution> invoiceStatementLineDistributions = instantiateAssociationField("invoiceStatementLineDistributions", InvoiceStatementLineDistribution.class);
private final AssociationField<InvoiceStatementDistributionBatch, InvoiceStatement> invoiceStatements = instantiateAssociationField("invoiceStatements", InvoiceStatement.class);
private List<AssociationField<InvoiceStatementDistributionBatch, ? extends BullhornEntity>> allAssociations;

private static final InvoiceStatementDistributionBatchAssociations INSTANCE = new InvoiceStatementDistributionBatchAssociations();

private InvoiceStatementDistributionBatchAssociations() {
super();
}

public static InvoiceStatementDistributionBatchAssociations getInstance() {
return INSTANCE;
}

public AssociationField<InvoiceStatementDistributionBatch, InvoiceStatementLineDistribution> invoiceStatementLineDistributions() {
return invoiceStatementLineDistributions;
}

public AssociationField<InvoiceStatementDistributionBatch, InvoiceStatement> invoiceStatements() {
return invoiceStatements;
}

private <E extends BullhornEntity> AssociationField<InvoiceStatementDistributionBatch, E> instantiateAssociationField(String associationName, Class<E> associationType) {
return new StandardAssociationField<InvoiceStatementDistributionBatch, E>(associationName, associationType);
}

@Override
public List<AssociationField<InvoiceStatementDistributionBatch, ? extends BullhornEntity>> allAssociations() {
if (allAssociations == null) {
allAssociations = new ArrayList<AssociationField<InvoiceStatementDistributionBatch, ? extends BullhornEntity>>();
allAssociations.add(invoiceStatementLineDistributions());
allAssociations.add(invoiceStatements());
}
return allAssociations;
}

@Override
public AssociationField<InvoiceStatementDistributionBatch, ? extends BullhornEntity> getAssociation(String associationName) {
for (AssociationField<InvoiceStatementDistributionBatch, ? extends BullhornEntity> associationField : allAssociations()) {
if (associationName.equalsIgnoreCase(associationField.getAssociationFieldName())) {
return associationField;
}
}

throw new IllegalArgumentException("There is no association on entity InvoiceStatementDistributionBatch called: " + associationName);
}
}


Loading

0 comments on commit 8933dff

Please sign in to comment.