Commit 90b89b2a authored by Martin Lowe's avatar Martin Lowe 🇨🇦 Committed by Martin Lowe
Browse files

Add revenue and employee count fields to formorganization

Includes updates to email template, ddl, and bootstrap for creating
dummy data.
parent 168918c2
......@@ -588,6 +588,12 @@ components:
twitter:
type: string
description: The Twitter handle of the organization
aggregate_revenue:
type: string
description: The aggregate revenue of the organization and its affiliates
employee_count:
type: number
description: The number of employees for the given organization
address:
type: object
properties:
......@@ -615,6 +621,12 @@ components:
twitter:
type: string
description: The Twitter handle of the organization
aggregate_revenue:
type: string
description: The aggregate revenue of the organization and its affiliates
employee_count:
type: number
description: The number of employees for the given organization
address:
type: object
properties:
......
......@@ -106,6 +106,8 @@ public class DataLoader {
o.setForm(mf);
o.setLegalName(RandomStringUtils.randomAlphabetic(4, 10));
o.setTwitterHandle(RandomStringUtils.randomAlphabetic(4, 10));
o.setAggregateRevenue(RandomStringUtils.randomNumeric(5, 10));
o.setEmployeeCount(200);
Address a = new Address();
a.setCity(RandomStringUtils.randomAlphabetic(4, 10));
a.setCountry(RandomStringUtils.randomAlphabetic(4, 10));
......
......@@ -50,6 +50,8 @@ public class FormOrganization extends BareNode implements TargetedClone<FormOrga
private String legalName;
@JsonbProperty("twitter")
private String twitterHandle;
private Integer employeeCount;
private String aggregateRevenue;
// form entity
@OneToOne(targetEntity = MembershipForm.class)
......@@ -106,6 +108,34 @@ public class FormOrganization extends BareNode implements TargetedClone<FormOrga
this.twitterHandle = twitterHandle;
}
/**
* @return the employeeCount
*/
public Integer getEmployeeCount() {
return employeeCount;
}
/**
* @param employeeCount the employeeCount to set
*/
public void setEmployeeCount(Integer employeeCount) {
this.employeeCount = employeeCount;
}
/**
* @return the aggregateRevenue
*/
public String getAggregateRevenue() {
return aggregateRevenue;
}
/**
* @param aggregateRevenue the aggregateRevenue to set
*/
public void setAggregateRevenue(String aggregateRevenue) {
this.aggregateRevenue = aggregateRevenue;
}
/** @return the address */
public Address getAddress() {
return address;
......@@ -120,6 +150,8 @@ public class FormOrganization extends BareNode implements TargetedClone<FormOrga
public FormOrganization cloneTo(FormOrganization target) {
target.setLegalName(getLegalName());
target.setTwitterHandle(getTwitterHandle());
target.setAggregateRevenue(getAggregateRevenue());
target.setEmployeeCount(getEmployeeCount());
return target;
}
......@@ -140,9 +172,11 @@ public class FormOrganization extends BareNode implements TargetedClone<FormOrga
if (getClass() != obj.getClass())
return false;
FormOrganization other = (FormOrganization) obj;
return Objects.equals(address, other.address)
&& Objects.equals(form, other.form) && Objects.equals(id, other.id)
&& Objects.equals(legalName, other.legalName) && Objects.equals(twitterHandle, other.twitterHandle);
return Objects.equals(address, other.address) && Objects.equals(form, other.form)
&& Objects.equals(id, other.id) && Objects.equals(legalName, other.legalName)
&& Objects.equals(twitterHandle, other.twitterHandle)
&& Objects.equals(aggregateRevenue, other.aggregateRevenue)
&& Objects.equals(employeeCount, other.employeeCount);
}
@Override
......@@ -154,6 +188,10 @@ public class FormOrganization extends BareNode implements TargetedClone<FormOrga
builder.append(legalName);
builder.append(", twitterHandle=");
builder.append(twitterHandle);
builder.append(", aggregateRevenue=");
builder.append(aggregateRevenue);
builder.append(", employeeCount=");
builder.append(employeeCount);
builder.append(", form=");
builder.append(form);
builder.append(", address=");
......
......@@ -29,6 +29,8 @@ CREATE TABLE `FormOrganization` (
`id` varchar(255) NOT NULL,
`legalName` varchar(255) DEFAULT NULL,
`twitterHandle` varchar(255) DEFAULT NULL,
`aggregateRevenue` varchar(255) DEFAULT NULL,
`employeeCount` int(10) unsigned DEFAULT NULL,
`form_id` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UK_27vg3uhbmy3ev7ote4fjd4evl` (`form_id`),
......
......@@ -3,6 +3,8 @@ New form submission by: {name} ({form.userID})
Organization
Name: {org.legalName}
Twitter: {org.twitterHandle}
Aggregate Revenue: {org.aggregateRevenue}
Employee count: {org.employeeCount}
Address
{org.address.street}
......
......@@ -4,6 +4,8 @@
<h1>New form submission by: {name} ({form.userID})</h1>
<h2>Organization</h2>
<p style="margin-bottom: 0px">Name: {org.legalName}</p>
<p style="margin-bottom: 0px; margin-top: 5px">Aggregate Revenue: {org.aggregateRevenue}</p>
<p style="margin-bottom: 0px; margin-top: 5px">Employee count: {org.employeeCount}</p>
<p style="margin-top: 5px">Twitter: {org.twitterHandle}</p>
<div>
<h3>Address</h3>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment