Add: repositories for Huertos entities and views
This commit is contained in:
1
.idea/modules.xml
generated
1
.idea/modules.xml
generated
@@ -2,6 +2,7 @@
|
|||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectModuleManager">
|
<component name="ProjectModuleManager">
|
||||||
<modules>
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/backend.iml" filepath="$PROJECT_DIR$/backend.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/backlib/backlib.iml" filepath="$PROJECT_DIR$/backlib/backlib.iml" />
|
<module fileurl="file://$PROJECT_DIR$/backlib/backlib.iml" filepath="$PROJECT_DIR$/backlib/backlib.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/cine/cine.iml" filepath="$PROJECT_DIR$/cine/cine.iml" />
|
<module fileurl="file://$PROJECT_DIR$/cine/cine.iml" filepath="$PROJECT_DIR$/cine/cine.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/core/core.iml" filepath="$PROJECT_DIR$/core/core.iml" />
|
<module fileurl="file://$PROJECT_DIR$/core/core.iml" filepath="$PROJECT_DIR$/core/core.iml" />
|
||||||
|
|||||||
9
backend.iml
Normal file
9
backend.iml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module version="4">
|
||||||
|
<component name="AdditionalModuleElements">
|
||||||
|
<content url="file://$MODULE_DIR$" dumb="true">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||||
|
</content>
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
@@ -46,6 +46,12 @@
|
|||||||
<version>0.11.5</version>
|
<version>0.11.5</version>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.miarma</groupId>
|
||||||
|
<artifactId>backlib</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package net.miarma.backend.huertos.dto;
|
||||||
|
|
||||||
|
public class BalanceWithTotalsDto {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,10 +3,8 @@ package net.miarma.backend.huertos.model;
|
|||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.*;
|
||||||
import jakarta.persistence.Entity;
|
import net.miarma.backlib.util.UuidUtil;
|
||||||
import jakarta.persistence.Id;
|
|
||||||
import jakarta.persistence.Table;
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "huertos_announces")
|
@Table(name = "huertos_announces")
|
||||||
@@ -14,6 +12,9 @@ public class Announcement {
|
|||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "announce_id", columnDefinition = "BINARY(16)")
|
@Column(name = "announce_id", columnDefinition = "BINARY(16)")
|
||||||
|
private byte[] announceIdBin;
|
||||||
|
|
||||||
|
@Transient
|
||||||
private UUID announceId;
|
private UUID announceId;
|
||||||
|
|
||||||
@Column(name = "body", nullable = false, columnDefinition = "TEXT")
|
@Column(name = "body", nullable = false, columnDefinition = "TEXT")
|
||||||
@@ -28,6 +29,21 @@ public class Announcement {
|
|||||||
@Column(name = "created_at", nullable = false)
|
@Column(name = "created_at", nullable = false)
|
||||||
private Instant createdAt;
|
private Instant createdAt;
|
||||||
|
|
||||||
|
@PrePersist
|
||||||
|
@PreUpdate
|
||||||
|
private void prePersist() {
|
||||||
|
if (announceId != null) {
|
||||||
|
announceIdBin = UuidUtil.uuidToBin(announceId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostLoad
|
||||||
|
private void postLoad() {
|
||||||
|
if (announceIdBin != null) {
|
||||||
|
announceId = UuidUtil.binToUUID(announceIdBin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public UUID getAnnounceId() {
|
public UUID getAnnounceId() {
|
||||||
return announceId;
|
return announceId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,8 @@ import java.math.BigDecimal;
|
|||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.*;
|
||||||
import jakarta.persistence.Entity;
|
import net.miarma.backlib.util.UuidUtil;
|
||||||
import jakarta.persistence.Id;
|
|
||||||
import jakarta.persistence.Table;
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "huertos_expenses")
|
@Table(name = "huertos_expenses")
|
||||||
@@ -15,6 +13,9 @@ public class Expense {
|
|||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "expense_id", columnDefinition = "BINARY(16)")
|
@Column(name = "expense_id", columnDefinition = "BINARY(16)")
|
||||||
|
private byte[] expenseIdBin;
|
||||||
|
|
||||||
|
@Transient
|
||||||
private UUID expenseId;
|
private UUID expenseId;
|
||||||
|
|
||||||
@Column(name = "concept", nullable = false, length = 128)
|
@Column(name = "concept", nullable = false, length = 128)
|
||||||
@@ -35,6 +36,21 @@ public class Expense {
|
|||||||
@Column(name = "created_at", nullable = false)
|
@Column(name = "created_at", nullable = false)
|
||||||
private Instant createdAt;
|
private Instant createdAt;
|
||||||
|
|
||||||
|
@PrePersist
|
||||||
|
@PreUpdate
|
||||||
|
private void prePersist() {
|
||||||
|
if (expenseId != null) {
|
||||||
|
expenseIdBin = UuidUtil.uuidToBin(expenseId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostLoad
|
||||||
|
private void postLoad() {
|
||||||
|
if (expenseIdBin != null) {
|
||||||
|
expenseId = UuidUtil.binToUUID(expenseIdBin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public UUID getExpenseId() {
|
public UUID getExpenseId() {
|
||||||
return expenseId;
|
return expenseId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,8 @@ package net.miarma.backend.huertos.model;
|
|||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.*;
|
||||||
import jakarta.persistence.Entity;
|
import net.miarma.backlib.util.UuidUtil;
|
||||||
import jakarta.persistence.Id;
|
|
||||||
import jakarta.persistence.Table;
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "huertos_user_metadata")
|
@Table(name = "huertos_user_metadata")
|
||||||
@@ -14,6 +12,9 @@ public class HuertosUserMetadata {
|
|||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "user_id", columnDefinition = "BINARY(16)")
|
@Column(name = "user_id", columnDefinition = "BINARY(16)")
|
||||||
|
private byte[] userIdBin;
|
||||||
|
|
||||||
|
@Transient
|
||||||
private UUID userId;
|
private UUID userId;
|
||||||
|
|
||||||
@Column(name = "member_number", nullable = false, unique = true)
|
@Column(name = "member_number", nullable = false, unique = true)
|
||||||
@@ -46,6 +47,22 @@ public class HuertosUserMetadata {
|
|||||||
@Column(name = "deactivated_at")
|
@Column(name = "deactivated_at")
|
||||||
private Instant deactivatedAt;
|
private Instant deactivatedAt;
|
||||||
|
|
||||||
|
@PrePersist
|
||||||
|
@PreUpdate
|
||||||
|
private void prePersist() {
|
||||||
|
if (userId != null) {
|
||||||
|
userIdBin = UuidUtil.uuidToBin(userId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostLoad
|
||||||
|
private void postLoad() {
|
||||||
|
if (userIdBin != null) {
|
||||||
|
userId = UuidUtil.binToUUID(userIdBin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public UUID getUserId() {
|
public UUID getUserId() {
|
||||||
return userId;
|
return userId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,8 @@ import java.math.BigDecimal;
|
|||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.*;
|
||||||
import jakarta.persistence.Entity;
|
import net.miarma.backlib.util.UuidUtil;
|
||||||
import jakarta.persistence.Id;
|
|
||||||
import jakarta.persistence.Table;
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "huertos_incomes")
|
@Table(name = "huertos_incomes")
|
||||||
@@ -15,9 +13,15 @@ public class Income {
|
|||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "income_id", columnDefinition = "BINARY(16)")
|
@Column(name = "income_id", columnDefinition = "BINARY(16)")
|
||||||
|
private byte[] incomeIdBin;
|
||||||
|
|
||||||
|
@Transient
|
||||||
private UUID incomeId;
|
private UUID incomeId;
|
||||||
|
|
||||||
@Column(name = "user_id", columnDefinition = "BINARY(16)", nullable = false)
|
@Column(name = "user_id", columnDefinition = "BINARY(16)", nullable = false)
|
||||||
|
private byte[] userIdBin;
|
||||||
|
|
||||||
|
@Transient
|
||||||
private UUID userId;
|
private UUID userId;
|
||||||
|
|
||||||
@Column(name = "concept", nullable = false, length = 128)
|
@Column(name = "concept", nullable = false, length = 128)
|
||||||
@@ -35,6 +39,29 @@ public class Income {
|
|||||||
@Column(name = "created_at", nullable = false)
|
@Column(name = "created_at", nullable = false)
|
||||||
private Instant createdAt;
|
private Instant createdAt;
|
||||||
|
|
||||||
|
@PrePersist
|
||||||
|
@PreUpdate
|
||||||
|
private void prePersist() {
|
||||||
|
if (userId != null) {
|
||||||
|
userIdBin = UuidUtil.uuidToBin(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (incomeId != null) {
|
||||||
|
incomeIdBin = UuidUtil.uuidToBin(incomeId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostLoad
|
||||||
|
private void postLoad() {
|
||||||
|
if (userIdBin != null) {
|
||||||
|
userId = UuidUtil.binToUUID(userIdBin);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (incomeIdBin != null) {
|
||||||
|
incomeId = UuidUtil.binToUUID(incomeIdBin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public UUID getIncomeId() {
|
public UUID getIncomeId() {
|
||||||
return incomeId;
|
return incomeId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,8 @@ package net.miarma.backend.huertos.model;
|
|||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.*;
|
||||||
import jakarta.persistence.Entity;
|
import net.miarma.backlib.util.UuidUtil;
|
||||||
import jakarta.persistence.Id;
|
|
||||||
import jakarta.persistence.Table;
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "huertos_pre_users")
|
@Table(name = "huertos_pre_users")
|
||||||
@@ -14,9 +12,15 @@ public class PreUser {
|
|||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "pre_user_id", columnDefinition = "BINARY(16)")
|
@Column(name = "pre_user_id", columnDefinition = "BINARY(16)")
|
||||||
|
private byte[] preUserIdBin;
|
||||||
|
|
||||||
|
@Transient
|
||||||
private UUID preUserId;
|
private UUID preUserId;
|
||||||
|
|
||||||
@Column(name = "request_id", columnDefinition = "BINARY(16)", nullable = false)
|
@Column(name = "request_id", columnDefinition = "BINARY(16)", nullable = false)
|
||||||
|
private byte[] requestIdBin;
|
||||||
|
|
||||||
|
@Transient
|
||||||
private UUID requestId;
|
private UUID requestId;
|
||||||
|
|
||||||
@Column(name = "user_name", nullable = false, length = 64)
|
@Column(name = "user_name", nullable = false, length = 64)
|
||||||
@@ -61,6 +65,29 @@ public class PreUser {
|
|||||||
@Column(name = "created_at", nullable = false)
|
@Column(name = "created_at", nullable = false)
|
||||||
private Instant createdAt;
|
private Instant createdAt;
|
||||||
|
|
||||||
|
@PrePersist
|
||||||
|
@PreUpdate
|
||||||
|
private void prePersist() {
|
||||||
|
if (preUserId != null) {
|
||||||
|
preUserIdBin = UuidUtil.uuidToBin(preUserId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (requestId != null) {
|
||||||
|
requestIdBin = UuidUtil.uuidToBin(requestId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostLoad
|
||||||
|
private void postLoad() {
|
||||||
|
if (preUserIdBin != null) {
|
||||||
|
preUserId = UuidUtil.binToUUID(preUserIdBin);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (requestIdBin != null) {
|
||||||
|
requestId = UuidUtil.binToUUID(requestIdBin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public UUID getPreUserId() {
|
public UUID getPreUserId() {
|
||||||
return preUserId;
|
return preUserId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,8 @@ package net.miarma.backend.huertos.model;
|
|||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.*;
|
||||||
import jakarta.persistence.Entity;
|
import net.miarma.backlib.util.UuidUtil;
|
||||||
import jakarta.persistence.Id;
|
|
||||||
import jakarta.persistence.Table;
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "huertos_requests")
|
@Table(name = "huertos_requests")
|
||||||
@@ -14,6 +12,9 @@ public class Request {
|
|||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "request_id", columnDefinition = "BINARY(16)")
|
@Column(name = "request_id", columnDefinition = "BINARY(16)")
|
||||||
|
private byte[] requestIdBin;
|
||||||
|
|
||||||
|
@Transient
|
||||||
private UUID requestId;
|
private UUID requestId;
|
||||||
|
|
||||||
@Column(name = "type", nullable = false)
|
@Column(name = "type", nullable = false)
|
||||||
@@ -31,6 +32,21 @@ public class Request {
|
|||||||
@Column(name = "created_at", nullable = false)
|
@Column(name = "created_at", nullable = false)
|
||||||
private Instant createdAt;
|
private Instant createdAt;
|
||||||
|
|
||||||
|
@PrePersist
|
||||||
|
@PreUpdate
|
||||||
|
private void prePersist() {
|
||||||
|
if (requestId != null) {
|
||||||
|
requestIdBin = UuidUtil.uuidToBin(requestId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostLoad
|
||||||
|
private void postLoad() {
|
||||||
|
if (requestIdBin != null) {
|
||||||
|
requestId = UuidUtil.binToUUID(requestIdBin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public UUID getRequestId() {
|
public UUID getRequestId() {
|
||||||
return requestId;
|
return requestId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package net.miarma.backend.huertos.model.view;
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
import org.hibernate.annotations.Immutable;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Immutable
|
||||||
|
@Table(name = "v_balance_with_totals")
|
||||||
|
public class VBalanceWithTotals {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "initial_bank")
|
||||||
|
private Double initialBank;
|
||||||
|
|
||||||
|
@Column(name = "initial_cash")
|
||||||
|
private Double initialCash;
|
||||||
|
|
||||||
|
@Column(name = "total_bank_expenses")
|
||||||
|
private Double totalBankExpenses;
|
||||||
|
|
||||||
|
@Column(name = "total_cash_expenses")
|
||||||
|
private Double totalCashExpenses;
|
||||||
|
|
||||||
|
@Column(name = "total_bank_incomes")
|
||||||
|
private Double totalBankIncomes;
|
||||||
|
|
||||||
|
@Column(name = "total_cash_incomes")
|
||||||
|
private Double totalCashIncomes;
|
||||||
|
|
||||||
|
@Column(name = "created_at")
|
||||||
|
private Instant createdAt;
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getInitialBank() {
|
||||||
|
return initialBank;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getInitialCash() {
|
||||||
|
return initialCash;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getTotalBankExpenses() {
|
||||||
|
return totalBankExpenses;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getTotalCashExpenses() {
|
||||||
|
return totalCashExpenses;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getTotalBankIncomes() {
|
||||||
|
return totalBankIncomes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getTotalCashIncomes() {
|
||||||
|
return totalCashIncomes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Instant getCreatedAt() {
|
||||||
|
return createdAt;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
package net.miarma.backend.huertos.model.view;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import net.miarma.backlib.util.UuidUtil;
|
||||||
|
import org.hibernate.annotations.Immutable;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Immutable
|
||||||
|
@Table(name = "v_huertos_member")
|
||||||
|
public class VHuertosMember {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "user_id")
|
||||||
|
private byte[] userIdBin;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private UUID userId;
|
||||||
|
|
||||||
|
@Column(name = "display_name")
|
||||||
|
private String displayName;
|
||||||
|
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
@Column(name = "member_number")
|
||||||
|
private Integer memberNumber;
|
||||||
|
|
||||||
|
@Column(name = "plot_number")
|
||||||
|
private Integer plotNumber;
|
||||||
|
|
||||||
|
private String dni;
|
||||||
|
private String phone;
|
||||||
|
private Byte type;
|
||||||
|
private Byte role;
|
||||||
|
|
||||||
|
@Column(name = "status")
|
||||||
|
private Byte credentialStatus;
|
||||||
|
|
||||||
|
private String notes;
|
||||||
|
|
||||||
|
@Column(name = "created_at")
|
||||||
|
private Instant createdAt;
|
||||||
|
|
||||||
|
@Column(name = "assigned_at")
|
||||||
|
private Instant assignedAt;
|
||||||
|
|
||||||
|
@Column(name = "deactivated_at")
|
||||||
|
private Instant deactivatedAt;
|
||||||
|
|
||||||
|
@Column(name = "service_id")
|
||||||
|
private Byte serviceId;
|
||||||
|
|
||||||
|
@Column(name = "service_name")
|
||||||
|
private String serviceName;
|
||||||
|
|
||||||
|
@PostLoad
|
||||||
|
private void postLoad() {
|
||||||
|
if (userIdBin != null) {
|
||||||
|
userId = UuidUtil.binToUUID(userIdBin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getUserId() {
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDisplayName() {
|
||||||
|
return displayName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAvatar() {
|
||||||
|
return avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMemberNumber() {
|
||||||
|
return memberNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPlotNumber() {
|
||||||
|
return plotNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDni() {
|
||||||
|
return dni;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPhone() {
|
||||||
|
return phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Byte getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Byte getRole() {
|
||||||
|
return role;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Byte getCredentialStatus() {
|
||||||
|
return credentialStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNotes() {
|
||||||
|
return notes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Instant getCreatedAt() {
|
||||||
|
return createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Instant getAssignedAt() {
|
||||||
|
return assignedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Instant getDeactivatedAt() {
|
||||||
|
return deactivatedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Byte getServiceId() {
|
||||||
|
return serviceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getServiceName() {
|
||||||
|
return serviceName;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package net.miarma.backend.huertos.model.view;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import net.miarma.backlib.util.UuidUtil;
|
||||||
|
import org.hibernate.annotations.Immutable;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Immutable
|
||||||
|
@Table(name = "v_incomes_with_full_names")
|
||||||
|
public class VIncomesWithFullNames {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "income_id")
|
||||||
|
private byte[] incomeIdBin;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private UUID incomeId;
|
||||||
|
|
||||||
|
@Column(name = "user_id")
|
||||||
|
private byte[] userIdBin;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private UUID userId;
|
||||||
|
|
||||||
|
@Column(name = "display_name")
|
||||||
|
private String displayName;
|
||||||
|
|
||||||
|
private String concept;
|
||||||
|
private Double amount;
|
||||||
|
private Byte type;
|
||||||
|
private Byte frequency;
|
||||||
|
|
||||||
|
@Column(name = "created_at")
|
||||||
|
private Instant createdAt;
|
||||||
|
|
||||||
|
@PostLoad
|
||||||
|
private void postLoad() {
|
||||||
|
if (userIdBin != null) {
|
||||||
|
userId = UuidUtil.binToUUID(userIdBin);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (incomeIdBin != null) {
|
||||||
|
incomeId = UuidUtil.binToUUID(incomeIdBin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getIncomeId() {
|
||||||
|
return incomeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getUserId() {
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDisplayName() {
|
||||||
|
return displayName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getConcept() {
|
||||||
|
return concept;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getAmount() {
|
||||||
|
return amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Byte getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Byte getFrequency() {
|
||||||
|
return frequency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Instant getCreatedAt() {
|
||||||
|
return createdAt;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,194 @@
|
|||||||
|
package net.miarma.backend.huertos.model.view;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import net.miarma.backlib.util.UuidUtil;
|
||||||
|
import org.hibernate.annotations.Immutable;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Immutable
|
||||||
|
@Table(name = "v_requests_with_pre_users")
|
||||||
|
public class VRequestsWithPreUsers {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "request_id")
|
||||||
|
private byte[] requestIdBin;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private UUID requestId;
|
||||||
|
|
||||||
|
@Column(name = "request_type")
|
||||||
|
private Byte requestType;
|
||||||
|
|
||||||
|
@Column(name = "request_status")
|
||||||
|
private Byte requestStatus;
|
||||||
|
|
||||||
|
@Column(name = "requested_by")
|
||||||
|
private byte[] requestedByBin;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private UUID requestedBy;
|
||||||
|
|
||||||
|
@Column(name = "requested_by_name")
|
||||||
|
private String requestedByName;
|
||||||
|
|
||||||
|
@Column(name = "target_user_id")
|
||||||
|
private byte[] targetUserIdBin;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private UUID targetUserId;
|
||||||
|
|
||||||
|
@Column(name = "request_created_at")
|
||||||
|
private Instant requestCreatedAt;
|
||||||
|
|
||||||
|
// --- PreUser ---
|
||||||
|
@Column(name = "pre_user_id")
|
||||||
|
private byte[] preUserIdBin;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private UUID preUserId;
|
||||||
|
|
||||||
|
@Column(name = "pre_user_name")
|
||||||
|
private String preUserName;
|
||||||
|
|
||||||
|
@Column(name = "pre_display_name")
|
||||||
|
private String preDisplayName;
|
||||||
|
|
||||||
|
@Column(name = "pre_dni")
|
||||||
|
private String preDni;
|
||||||
|
|
||||||
|
@Column(name = "pre_phone")
|
||||||
|
private String prePhone;
|
||||||
|
|
||||||
|
@Column(name = "pre_email")
|
||||||
|
private String preEmail;
|
||||||
|
|
||||||
|
@Column(name = "pre_address")
|
||||||
|
private String preAddress;
|
||||||
|
|
||||||
|
@Column(name = "pre_zip_code")
|
||||||
|
private String preZipCode;
|
||||||
|
|
||||||
|
@Column(name = "pre_city")
|
||||||
|
private String preCity;
|
||||||
|
|
||||||
|
@Column(name = "pre_member_number")
|
||||||
|
private Integer preMemberNumber;
|
||||||
|
|
||||||
|
@Column(name = "pre_plot_number")
|
||||||
|
private Integer prePlotNumber;
|
||||||
|
|
||||||
|
@Column(name = "pre_type")
|
||||||
|
private Byte preType;
|
||||||
|
|
||||||
|
@Column(name = "pre_role")
|
||||||
|
private Byte preRole;
|
||||||
|
|
||||||
|
@Column(name = "pre_created_at")
|
||||||
|
private Instant preCreatedAt;
|
||||||
|
|
||||||
|
@PostLoad
|
||||||
|
private void postLoad() {
|
||||||
|
if (requestIdBin != null) {
|
||||||
|
requestId = UuidUtil.binToUUID(requestIdBin);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (requestedByBin != null) {
|
||||||
|
requestedBy = UuidUtil.binToUUID(requestedByBin);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (targetUserIdBin != null) {
|
||||||
|
targetUserId = UuidUtil.binToUUID(targetUserIdBin);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preUserIdBin != null) {
|
||||||
|
preUserId = UuidUtil.binToUUID(preUserIdBin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getRequestId() {
|
||||||
|
return requestId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Byte getRequestType() {
|
||||||
|
return requestType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Byte getRequestStatus() {
|
||||||
|
return requestStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getRequestedBy() {
|
||||||
|
return requestedBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRequestedByName() {
|
||||||
|
return requestedByName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getTargetUserId() {
|
||||||
|
return targetUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Instant getRequestCreatedAt() {
|
||||||
|
return requestCreatedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getPreUserId() {
|
||||||
|
return preUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPreUserName() {
|
||||||
|
return preUserName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPreDisplayName() {
|
||||||
|
return preDisplayName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPreDni() {
|
||||||
|
return preDni;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPrePhone() {
|
||||||
|
return prePhone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPreEmail() {
|
||||||
|
return preEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPreAddress() {
|
||||||
|
return preAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPreZipCode() {
|
||||||
|
return preZipCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPreCity() {
|
||||||
|
return preCity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPreMemberNumber() {
|
||||||
|
return preMemberNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPrePlotNumber() {
|
||||||
|
return prePlotNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Byte getPreType() {
|
||||||
|
return preType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Byte getPreRole() {
|
||||||
|
return preRole;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Instant getPreCreatedAt() {
|
||||||
|
return preCreatedAt;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package net.miarma.backend.huertos.repository;
|
||||||
|
|
||||||
|
import net.miarma.backend.huertos.model.Announcement;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
public interface AnnouncementRepository extends JpaRepository<Announcement, byte[]> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package net.miarma.backend.huertos.repository;
|
||||||
|
|
||||||
|
import net.miarma.backend.huertos.model.Balance;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
public interface BalanceRepository extends JpaRepository<Balance, Byte> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package net.miarma.backend.huertos.repository;
|
||||||
|
|
||||||
|
import net.miarma.backend.huertos.model.Expense;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
public interface ExpenseRepository extends JpaRepository<Expense, byte[]> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package net.miarma.backend.huertos.repository;
|
||||||
|
|
||||||
|
import net.miarma.backend.huertos.model.HuertosUserMetadata;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
public interface HuertosUserMetadataRepository extends JpaRepository<HuertosUserMetadata, byte[]> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package net.miarma.backend.huertos.repository;
|
||||||
|
|
||||||
|
import net.miarma.backend.huertos.model.Income;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
public interface IncomeRepository extends JpaRepository<Income, byte[]> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package net.miarma.backend.huertos.repository;
|
||||||
|
|
||||||
|
import net.miarma.backend.huertos.model.PreUser;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
public interface PreUserRepository extends JpaRepository<PreUser, byte[]> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package net.miarma.backend.huertos.repository;
|
||||||
|
|
||||||
|
import net.miarma.backend.huertos.model.Request;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
public interface RequestRepository extends JpaRepository<Request, byte[]> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package net.miarma.backend.huertos.repository.view;
|
||||||
|
|
||||||
|
import net.miarma.backend.huertos.model.view.VBalanceWithTotals;
|
||||||
|
import org.springframework.data.repository.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface VBalanceWithTotalsRepository extends Repository<VBalanceWithTotals, byte[]> {
|
||||||
|
List<VBalanceWithTotals> findAll();
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package net.miarma.backend.huertos.repository.view;
|
||||||
|
|
||||||
|
import net.miarma.backend.huertos.model.view.VHuertosMember;
|
||||||
|
import org.springframework.data.repository.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface VHuertosMemberRepository extends Repository<VHuertosMember, byte[]> {
|
||||||
|
List<VHuertosMemberRepository> findAll();
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package net.miarma.backend.huertos.repository.view;
|
||||||
|
|
||||||
|
import net.miarma.backend.huertos.model.view.VIncomesWithFullNames;
|
||||||
|
import org.springframework.data.repository.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface VIncomesWithFullNamesRepository extends Repository<VIncomesWithFullNames, byte[]> {
|
||||||
|
List<VIncomesWithFullNamesRepository> findAll();
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package net.miarma.backend.huertos.repository.view;
|
||||||
|
|
||||||
|
import net.miarma.backend.huertos.model.view.VRequestsWithPreUsers;
|
||||||
|
import org.springframework.data.repository.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface VRequestsWithPreUsersRepository extends Repository<VRequestsWithPreUsers, byte[]> {
|
||||||
|
List<VRequestsWithPreUsersRepository> findAll();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user