Sfoglia il codice sorgente

Add DAO for new entity class and move anonymize method there

tags/v0.10.5
Kristijan Mitrovic 4 anni fa
parent
commit
73a542ecca
2 ha cambiato i file con 37 aggiunte e 10 eliminazioni
  1. +37
    -0
      bubble-server/src/main/java/bubble/dao/bill/AccountPaymentArchivedDAO.java
  2. +0
    -10
      bubble-server/src/main/java/bubble/model/bill/AccountPaymentArchived.java

+ 37
- 0
bubble-server/src/main/java/bubble/dao/bill/AccountPaymentArchivedDAO.java Vedi File

@@ -0,0 +1,37 @@
/**
* Copyright (c) 2020 Bubble, Inc. All rights reserved.
* For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/
*/
package bubble.dao.bill;

import bubble.model.bill.AccountPaymentArchived;
import lombok.NonNull;
import org.cobbzilla.wizard.dao.AbstractCRUDDAO;
import org.cobbzilla.wizard.dao.SqlViewSearchableDAO;
import org.hibernate.criterion.Order;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class AccountPaymentArchivedDAO
extends AbstractCRUDDAO<AccountPaymentArchived>
implements SqlViewSearchableDAO<AccountPaymentArchived> {

// newest first
@Override public Order getDefaultSortOrder() { return ORDER_CTIME_DESC; }

@NonNull public List<AccountPaymentArchived> findByAccountName(@NonNull final String accountName) {
return findByField("accountName", accountName);
}

/**
* Anonymize this object. This is needed when client requires and signs/waives his/her right to sue in the future.
*/
public void anonymizeForAccountName(@NonNull final String accountName) {
// TODO: what about paymentMethodMaskedInfo, bubblePlanName and billPeriodStart. Do those fields contain any
// user info and names set up by the user?
bulkUpdate(new String[] { "accountName", "accountPlanName" }, new String[] { "anonymous", "anonymized" },
new String[] { "accountName" }, new String[] { accountName });
}
}

+ 0
- 10
bubble-server/src/main/java/bubble/model/bill/AccountPaymentArchived.java Vedi File

@@ -106,14 +106,4 @@ public class AccountPaymentArchived extends IdentifiableBase {
@ECSearchable @ECField(index=120, type=EntityFieldType.error)
@Type(type=ENCRYPTED_STRING) @Column(updatable=false, columnDefinition="varchar(" + (10_000 + ENC_PAD) + ")")
@JsonIgnore @Getter @Setter private String exception;

/**
* Anonymize this object. This is needed when client requires and signs/waives his/her right to sue in the future.
*/
public AccountPaymentArchived anonymize() {
// TODO: what about paymentMethodMaskedInfo, bubblePlanName and billPeriodStart. Do those fields contain any
// user info and names set up by the user?
return this.setAccountName("anonymous")
.setAccountPlanName("anonymized");
}
}

Caricamento…
Annulla
Salva