Skip to content

Commit 4226c5f

Browse files
altJakekkupreeva
andauthored
v5.0.2: fix notification campaign class enum missing values (#36)
## Problem Notification's campaign entity is built on top of Campaign's original `StateEnum`, but extending it with a few more calculated-derived states for communicating those to the consumers. These are not part of the original enum and therefore the constructor of the Campaign Class fails when initiating such instances ## Solution Extend the `StateEnum` to support the full range of values: - `ENABLED` : enabled - `DISABLED` : disabled - `ARCHIVED` : archived - `EXPIRED` : expired - `SCHEDULED` : scheduled - `RUNNING` : running - `DRAFT` : draft Co-authored-by: Kristina Kupreeva <kristine.kupreeva@gmail.com>
1 parent 149a646 commit 4226c5f

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

docs/Campaign.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ Name | Value
5454
ENABLED | &quot;enabled&quot;
5555
DISABLED | &quot;disabled&quot;
5656
ARCHIVED | &quot;archived&quot;
57-
57+
EXPIRED | &quot;expired&quot;
58+
SCHEDULED | &quot;scheduled&quot;
59+
RUNNING | &quot;running&quot;
60+
DRAFT | &quot;draft&quot;
5861

5962

6063
## Enum: List&lt;FeaturesEnum&gt;

src/main/java/one/talon/model/Campaign.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,18 @@ public class Campaign {
7878
@JsonAdapter(StateEnum.Adapter.class)
7979
public enum StateEnum {
8080
ENABLED("enabled"),
81-
81+
8282
DISABLED("disabled"),
83-
84-
ARCHIVED("archived");
83+
84+
ARCHIVED("archived"),
85+
86+
EXPIRED("expired"),
87+
88+
SCHEDULED("scheduled"),
89+
90+
RUNNING("running"),
91+
92+
DRAFT("draft");
8593

8694
private String value;
8795

0 commit comments

Comments
 (0)