899899 * <li>Added {@link #projectPaymentConfigFile}</li>
900900 * <li>Added {@link #MANUAL_PAYMENT}</li>
901901 * </ul>
902+ *
903+ * Version 3.10: Fix end date for registration on activating challenge
904+ * <ul>
905+ * <li>Added {@link #purchaseActivateContestAndStartSpecReview(TCSubject, SoftwareCompetition, TCPurhcaseOrderPaymentData, Date, Date, boolean)}</li>
906+ * <li>Added {@link #processContestPurchaseOrderSale(TCSubject, SoftwareCompetition, TCPurhcaseOrderPaymentData, Date, Date, Date)}</li>
907+ * <li>Updated {@link #processContestSaleInternal(TCSubject, SoftwareCompetition, PaymentData, Date, Date, Date)}</li>
908+ * </ul>
909+ *
902910 * @author snow01, pulky, murphydog, waits, BeBetter, hohosky, isv, tangzx, GreatKevin, lmmortal, minhu, GreatKevin, tangzx
903911 * @author isv, GreatKevin, Veve, deedee, TCSCODER, TCSASSEMBLER
904- * @version 3.9
912+ * @version 3.10
905913 */
906914@ Stateless
907915@ TransactionManagement (TransactionManagementType .CONTAINER )
@@ -2170,7 +2178,7 @@ public SoftwareContestPaymentResult processContestCreditCardSale(TCSubject tcSub
21702178 SoftwareCompetition competition , CreditCardPaymentData paymentData ) throws ContestServiceException , PermissionServiceException {
21712179 logger .debug ("processContestCreditCardSale" );
21722180
2173- return processContestSaleInternal (tcSubject , competition , paymentData , null , null );
2181+ return processContestSaleInternal (tcSubject , competition , paymentData , null , null , null );
21742182 }
21752183
21762184 /**
@@ -2194,7 +2202,7 @@ public SoftwareContestPaymentResult processContestCreditCardSale(TCSubject tcSub
21942202 SoftwareCompetition competition , CreditCardPaymentData paymentData , Date multiRoundEndDate , Date endDate ) throws ContestServiceException , PermissionServiceException {
21952203 logger .debug ("processContestCreditCardSale" );
21962204
2197- return processContestSaleInternal (tcSubject , competition , paymentData , multiRoundEndDate , endDate );
2205+ return processContestSaleInternal (tcSubject , competition , paymentData , null , multiRoundEndDate , endDate );
21982206 }
21992207
22002208 /**
@@ -2216,7 +2224,7 @@ public SoftwareContestPaymentResult processContestPurchaseOrderSale(TCSubject tc
22162224 SoftwareCompetition competition , TCPurhcaseOrderPaymentData paymentData ) throws ContestServiceException , PermissionServiceException {
22172225 logger .debug ("processPurchaseOrderSale" );
22182226
2219- return processContestSaleInternal (tcSubject , competition , paymentData , null , null );
2227+ return processContestSaleInternal (tcSubject , competition , paymentData , null , null , null );
22202228 }
22212229
22222230 /**
@@ -2240,9 +2248,33 @@ public SoftwareContestPaymentResult processContestPurchaseOrderSale(TCSubject tc
22402248 SoftwareCompetition competition , TCPurhcaseOrderPaymentData paymentData , Date multiRoundEndDate , Date endDate ) throws ContestServiceException , PermissionServiceException {
22412249 logger .debug ("processPurchaseOrderSale" );
22422250
2243- return processContestSaleInternal (tcSubject , competition , paymentData , multiRoundEndDate , endDate );
2251+ return processContestSaleInternal (tcSubject , competition , paymentData , null , multiRoundEndDate , endDate );
22442252 }
22452253
2254+ /**
2255+ * <p>
2256+ * Processes the contest sale.
2257+ * </p>
2258+ *
2259+ * @param tcSubject TCSubject instance contains the login security info for the current user
2260+ * @param competition data that recognizes a contest.
2261+ * @param paymentData payment information (credit card/po details) that need to be processed.
2262+ * @param multiRoundEndDate the end date for registration phase.
2263+ * @param multiRoundEndDate the end date for the multiround phase. No multiround if it's null.
2264+ * @param endDate the end date for submission phase. Can be null if to use default.
2265+ * @return a <code>SoftwareContestPaymentResult</code> result of the payment processing.
2266+ * @throws ContestServiceException if an error occurs when interacting with the service layer.
2267+ * @since Module Contest Service Software Contest Sales Assembly
2268+ * @since 3.10
2269+ */
2270+ public SoftwareContestPaymentResult processContestPurchaseOrderSale (TCSubject tcSubject ,
2271+ SoftwareCompetition competition , TCPurhcaseOrderPaymentData paymentData ,
2272+ Date regEndDate , Date multiRoundEndDate , Date endDate )
2273+ throws ContestServiceException , PermissionServiceException {
2274+ logger .debug ("processPurchaseOrderSale" );
2275+
2276+ return processContestSaleInternal (tcSubject , competition , paymentData , regEndDate , multiRoundEndDate , endDate );
2277+ }
22462278
22472279 /**
22482280 * <p>
@@ -2262,13 +2294,38 @@ public SoftwareContestPaymentResult processContestPurchaseOrderSale(TCSubject tc
22622294 * @since 1.8.5
22632295 */
22642296 public SoftwareContestPaymentResult purchaseActivateContestAndStartSpecReview (TCSubject tcSubject ,
2265- SoftwareCompetition competition , TCPurhcaseOrderPaymentData paymentData ,
2297+ SoftwareCompetition competition , TCPurhcaseOrderPaymentData paymentData ,
2298+ Date multiRoundEndDate , Date endDate , boolean startSpecReviewNow ) throws ContestServiceException ,
2299+ PermissionServiceException , SpecificationReviewServiceException {
2300+ return purchaseActivateContestAndStartSpecReview (tcSubject , competition , paymentData , null , multiRoundEndDate , endDate , startSpecReviewNow );
2301+ }
2302+
2303+ /**
2304+ * <p>
2305+ * Processes the contest sale, activate the contest and start the specification review of the contest.
2306+ * </p>
2307+ *
2308+ * @param tcSubject TCSubject instance contains the login security info for the current user
2309+ * @param competition data that recognizes a contest.
2310+ * @param paymentData payment information (TCSubject tcSubject,credit card/po details) that need to be processed.
2311+ * @param regEndDate the end date for registration phase.
2312+ * @param multiRoundEndDate the end date for the multiround phase. No multiround if it's null.
2313+ * @param endDate the end date for submission phase. Can be null if to use default.
2314+ * @param startSpecReviewNow the flag whether to start spec review now.
2315+ * @return a <code>PaymentResult</code> result of the payment processing.
2316+ * @throws ContestServiceException if an error occurs when interacting with the service layer.
2317+ * @throws PermissionServiceException if there is error when assigning permission to user.
2318+ * @throws SpecificationReviewServiceException if fail to start the spec review of the contest.
2319+ * @since 3.10
2320+ */
2321+ public SoftwareContestPaymentResult purchaseActivateContestAndStartSpecReview (TCSubject tcSubject ,
2322+ SoftwareCompetition competition , TCPurhcaseOrderPaymentData paymentData , Date regEndDate ,
22662323 Date multiRoundEndDate , Date endDate , boolean startSpecReviewNow ) throws ContestServiceException ,
22672324 PermissionServiceException , SpecificationReviewServiceException {
22682325
22692326 // purchase the contest and activate it
22702327 final SoftwareContestPaymentResult softwareContestPaymentResult =
2271- processContestSaleInternal (tcSubject , competition , paymentData , multiRoundEndDate , endDate );
2328+ processContestSaleInternal (tcSubject , competition , paymentData , regEndDate , multiRoundEndDate , endDate );
22722329
22732330 // check if the contest has specification review phase
22742331 final Set <com .topcoder .project .phases .Phase > allPhases =
@@ -2320,6 +2377,7 @@ public SoftwareContestPaymentResult purchaseActivateContestAndStartSpecReview(TC
23202377 * @param tcSubject TCSubject instance contains the login security info for the current user
23212378 * @param competition data that recognizes a contest.
23222379 * @param paymentData payment information (credit card/po details) that need to be processed.
2380+ * @param regEndDate the end date for registration phase.
23232381 * @param multiRoundEndDate the end date for the multiround phase. No multiround if it's null.
23242382 * @param endDate the end date for submission phase. Can be null if to use default.
23252383 * @return a <code>SoftwareContestPaymentResult</code> result of the payment processing.
@@ -2328,7 +2386,7 @@ public SoftwareContestPaymentResult purchaseActivateContestAndStartSpecReview(TC
23282386 * @since BUGR-1682 changed return value
23292387 */
23302388 private SoftwareContestPaymentResult processContestSaleInternal (TCSubject tcSubject ,
2331- SoftwareCompetition competition , PaymentData paymentData , Date multiRoundEndDate , Date endDate ) throws ContestServiceException , PermissionServiceException {
2389+ SoftwareCompetition competition , PaymentData paymentData , Date regEndDate , Date multiRoundEndDate , Date endDate ) throws ContestServiceException , PermissionServiceException {
23322390 logger .info ("SoftwareCompetition: " + competition );
23332391 logger .info ("PaymentData: " + paymentData );
23342392 logger .info ("tcSubject: " + tcSubject .getUserId ());
@@ -2364,13 +2422,13 @@ private SoftwareContestPaymentResult processContestSaleInternal(TCSubject tcSubj
23642422
23652423 if (tobeUpdatedCompetition == null ) {
23662424 tobeUpdatedCompetition =
2367- createSoftwareContest (tcSubject , competition , competition .getProjectHeader ().getTcDirectProjectId (), null , multiRoundEndDate , endDate );
2425+ createSoftwareContest (tcSubject , competition , competition .getProjectHeader ().getTcDirectProjectId (), regEndDate , multiRoundEndDate , endDate );
23682426 competition .getProjectHeader ().setProjectStatus (ProjectStatus .ACTIVE );
23692427 } else {
23702428 competition .setProjectHeaderReason ("User Update" );
23712429 competition .getProjectHeader ().setProjectStatus (ProjectStatus .ACTIVE );
23722430 tobeUpdatedCompetition =
2373- updateSoftwareContest (tcSubject , competition , competition .getProjectHeader ().getTcDirectProjectId (), null , multiRoundEndDate , endDate );
2431+ updateSoftwareContest (tcSubject , competition , competition .getProjectHeader ().getTcDirectProjectId (), regEndDate , multiRoundEndDate , endDate );
23742432 }
23752433
23762434 Project contest = tobeUpdatedCompetition .getProjectHeader ();
0 commit comments