-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implementing saving and getting
- Loading branch information
Showing
12 changed files
with
168 additions
and
35 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
...cardanofoundation/lob/app/accounting_reporting_core/domain/entity/metric/ChartEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package org.cardanofoundation.lob.app.accounting_reporting_core.domain.entity.metric; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Enumerated; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.Table; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import org.cardanofoundation.lob.app.accounting_reporting_core.domain.core.metric.MetricEnum; | ||
import org.hibernate.annotations.JdbcType; | ||
import org.hibernate.dialect.PostgreSQLEnumJdbcType; | ||
|
||
import static jakarta.persistence.EnumType.STRING; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
@Entity | ||
@Table(name = "accounting_core_charts") | ||
public class ChartEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
@ManyToOne | ||
@JoinColumn(name = "dashboard_id", nullable = false) | ||
private DashboardEntity dashboard; | ||
private Double xPos; | ||
private Double yPos; | ||
private Double width; | ||
private Double height; | ||
@Enumerated(STRING) | ||
@JdbcType(PostgreSQLEnumJdbcType.class) | ||
private MetricEnum metric; | ||
@Enumerated(STRING) | ||
@JdbcType(PostgreSQLEnumJdbcType.class) | ||
private MetricEnum.SubMetric subMetric; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
.../java/org/cardanofoundation/lob/app/accounting_reporting_core/mapper/ChartViewMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.cardanofoundation.lob.app.accounting_reporting_core.mapper; | ||
|
||
import org.cardanofoundation.lob.app.accounting_reporting_core.domain.entity.metric.ChartEntity; | ||
import org.cardanofoundation.lob.app.accounting_reporting_core.resource.views.metric.ChartView; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
|
||
@Mapper(componentModel = "spring") | ||
public interface ChartViewMapper { | ||
|
||
@Mapping(target = "xPos", source = "chartView.XPos") | ||
@Mapping(target = "yPos", source = "chartView.YPos") | ||
ChartEntity toChartEntity(ChartView chartView); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
.../cardanofoundation/lob/app/accounting_reporting_core/resource/views/metric/ChartView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.cardanofoundation.lob.app.accounting_reporting_core.resource.views.metric; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import org.cardanofoundation.lob.app.accounting_reporting_core.domain.core.metric.MetricEnum; | ||
|
||
@Getter | ||
@Setter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class ChartView { | ||
|
||
private Double xPos; | ||
private Double yPos; | ||
private Double width; | ||
private Double height; | ||
private MetricEnum metric; | ||
private MetricEnum.SubMetric subMetric; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters