-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #691 from motech-implementations/feature
NMS-330
- Loading branch information
Showing
34 changed files
with
537 additions
and
55 deletions.
There are no files selected for viewing
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
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
9 changes: 9 additions & 0 deletions
9
kilkari/src/main/java/org/motechproject/nms/kilkari/domain/AuditStatus.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,9 @@ | ||
package org.motechproject.nms.kilkari.domain; | ||
|
||
/** | ||
* The Audit Status | ||
*/ | ||
public enum AuditStatus { | ||
SUCCESS, | ||
FAILURE | ||
} |
52 changes: 52 additions & 0 deletions
52
kilkari/src/main/java/org/motechproject/nms/kilkari/domain/BlockedMsisdnRecord.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,52 @@ | ||
package org.motechproject.nms.kilkari.domain; | ||
|
||
import org.motechproject.mds.annotations.Entity; | ||
import org.motechproject.mds.annotations.Field; | ||
|
||
import javax.jdo.annotations.Column; | ||
import javax.jdo.annotations.Unique; | ||
import javax.validation.constraints.Max; | ||
import javax.validation.constraints.Min; | ||
import javax.validation.constraints.NotNull; | ||
|
||
/** | ||
* Record of Weekly Calls Not Answered Deactivated Numbers | ||
*/ | ||
@Entity(tableName = "nms_blocked_msisdn") | ||
public class BlockedMsisdnRecord { | ||
|
||
@Field | ||
@Unique | ||
@Min(value = 1000000000L, message = "callingNumber must be 10 digits") | ||
@Max(value = 9999999999L, message = "callingNumber must be 10 digits") | ||
@Column(length = 10, allowsNull = "false") | ||
private Long callingNumber; | ||
|
||
@Field | ||
@NotNull | ||
private DeactivationReason deactivationReason; | ||
|
||
public BlockedMsisdnRecord() { | ||
} | ||
|
||
public BlockedMsisdnRecord(Long callingNumber, DeactivationReason deactivationReason) { | ||
this.callingNumber = callingNumber; | ||
this.deactivationReason = deactivationReason; | ||
} | ||
|
||
public Long getCallingNumber() { | ||
return callingNumber; | ||
} | ||
|
||
public void setCallingNumber(Long callingNumber) { | ||
this.callingNumber = callingNumber; | ||
} | ||
|
||
public DeactivationReason getDeactivationReason() { | ||
return deactivationReason; | ||
} | ||
|
||
public void setDeactivationReason(DeactivationReason deactivationReason) { | ||
this.deactivationReason = deactivationReason; | ||
} | ||
} |
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
107 changes: 107 additions & 0 deletions
107
...c/main/java/org/motechproject/nms/kilkari/domain/DeactivationSubscriptionAuditRecord.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,107 @@ | ||
package org.motechproject.nms.kilkari.domain; | ||
|
||
import org.motechproject.mds.annotations.Entity; | ||
import org.motechproject.mds.annotations.Field; | ||
|
||
import javax.jdo.annotations.Column; | ||
import javax.validation.constraints.NotNull; | ||
|
||
@Entity(tableName = "nms_deactivation_subscription_audit_records") | ||
public class DeactivationSubscriptionAuditRecord { | ||
|
||
public static final int MAX_OUTCOME_LENGTH = 1000; // Includes the "Failure: " string | ||
|
||
@Field | ||
@NotNull | ||
private String subscriptionId; | ||
|
||
@Field | ||
@NotNull | ||
private Long subscriberId; | ||
|
||
@Field | ||
@NotNull | ||
private SubscriptionOrigin subscriptionOrigin; | ||
|
||
@Field | ||
@NotNull | ||
private Long msisdn; | ||
|
||
@Field | ||
@NotNull | ||
private SubscriptionStatus preStatus; | ||
|
||
@Field | ||
@NotNull | ||
private AuditStatus auditStatus; | ||
|
||
@Field | ||
@Column(length = MAX_OUTCOME_LENGTH) | ||
private String outcome; | ||
|
||
public SubscriptionStatus getPreStatus() { | ||
return preStatus; | ||
} | ||
|
||
public void setPreStatus(SubscriptionStatus preStatus) { | ||
this.preStatus = preStatus; | ||
} | ||
|
||
public AuditStatus getAuditStatus() { | ||
return auditStatus; | ||
} | ||
|
||
public void setAuditStatus(AuditStatus auditStatus) { | ||
this.auditStatus = auditStatus; | ||
} | ||
|
||
public String getOutcome() { | ||
return outcome; | ||
} | ||
|
||
public void setOutcome(String outcome) { | ||
this.outcome = outcome; | ||
} | ||
|
||
public String getSubscriptionId() { | ||
return subscriptionId; | ||
} | ||
|
||
public void setSubscriptionId(String subscriptionId) { | ||
this.subscriptionId = subscriptionId; | ||
} | ||
|
||
public Long getSubscriberId() { | ||
return subscriberId; | ||
} | ||
|
||
public void setSubscriberId(Long subscriberId) { | ||
this.subscriberId = subscriberId; | ||
} | ||
|
||
public SubscriptionOrigin getSubscriptionOrigin() { | ||
return subscriptionOrigin; | ||
} | ||
|
||
public void setSubscriptionOrigin(SubscriptionOrigin subscriptionOrigin) { | ||
this.subscriptionOrigin = subscriptionOrigin; | ||
} | ||
|
||
public Long getMsisdn() { | ||
return msisdn; | ||
} | ||
|
||
public void setMsisdn(Long msisdn) { | ||
this.msisdn = msisdn; | ||
} | ||
|
||
public DeactivationSubscriptionAuditRecord(String subscriptionId, Long subscriberId, SubscriptionOrigin subscriptionOrigin, Long msisdn, SubscriptionStatus preStatus, AuditStatus auditStatus, String outcome) { | ||
this.subscriptionId = subscriptionId; | ||
this.subscriberId = subscriberId; | ||
this.subscriptionOrigin = subscriptionOrigin; | ||
this.msisdn = msisdn; | ||
this.preStatus = preStatus; | ||
this.auditStatus = auditStatus; | ||
this.outcome = outcome; | ||
} | ||
} |
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
12 changes: 12 additions & 0 deletions
12
...rc/main/java/org/motechproject/nms/kilkari/repository/BlockedMsisdnRecordDataService.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,12 @@ | ||
package org.motechproject.nms.kilkari.repository; | ||
|
||
import org.motechproject.mds.annotations.Lookup; | ||
import org.motechproject.mds.annotations.LookupField; | ||
import org.motechproject.mds.service.MotechDataService; | ||
import org.motechproject.nms.kilkari.domain.BlockedMsisdnRecord; | ||
|
||
public interface BlockedMsisdnRecordDataService extends MotechDataService<BlockedMsisdnRecord> { | ||
|
||
@Lookup | ||
BlockedMsisdnRecord findByNumber(@LookupField(name = "callingNumber") Long callingNumber); | ||
} |
7 changes: 7 additions & 0 deletions
7
.../motechproject/nms/kilkari/repository/DeactivationSubscriptionAuditRecordDataService.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,7 @@ | ||
package org.motechproject.nms.kilkari.repository; | ||
|
||
import org.motechproject.mds.service.MotechDataService; | ||
import org.motechproject.nms.kilkari.domain.DeactivationSubscriptionAuditRecord; | ||
|
||
public interface DeactivationSubscriptionAuditRecordDataService extends MotechDataService<DeactivationSubscriptionAuditRecord> { | ||
} |
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
Oops, something went wrong.