dev add token spent logic
Test Workflow / test (push) Successful in 4s

This commit is contained in:
vladp
2026-04-10 20:13:59 +07:00
parent c1360fce87
commit aa6c0c1b94
18 changed files with 820 additions and 9 deletions
@@ -0,0 +1,12 @@
package ru.soune.nocopy.entity.tokenoperation;
public enum OperationType {
SEARCH("search"), MONITORING("monitoring"), CREATE_LEGAL_CASE("legal_case"),
FILE_UPLOAD("file_upload"), GLOBAL_SEARCH("global_search");
private final String name;
private OperationType(String name) {
this.name = name;
}
}
@@ -0,0 +1,32 @@
package ru.soune.nocopy.entity.tokenoperation;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;
import java.time.LocalDateTime;
@Table(name = "token_operation")
@Entity
@Setter @Getter
@NoArgsConstructor
public class TokenOperation {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Enumerated(EnumType.STRING)
@Column(name = "operation_type")
private OperationType operationType;
@Column(name = "user_id")
private Long userId;
@Column(name = "spent")
private Long spent;
@CreationTimestamp
@Column(name = "created_at", updatable = false)
private LocalDateTime createdAt;
}