Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify company data schema to include licensing details #1146

Merged

Conversation

jfkonecn
Copy link
Contributor

closes oncokb/oncokb-pipeline#442

@jfkonecn jfkonecn requested a review from zhx828 August 27, 2024 18:31
@jfkonecn jfkonecn marked this pull request as draft August 28, 2024 12:46
@jfkonecn jfkonecn marked this pull request as ready for review August 28, 2024 16:34
Copy link
Member

@zhx828 zhx828 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will circle back to review the frontend once the backend changes are finalized.

@@ -40,6 +40,9 @@
<column name="legal_contact" type="varchar(255)">
<constraints nullable="true" />
</column>
<column name="additional_info" type="${clobType}">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To work with the production database, we need to create a new changeSet instead of adding to the old one.

<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
<changeSet id="20210927165433-2-data" author="calvin" context="faker">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be deleted I believe

@@ -41,9 +41,11 @@ public class CompanyDTO implements Serializable {

@NotEmpty
private Set<String> companyDomains = new HashSet<>();
@Lob
private String additionalInfo;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have an AdditionalInfo class to host all properties, similar to AdditionalInfoDTO under useradditionalinfo

@@ -0,0 +1 @@
{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's don't include hipster.png and hipster.txt under the fake-data folder.

@jfkonecn jfkonecn requested a review from zhx828 September 3, 2024 15:43
"additionalInfo": {
"license": {
"termination": {
"date": "2024-09-21",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is a fake data, but can we have termination date after activation date? 😃

import java.time.LocalDate;

public class CompanyLicense implements Serializable {
private LocalDate activation;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have been suing Instant for dates, let's do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using LocalDate since it represents a date only. I'm assuming we don't want to deal with time zones?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've been using instant with timezone and map it to local in the frontend.


public class CompanyTermination implements Serializable {
private Integer notificationDays;
private LocalDate date;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too

Comment on lines 4 to 5
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IntelliJ indicates these two are not used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copy and pasted from liquibase's doc. I guess they need to update them. 😆

Comment on lines 8 to 9
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd
http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IntelliJ indicates these two are not used.

http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd
http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd">

<changeSet author="john" id="20240829165533">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We seem to use jhipster in the author field in the past which is wrong. Let's use oncokb going forward.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so author="oncokb"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah

import { CompanyAdditionalInfoDTO } from 'app/shared/api/generated/API';
import { FormTextAreaField } from 'app/shared/textarea/FormTextAreaField';

const defaultAdditionalInfo: CompanyAdditionalInfoDTO = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having a default means we will always have companyAdditionalInfo populated in the DB correct? Historically we don't add the default but leave the filed empty in the DB.

Copy link
Contributor Author

@jfkonecn jfkonecn Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but shouldn't we always have it populated going forward?

When you say empty do you mean that you don't include the empty field at all in the json?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, if the user does not have any additional info, the DB has no content.

<FormInputField
id="termination.date"
label="Termination Date"
type="date"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newly added components seem to have different height than others?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to copy FormTextAreaField is that a bad example?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. If this component comes from us, we need to examine why it looks differently from others.

@@ -1,23 +1,25 @@
import React from 'react';
import Select from 'react-select';

export type IFormSelectWithLabelProps = {
onSelection: (selectedOption: any) => void;
export type IFormSelectWithLabelProps<Label, Value> = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@observable companyAdditionalInfo: CompanyAdditionalInfoDTO = {
license: {
...defaultInfo.license,
activation: new Date().toISOString().split('T')[0],
Copy link
Contributor Author

@jfkonecn jfkonecn Sep 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only if creating a regular company

activation: '',
termination: {
date: '',
notificationDays: 60,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

30

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto-renew true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add warning to user that email will be sent if inside of notification window when the user updates the company page.

@jfkonecn jfkonecn added the feature Feature tag for release label Sep 10, 2024
Copy link
Member

@zhx828 zhx828 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • after selecting activation, the auto-renewal should be Yes
  • Termination Notification Days and notes should not be editable if termination date is not available
  • termination date should not be earlier than activation
  • add warning to user that email will be sent if inside of notification window when the user updates the company page. this is not implemented. See the modal when converting license status from regular to trial as an example

@jfkonecn
Copy link
Contributor Author

  • after selecting activation, the auto-renewal should be Yes
  • Termination Notification Days and notes should not be editable if termination date is not available
  • termination date should not be earlier than activation
  • add warning to user that email will be sent if inside of notification window when the user updates the company page. this is not implemented. See the modal when converting license status from regular to trial as an example

@zhx828 I addressed everything but "add warning to user that email will be sent if inside of notification window when the user updates the company page. this is not implemented. See the modal when converting license status from regular to trial as an example"

@zhx828 zhx828 changed the base branch from master to feature/company-license October 1, 2024 19:48
Copy link
Member

@zhx828 zhx828 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM.

@jfkonecn jfkonecn merged commit b47aefe into oncokb:feature/company-license Oct 1, 2024
6 checks passed
@jfkonecn jfkonecn deleted the feature/company-data branch October 1, 2024 20:29
jfkonecn added a commit that referenced this pull request Oct 18, 2024
* Modify company data schema to include licensing details (#1146)

* Added termination warning email button (#1151)

* Added endpoints to send company notification email (#1152)

* Bump elliptic from 6.5.2 to 6.5.7

Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.7.
- [Commits](indutny/elliptic@v6.5.2...v6.5.7)

---
updated-dependencies:
- dependency-name: elliptic
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* allow keypress events for textareas

* Fix data download (#1162)

* User is granted API access on approval (#1163)

* Added endpoints to send notification email

* Data version is now displayed (#1165)

* Addressed PR comments

* Updated Setup Java in Git Actions (#1166)

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Hongxin <[email protected]>
Co-authored-by: bprize15 <[email protected]>
Co-authored-by: bprize15 <[email protected]>
Co-authored-by: Calvin Lu <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Hongxin <[email protected]>
Co-authored-by: bprize15 <[email protected]>
Co-authored-by: bprize15 <[email protected]>
Co-authored-by: Calvin Lu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature tag for release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants