Skip to content

Commit

Permalink
Merge pull request #306 from flickmatch/pass-mutations
Browse files Browse the repository at this point in the history
Added cityId for subscription.
  • Loading branch information
sam5102 authored Sep 21, 2024
2 parents 0f25928 + c35767d commit d90520b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public void setSubscriptionId(String subscriptionId) {
private Integer gamesLeft;

private String expiryDate;
private String cityId;

public String getStatus() {
return status;
Expand Down Expand Up @@ -76,6 +77,14 @@ public void setExpiryDate(String expiryDate) {
this.expiryDate = expiryDate;
}

public String getCityId() {
return cityId;
}

public void setCityId(String cityId) {
this.cityId = cityId;
}

// This is a composite key made up of userId and subscriptionId
@Id
private SubscriptionKey subscriptionKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public MutationResult createSubscription(String email, String passId) {
.gamesLeft(gamesLeft)
.status("Active")
.expiryDate(expiryDate)
.cityId(pass.getCityId())
.build();

log.error(subscription.toString());
Expand Down Expand Up @@ -156,6 +157,7 @@ com.flickmatch.platform.graphql.type.Subscription mapEventToGQLType(Subscription
.expiryDate(subs.getExpiryDate())
.gamesLeft(subs.getGamesLeft())
.status(subs.getStatus())
.cityId(subs.getCityId())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ public class Subscription {
private String passId;
private String userId;
private Integer gamesLeft;

private String cityId;
private String expiryDate;
}
1 change: 1 addition & 0 deletions platform/src/main/resources/graphql/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ type Subscription {
expiryDate: String!
gamesLeft: Int!
status: String!
cityId: String!
}

type Pass {
Expand Down

0 comments on commit d90520b

Please sign in to comment.