899
899
* <li>Added {@link #projectPaymentConfigFile}</li>
900
900
* <li>Added {@link #MANUAL_PAYMENT}</li>
901
901
* </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
+ *
902
910
* @author snow01, pulky, murphydog, waits, BeBetter, hohosky, isv, tangzx, GreatKevin, lmmortal, minhu, GreatKevin, tangzx
903
911
* @author isv, GreatKevin, Veve, deedee, TCSCODER, TCSASSEMBLER
904
- * @version 3.9
912
+ * @version 3.10
905
913
*/
906
914
@ Stateless
907
915
@ TransactionManagement (TransactionManagementType .CONTAINER )
@@ -2170,7 +2178,7 @@ public SoftwareContestPaymentResult processContestCreditCardSale(TCSubject tcSub
2170
2178
SoftwareCompetition competition , CreditCardPaymentData paymentData ) throws ContestServiceException , PermissionServiceException {
2171
2179
logger .debug ("processContestCreditCardSale" );
2172
2180
2173
- return processContestSaleInternal (tcSubject , competition , paymentData , null , null );
2181
+ return processContestSaleInternal (tcSubject , competition , paymentData , null , null , null );
2174
2182
}
2175
2183
2176
2184
/**
@@ -2194,7 +2202,7 @@ public SoftwareContestPaymentResult processContestCreditCardSale(TCSubject tcSub
2194
2202
SoftwareCompetition competition , CreditCardPaymentData paymentData , Date multiRoundEndDate , Date endDate ) throws ContestServiceException , PermissionServiceException {
2195
2203
logger .debug ("processContestCreditCardSale" );
2196
2204
2197
- return processContestSaleInternal (tcSubject , competition , paymentData , multiRoundEndDate , endDate );
2205
+ return processContestSaleInternal (tcSubject , competition , paymentData , null , multiRoundEndDate , endDate );
2198
2206
}
2199
2207
2200
2208
/**
@@ -2216,7 +2224,7 @@ public SoftwareContestPaymentResult processContestPurchaseOrderSale(TCSubject tc
2216
2224
SoftwareCompetition competition , TCPurhcaseOrderPaymentData paymentData ) throws ContestServiceException , PermissionServiceException {
2217
2225
logger .debug ("processPurchaseOrderSale" );
2218
2226
2219
- return processContestSaleInternal (tcSubject , competition , paymentData , null , null );
2227
+ return processContestSaleInternal (tcSubject , competition , paymentData , null , null , null );
2220
2228
}
2221
2229
2222
2230
/**
@@ -2240,9 +2248,33 @@ public SoftwareContestPaymentResult processContestPurchaseOrderSale(TCSubject tc
2240
2248
SoftwareCompetition competition , TCPurhcaseOrderPaymentData paymentData , Date multiRoundEndDate , Date endDate ) throws ContestServiceException , PermissionServiceException {
2241
2249
logger .debug ("processPurchaseOrderSale" );
2242
2250
2243
- return processContestSaleInternal (tcSubject , competition , paymentData , multiRoundEndDate , endDate );
2251
+ return processContestSaleInternal (tcSubject , competition , paymentData , null , multiRoundEndDate , endDate );
2244
2252
}
2245
2253
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
+ }
2246
2278
2247
2279
/**
2248
2280
* <p>
@@ -2262,13 +2294,38 @@ public SoftwareContestPaymentResult processContestPurchaseOrderSale(TCSubject tc
2262
2294
* @since 1.8.5
2263
2295
*/
2264
2296
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 ,
2266
2323
Date multiRoundEndDate , Date endDate , boolean startSpecReviewNow ) throws ContestServiceException ,
2267
2324
PermissionServiceException , SpecificationReviewServiceException {
2268
2325
2269
2326
// purchase the contest and activate it
2270
2327
final SoftwareContestPaymentResult softwareContestPaymentResult =
2271
- processContestSaleInternal (tcSubject , competition , paymentData , multiRoundEndDate , endDate );
2328
+ processContestSaleInternal (tcSubject , competition , paymentData , regEndDate , multiRoundEndDate , endDate );
2272
2329
2273
2330
// check if the contest has specification review phase
2274
2331
final Set <com .topcoder .project .phases .Phase > allPhases =
@@ -2320,6 +2377,7 @@ public SoftwareContestPaymentResult purchaseActivateContestAndStartSpecReview(TC
2320
2377
* @param tcSubject TCSubject instance contains the login security info for the current user
2321
2378
* @param competition data that recognizes a contest.
2322
2379
* @param paymentData payment information (credit card/po details) that need to be processed.
2380
+ * @param regEndDate the end date for registration phase.
2323
2381
* @param multiRoundEndDate the end date for the multiround phase. No multiround if it's null.
2324
2382
* @param endDate the end date for submission phase. Can be null if to use default.
2325
2383
* @return a <code>SoftwareContestPaymentResult</code> result of the payment processing.
@@ -2328,7 +2386,7 @@ public SoftwareContestPaymentResult purchaseActivateContestAndStartSpecReview(TC
2328
2386
* @since BUGR-1682 changed return value
2329
2387
*/
2330
2388
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 {
2332
2390
logger .info ("SoftwareCompetition: " + competition );
2333
2391
logger .info ("PaymentData: " + paymentData );
2334
2392
logger .info ("tcSubject: " + tcSubject .getUserId ());
@@ -2364,13 +2422,13 @@ private SoftwareContestPaymentResult processContestSaleInternal(TCSubject tcSubj
2364
2422
2365
2423
if (tobeUpdatedCompetition == null ) {
2366
2424
tobeUpdatedCompetition =
2367
- createSoftwareContest (tcSubject , competition , competition .getProjectHeader ().getTcDirectProjectId (), null , multiRoundEndDate , endDate );
2425
+ createSoftwareContest (tcSubject , competition , competition .getProjectHeader ().getTcDirectProjectId (), regEndDate , multiRoundEndDate , endDate );
2368
2426
competition .getProjectHeader ().setProjectStatus (ProjectStatus .ACTIVE );
2369
2427
} else {
2370
2428
competition .setProjectHeaderReason ("User Update" );
2371
2429
competition .getProjectHeader ().setProjectStatus (ProjectStatus .ACTIVE );
2372
2430
tobeUpdatedCompetition =
2373
- updateSoftwareContest (tcSubject , competition , competition .getProjectHeader ().getTcDirectProjectId (), null , multiRoundEndDate , endDate );
2431
+ updateSoftwareContest (tcSubject , competition , competition .getProjectHeader ().getTcDirectProjectId (), regEndDate , multiRoundEndDate , endDate );
2374
2432
}
2375
2433
2376
2434
Project contest = tobeUpdatedCompetition .getProjectHeader ();
0 commit comments