diff options
author | gjoranv <gjoranv@gmail.com> | 2023-10-09 15:51:23 +0200 |
---|---|---|
committer | gjoranv <gjoranv@gmail.com> | 2023-10-09 15:51:23 +0200 |
commit | 2856e1071e4f7ce522b5255128fe7dd66e282946 (patch) | |
tree | 05715aa1b0e958f1bc8f80ce42aa467b99752e0f /controller-api/src/main | |
parent | 01ae49a304ea91c8a83a2dc2f7bf8d7e7cf8e16f (diff) |
Add exportedId to Bill and Bill.LineItem
Diffstat (limited to 'controller-api/src/main')
-rw-r--r-- | controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/billing/Bill.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/billing/Bill.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/billing/Bill.java index 664669d8e55..271424d26b4 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/billing/Bill.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/billing/Bill.java @@ -42,14 +42,22 @@ public class Bill { private final StatusHistory statusHistory; private final ZonedDateTime startTime; private final ZonedDateTime endTime; + private final String exportedId; - public Bill(Id id, TenantName tenant, StatusHistory statusHistory, List<LineItem> lineItems, ZonedDateTime startTime, ZonedDateTime endTime) { + public Bill(Id id, TenantName tenant, StatusHistory statusHistory, List<LineItem> lineItems, + ZonedDateTime startTime, ZonedDateTime endTime) { + this(id, tenant, statusHistory, lineItems, startTime, endTime, null); + } + + public Bill(Id id, TenantName tenant, StatusHistory statusHistory, List<LineItem> lineItems, + ZonedDateTime startTime, ZonedDateTime endTime, String exportedId) { this.id = id; this.tenant = tenant; this.lineItems = List.copyOf(lineItems); this.statusHistory = statusHistory; this.startTime = startTime; this.endTime = endTime; + this.exportedId = exportedId; } public Id id() { @@ -80,6 +88,10 @@ public class Bill { return endTime; } + public Optional<String> getExportedId() { + return Optional.ofNullable(exportedId); + } + public LocalDate getStartDate() { return startTime.toLocalDate(); } @@ -196,6 +208,7 @@ public class Bill { private BigDecimal gpuCost; private NodeResources.Architecture architecture; private int majorVersion; + private String exportedId; public LineItem(String id, String description, BigDecimal amount, String plan, String agent, ZonedDateTime addedAt) { this.id = id; @@ -207,7 +220,8 @@ public class Bill { } public LineItem(String id, String description, BigDecimal amount, String plan, String agent, ZonedDateTime addedAt, ZonedDateTime startedAt, ZonedDateTime endedAt, ApplicationId applicationId, ZoneId zoneId, - BigDecimal cpuHours, BigDecimal memoryHours, BigDecimal diskHours, BigDecimal gpuHours, BigDecimal cpuCost, BigDecimal memoryCost, BigDecimal diskCost, BigDecimal gpuCost, NodeResources.Architecture architecture, int majorVersion) { + BigDecimal cpuHours, BigDecimal memoryHours, BigDecimal diskHours, BigDecimal gpuHours, BigDecimal cpuCost, BigDecimal memoryCost, BigDecimal diskCost, BigDecimal gpuCost, + NodeResources.Architecture architecture, int majorVersion, String exportedId) { this(id, description, amount, plan, agent, addedAt); this.startedAt = startedAt; this.endedAt = endedAt; @@ -319,6 +333,10 @@ public class Bill { return majorVersion; } + public Optional<String> getExportedId() { + return Optional.ofNullable(exportedId); + } + @Override public boolean equals(Object o) { if (this == o) return true; |