Skip to content

Commit

Permalink
Revert "Feature/company license (oncokb#1164)"
Browse files Browse the repository at this point in the history
This reverts commit bc7bb8a.
  • Loading branch information
jfkonecn committed Oct 18, 2024
1 parent 5d2b56a commit 98e31db
Show file tree
Hide file tree
Showing 34 changed files with 78 additions and 1,609 deletions.
5 changes: 0 additions & 5 deletions .jhipster/Company.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@
{
"fieldName": "legalContact",
"fieldType": "String"
},
{
"fieldName": "additionalInfo",
"fieldType": "byte[]",
"fieldTypeBlobContent": "text"
}
],
"relationships": [
Expand Down
1 change: 0 additions & 1 deletion jhipster-jdl.jdl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ entity Company {
licenseStatus LicenseStatus required,
businessContact String,
legalContact String,
additionalInfo TextBlob
}

entity CompanyDomain {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 2 additions & 24 deletions screenshot-test/data/api-companies.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,7 @@
"businessContact": "Representative",
"legalContact": "override orchid reboot",
"companyDomains": ["oncokb.org"],
"numberOfUsers": 0,
"additionalInfo": {
"license": {
"termination": {
"date": "2025-09-21",
"notes": "notes",
"notificationDays": 3433
},
"autoRenewal": false,
"activation": "2024-09-28"
}
}
"numberOfUsers": 0
},
{
"id": 2,
Expand All @@ -34,17 +23,6 @@
"businessContact": "Steel Configuration Designer",
"legalContact": "system engine Australian Dollar",
"companyDomains": ["mskcc.org"],
"numberOfUsers": 3,
"additionalInfo": {
"license": {
"termination": {
"date": "2025-09-21",
"notes": "notes",
"notificationDays": 3433
},
"autoRenewal": false,
"activation": "2024-09-28"
}
}
"numberOfUsers": 3
}
]
13 changes: 1 addition & 12 deletions screenshot-test/data/api-company-details.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,5 @@
"businessContact": "Representative",
"legalContact": "override orchid reboot",
"companyDomains": ["oncokb.org"],
"numberOfUsers": 0,
"additionalInfo": {
"license": {
"termination": {
"date": "2024-09-21",
"notes": "notes",
"notificationDays": 3433
},
"autoRenewal": false,
"activation": "2024-09-28"
}
}
"numberOfUsers": 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,5 @@ public RecaptchaProperties getRecaptcha() {
public void setRecaptcha(RecaptchaProperties recaptcha) {
this.recaptcha = recaptcha;
}

}
18 changes: 0 additions & 18 deletions src/main/java/org/mskcc/cbio/oncokb/domain/Company.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ public class Company implements Serializable {
@Column(name = "legal_contact", length = 255)
private String legalContact;

@Lob
@Column(name = "additional_info")
private String additionalInfo;

@ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
@JoinTable(name = "company_company_domain",
joinColumns = @JoinColumn(name = "company_id", referencedColumnName = "id"),
Expand Down Expand Up @@ -189,19 +185,6 @@ public void setLegalContact(String legalContact) {
this.legalContact = legalContact;
}

public String getAdditionalInfo() {
return additionalInfo;
}

public Company additionalInfo(String additionalInfo) {
this.additionalInfo = additionalInfo;
return this;
}

public void setAdditionalInfo(String additionalInfo) {
this.additionalInfo = additionalInfo;
}

public Set<CompanyDomain> getCompanyDomains() {
return companyDomains;
}
Expand Down Expand Up @@ -257,7 +240,6 @@ public String toString() {
", licenseStatus='" + getLicenseStatus() + "'" +
", businessContact='" + getBusinessContact() + "'" +
", legalContact='" + getLegalContact() + "'" +
", additionalInfo='" + getAdditionalInfo() + "'" +
"}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ public enum MailType {
, LIST_OF_UNAPPROVED_USERS(new MailTypeBuilder()
.templateName("listOfUnapprovedUsers")
.description("List of unapproved users"))
, TERMINATION_NOTIFICATION_EMAIL(new MailTypeBuilder()
.templateName("terminationNotificationEmail")
.description("Notifies admins about companies with licenses about to expire"))
, TEST(new MailTypeBuilder()
.templateName("testEmail")
.description("Test"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,4 @@ public interface CompanyRepository extends JpaRepository<Company, Long> {

@Cacheable(cacheResolver = "companyCacheResolver")
Optional<Company> findOneByNameIgnoreCase(String name);

@Query("select c from Company c where c.id in ?1")
List<Company> findCompaniesByIds(List<Long> ids);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.mskcc.cbio.oncokb.service;

import org.mskcc.cbio.oncokb.domain.Company;
import org.mskcc.cbio.oncokb.domain.enumeration.LicenseStatus;
import org.mskcc.cbio.oncokb.service.dto.CompanyDTO;
import org.mskcc.cbio.oncokb.web.rest.vm.CompanyVM;
Expand Down Expand Up @@ -59,7 +58,4 @@ public interface CompanyService {
* @param id the id of the entity.
*/
void delete(Long id);


List<CompanyDTO> findCompaniesByIds(List<Long> ids);
}
30 changes: 0 additions & 30 deletions src/main/java/org/mskcc/cbio/oncokb/service/MailService.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.mskcc.cbio.oncokb.domain.Company;
import org.mskcc.cbio.oncokb.domain.UserMessagePair;
import org.mskcc.cbio.oncokb.domain.enumeration.MailType;
import org.mskcc.cbio.oncokb.service.dto.TerminationEmailDTO;
import org.mskcc.cbio.oncokb.service.dto.UserDTO;
import org.mskcc.cbio.oncokb.service.dto.UserMailsDTO;
import org.mskcc.cbio.oncokb.web.rest.vm.ExposedToken;
Expand Down Expand Up @@ -86,20 +85,6 @@ private UnknownMailTypeException() {
}
}

public void sendEmail(TerminationEmailDTO dto) throws MessagingException {
log.debug("Send email to company ID '{}' with subject '{}' and content={}",
dto.getCompanyId(), dto.getSubject(), dto.getContent());

MimeMessage mimeMessage = javaMailSender.createMimeMessage();
MimeMessageHelper message = new MimeMessageHelper(mimeMessage, false, StandardCharsets.UTF_8.name());
message.setFrom(dto.getFrom());
message.setBcc(dto.getBcc().split(";"));
message.setCc(dto.getCc().split(";"));
message.setSubject(dto.getSubject());
message.setText(dto.getContent(), false);
javaMailSender.send(mimeMessage);
}

@Async
public void sendEmail(String to, String from, String cc, String subject, String content, List<String> attachmentFilesNames, boolean isMultipart, boolean isHtml) throws MessagingException {
log.debug("Send email[multipart '{}' and html '{}'] to '{}' with subject '{}' and content={}",
Expand Down Expand Up @@ -251,21 +236,6 @@ public void sendEmailFromTemplate(UserDTO user, MailType mailType, String subjec
}
}

public void sendInternalEmailFromTemplate(MailType mailType, String subject, String to, Context additionalContext) {
Context context = new Context(Locale.ENGLISH);

if (additionalContext != null)
additionalContext.getVariableNames().forEach(name -> context.setVariable(name, additionalContext.getVariable(name)));

String from = jHipsterProperties.getMail().getFrom();
String content = templateEngine.process("mail/" + mailType.getTemplateName(), context);
try {
sendEmail(to, from, null, subject, content, null, false, true);
} catch (MailException | MessagingException e) {
log.warn("Internal email could not be sent to '{}'", to, e);
}
}

@Async
public void sendActivationEmail(UserDTO user) {
log.debug("Sending activation email to '{}'", user.getEmail());
Expand Down
17 changes: 2 additions & 15 deletions src/main/java/org/mskcc/cbio/oncokb/service/dto/CompanyDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
import javax.persistence.Lob;
import org.mskcc.cbio.oncokb.domain.enumeration.CompanyType;
import org.mskcc.cbio.oncokb.domain.enumeration.LicenseType;
import org.mskcc.cbio.oncokb.service.dto.companyadditionalinfo.CompanyAdditionalInfoDTO;
import org.mskcc.cbio.oncokb.domain.enumeration.LicenseModel;
import org.mskcc.cbio.oncokb.domain.enumeration.LicenseStatus;

/**
* A DTO for the {@link org.mskcc.cbio.oncokb.domain.Company} entity.
*/
public class CompanyDTO implements Serializable {

private Long id;

@NotNull
Expand Down Expand Up @@ -43,11 +42,8 @@ public class CompanyDTO implements Serializable {
@NotEmpty
private Set<String> companyDomains = new HashSet<>();

@Lob
private CompanyAdditionalInfoDTO additionalInfo;

private Integer numberOfUsers;

public Long getId() {
return id;
}
Expand Down Expand Up @@ -128,14 +124,6 @@ public void setCompanyDomains(Set<String> companyDomains) {
this.companyDomains = companyDomains;
}

public CompanyAdditionalInfoDTO getAdditionalInfo() {
return additionalInfo;
}

public void setAdditionalInfo(CompanyAdditionalInfoDTO additionalInfo) {
this.additionalInfo = additionalInfo;
}

public Integer getNumberOfUsers() {
return this.numberOfUsers;
}
Expand Down Expand Up @@ -174,7 +162,6 @@ public String toString() {
", licenseStatus='" + getLicenseStatus() + "'" +
", businessContact='" + getBusinessContact() + "'" +
", legalContact='" + getLegalContact() + "'" +
", additionalInfo='" + getAdditionalInfo() + "'" +
", companyDomains='" + getCompanyDomains() + "'" +
", numberOfUsers='" + getNumberOfUsers() + "'" +
"}";
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 98e31db

Please sign in to comment.