뱅킹 상태 변경

This commit is contained in:
byung eun park 2019-10-27 19:04:08 +09:00
parent bbec9664f8
commit ac73b0ba26
10 changed files with 23 additions and 27 deletions

View File

@ -2,6 +2,7 @@ package com.totopia.server.commons.data.entity;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

View File

@ -1,10 +1,7 @@
package com.totopia.server.commons.data.entity;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.LastModifiedBy;

View File

@ -1,8 +1,7 @@
package com.totopia.server.modules.moneys.entity;
import com.totopia.server.commons.data.entity.DateAuditEntity;
import com.totopia.server.commons.data.entity.UserDateAuditEntity;
import com.totopia.server.modules.moneys.type.BankingName;
import com.totopia.server.modules.moneys.type.BankingStateName;
import lombok.*;
import lombok.experimental.SuperBuilder;
@ -48,6 +47,6 @@ public class DepositEntity extends UserDateAuditEntity implements Serializable {
@Basic
@Enumerated(EnumType.STRING)
@Column(name = "status", length = 60)
private BankingName status;
private BankingStateName status;
}

View File

@ -1,7 +1,7 @@
package com.totopia.server.modules.moneys.entity;
import com.totopia.server.commons.data.entity.UserDateAuditEntity;
import com.totopia.server.modules.moneys.type.BankingName;
import com.totopia.server.modules.moneys.type.BankingStateName;
import lombok.*;
import lombok.experimental.SuperBuilder;
@ -36,6 +36,6 @@ public class PayEntity extends UserDateAuditEntity {
@Basic
@Enumerated(EnumType.STRING)
@Column(name = "banking_type", length = 60)
private BankingName bankingType;
private BankingStateName bankingType;
}

View File

@ -1,7 +1,7 @@
package com.totopia.server.modules.moneys.entity;
import com.totopia.server.commons.data.entity.UserDateAuditEntity;
import com.totopia.server.modules.moneys.type.BankingName;
import com.totopia.server.modules.moneys.type.BankingStateName;
import lombok.*;
import lombok.experimental.SuperBuilder;
@ -38,5 +38,5 @@ public class WithdrawEntity extends UserDateAuditEntity implements Serializable
@Basic
@Enumerated(EnumType.STRING)
@Column(name = "status", length = 60)
private BankingName status;
private BankingStateName status;
}

View File

@ -1,5 +0,0 @@
package com.totopia.server.modules.moneys.type;
public enum BankingName {
BANKING_WAITING, BANKING_HOLD, BANKING_COMPLETE, BANKING_DEPOSIT, BANKING_WITHDRAW
}

View File

@ -0,0 +1,5 @@
package com.totopia.server.modules.moneys.type;
public enum BankingStateName {
WAITING, HOLD, COMPLETE, DEPOSIT, WITHDRAW
}

View File

@ -65,7 +65,7 @@ public class BankRepositoryTest {
break;
}
idx++;
bankAccount.setUserId(user.getId());
bankAccount.setCreatedBy(user.getId());
bankAccount.setUpdatedAt(new Date());
this.bankRepository.save(bankAccount);
}
@ -96,7 +96,7 @@ public class BankRepositoryTest {
break;
}
idx++;
account.setUserId(account.getId());
account.setUpdatedBy(account.getId());
this.bankRepository.save(account);
}

View File

@ -5,7 +5,7 @@ import com.totopia.server.modules.moneys.entity.DepositEntity;
import com.totopia.server.modules.moneys.repository.BankRepository;
import com.totopia.server.modules.moneys.repository.DepositRepository;
import com.totopia.server.modules.user.entity.UserEntity;
import com.totopia.server.modules.moneys.type.BankingName;
import com.totopia.server.modules.moneys.type.BankingStateName;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
@ -42,13 +42,13 @@ public class DepositRepositoryTest {
public void insertTest() throws Exception {
DepositEntity en = DepositEntity.builder()
.price(10000)
.depositAccount("192-921-021-22")
.approveUser(accounts.get(0).getId())
.bankAccounts((short) 1)
.bank(accounts.get(2).getId())
.status(BankingName.BANKING_WAITING)
.status(BankingStateName.WAITING)
.build();
en.setCreatedBy(1L);
// DepositEntity entity = new DepositEntity();
//
// entity.setAmountOfMoney(2000000);
@ -65,7 +65,7 @@ public class DepositRepositoryTest {
@Test
public void updateTest() throws Exception {
DepositEntity entity = this.depositRepository.findById(1L).orElse(null);
entity.setStatus(BankingName.BANKING_COMPLETE);
entity.setStatus(BankingStateName.COMPLETE);
this.depositRepository.save(entity);
// assertEquals(entity.getDepositUser().longValue(), 2L);
}

View File

@ -5,7 +5,7 @@ import com.totopia.server.modules.moneys.repository.BankRepository;
import com.totopia.server.modules.moneys.repository.WithdrawRepository;
import com.totopia.server.modules.user.entity.UserEntity;
import com.totopia.server.modules.moneys.entity.WithdrawEntity;
import com.totopia.server.modules.moneys.type.BankingName;
import com.totopia.server.modules.moneys.type.BankingStateName;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -39,12 +39,11 @@ public class WithdrawRepositoryTest {
public void insertTest() throws Exception {
WithdrawEntity en = WithdrawEntity.builder()
.price(10000)
.approveUser(accounts.get(0).getId())
.bank(accounts.get(2).getId())
.status(BankingName.BANKING_WAITING)
.status(BankingStateName.WAITING)
.build();
en.setCreatedBy(accounts.get(0).getId());
this.withdrawRepository.save(en);
}
}