Example #1
0
  public SingleTip(GenericTT tipTicket, GroupTip groupTip) {
    super(groupTip.getDraw());

    this.tipTicket = (TipTicket) tipTicket;

    this.groupTip = groupTip;

    this.submissionDate = Lottery.getInstance().getTimer().getDateTime().toDate();
  }
Example #2
0
  /**
   * [Intended for direct usage by controller][check-method]<br>
   * SIMULATES: Tries to withdraw the tip with all implications which also depends on whether this
   * SingleTip is associated with a GroupTip. This can lead to annulment of the submission of an
   * associated GroupTip.<br>
   *
   * @return
   *     <ul>
   *       <li>0 - successful
   *       <li>-1 - not enough time left until the planned evaluation of the draw
   *       <li>1 - the associated group member would fall under his minimumStake limit (only tested
   *           if minimumStake > 1). Use GroupTip.removeAllTipsOfGroupMember(Customer groupMember)
   *           to withdraw the tips in this case.
   *       <li>2 - can not 'unsubmit' the group tip from draw and therefore not remove tip
   *           <ul>
   */
  public int check_withdraw() {
    if (groupTip == null) {
      if (!draw.isTimeLeftUntilEvaluationForSubmission()) return -1;

      return 0;
    } else {
      return groupTip.check_removeSingleTip(this);
    }
  }
Example #3
0
  /**
   * [Intended for direct usage by controller]<br>
   * Tries to withdraw the tip with all implications which also depends on whether this SingleTip is
   * associated with a GroupTip. This can lead to annulment of the submission of an associated
   * GroupTip.<br>
   *
   * @return
   *     <ul>
   *       <li>0 - successful
   *       <li>-1 - not enough time left until the planned evaluation of the draw
   *       <li>1 - the associated group member would fall under his minimumStake limit (only tested
   *           if minimumStake > 1). Use GroupTip.removeAllTipsOfGroupMember(Customer groupMember)
   *           to withdraw the tips in this case.
   *       <li>2 - can not 'unsubmit' the group tip from draw and therefore not remove tip
   *           <ul>
   */
  public int withdraw() {
    if (groupTip == null) {
      if (!draw.isTimeLeftUntilEvaluationForSubmission()) return -1;

      draw.removeTip(this);
      tipTicket.removeTip(this);

      return 0;
    } else {
      return groupTip.removeSingleTip(this);
    }
  }