Index: branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/SalesRepUnavailabilityFunctionalSpec.groovy =================================================================== diff -u -r9529 -r9547 --- branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/SalesRepUnavailabilityFunctionalSpec.groovy (.../SalesRepUnavailabilityFunctionalSpec.groovy) (revision 9529) +++ branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/SalesRepUnavailabilityFunctionalSpec.groovy (.../SalesRepUnavailabilityFunctionalSpec.groovy) (revision 9547) @@ -206,11 +206,14 @@ def 'can NOT create an invalid SalesmanUnavailability with a bad salesmanId'() { given: String json = ''' + { + "SalesmanUnavailability": { "salesmanId": "_", "unavailabilityReasonId": 1, "startDate": "05/01/2015" } + } ''' path() ok() @@ -234,10 +237,13 @@ Date now = new Date() String date = formatDate(now, 'MM/dd/yyyy HH:MM:SS') String json = """{ + "SalesmanUnavailability": + { "salesmanId": "72", "unavailabilityReasonId": -1, "startDate": "05/01/2015", "dateDeleted": "${date}" + } }""" path() ok() @@ -260,9 +266,13 @@ Date now = new Date() String date = formatDate(now, 'MM/dd/yyyy HH:MM:SS') String json = """{ + "SalesmanUnavailability": + { "salesmanId": "152", "unavailabilityReasonId": "", - "startDate": "${date}"} + "startDate": "${date}" + } + } """ path() ok() @@ -283,9 +293,12 @@ def 'can NOT create an invalid SalesmanUnavailability with no startDate'() { given: String json ='''{ + "SalesmanUnavailability": + { "salesmanId": "152", "unavailabilityReasonId": "1", "startDate": "" + } }''' path() ok() @@ -308,10 +321,13 @@ Date now = new Date() String date = formatDate(now, 'MM/dd/yyyy HH:MM:SS') String json = """{ + "SalesmanUnavailability": + { "salesmanId": "72", "unavailabilityReasonId": 1, "startDate": "${date}", "halfDay": false + } }""" path() ok() @@ -333,9 +349,12 @@ given: String json = ''' { + "SalesmanUnavailability": + { "salesmanId": "7777777", "unavailabilityReasonId": 1, "comment": "testComment" + } } ''' path('113') @@ -357,10 +376,13 @@ def 'can update a valid SalesmanUnavailability'() { given: String json = '''{ + "SalesmanUnavailability": + { "salesmanId": "72", "unavailabilityReasonId": 1, "comment": "Test Comment", "halfDay": false + } }''' path('113') ok() Index: branches/grails3_dealer-service/grails-app/controllers/com/lemans/sales/goals/SalesGoalParticipantController.groovy =================================================================== diff -u -r9491 -r9547 --- branches/grails3_dealer-service/grails-app/controllers/com/lemans/sales/goals/SalesGoalParticipantController.groovy (.../SalesGoalParticipantController.groovy) (revision 9491) +++ branches/grails3_dealer-service/grails-app/controllers/com/lemans/sales/goals/SalesGoalParticipantController.groovy (.../SalesGoalParticipantController.groovy) (revision 9547) @@ -36,7 +36,7 @@ } private save(Integer id) { - Map values = request.JSON + Map values = request.JSON.SalesGoalParticipant if (!id) { values.salesGoalId = params.salesGoal } Index: branches/grails3_dealer-service/grails-app/controllers/com/lemans/sales/goals/SalesGoalFrequencyController.groovy =================================================================== diff -u -r9489 -r9547 --- branches/grails3_dealer-service/grails-app/controllers/com/lemans/sales/goals/SalesGoalFrequencyController.groovy (.../SalesGoalFrequencyController.groovy) (revision 9489) +++ branches/grails3_dealer-service/grails-app/controllers/com/lemans/sales/goals/SalesGoalFrequencyController.groovy (.../SalesGoalFrequencyController.groovy) (revision 9547) @@ -35,7 +35,7 @@ } private save(Integer id) { - Map values = request.JSON + Map values = request.JSON.SalesGoalFrequency if (!id) { values.salesGoalId = params.salesGoal } SalesGoalFrequency salesGoalFrequency try { Index: branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/goals/SalesGoalParticipantFunctionalSpec.groovy =================================================================== diff -u -r9492 -r9547 --- branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/goals/SalesGoalParticipantFunctionalSpec.groovy (.../SalesGoalParticipantFunctionalSpec.groovy) (revision 9492) +++ branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/goals/SalesGoalParticipantFunctionalSpec.groovy (.../SalesGoalParticipantFunctionalSpec.groovy) (revision 9547) @@ -63,7 +63,7 @@ def 'can NOT create an invalid new SalesGoalParticipant'() { given: - String json = '{ "participantType": "Rep", "participantCode": "" }' + String json = '{ "SalesGoalParticipant": { "participantType": "Rep", "participantCode": "" }}' path(salesGoal: 17) expectedStatusCode = 412 @@ -77,7 +77,7 @@ def 'can NOT create a duplicate new SalesGoalParticipant'() { given: - String json = '{ "participantType": "REP", "participantCode": "346" }' + String json = '{ "SalesGoalParticipant": { "participantType": "REP", "participantCode": "346" }}' path(salesGoal: 17) expectedStatusCode = 412 @@ -90,7 +90,7 @@ def 'can NOT update an invalid SalesGoalParticipant'() { given: - String json = '{ "participantCode": "" }' + String json = '{"SalesGoalParticipant": { "participantCode": "" }}' path(salesGoal: 17, '173') expectedStatusCode = 412 @@ -104,7 +104,7 @@ def 'can update a valid SalesGoalParticipant'() { given: - String json = '{ "participantType": "Rep", "participantCode": "164" }' + String json = '{ "SalesGoalParticipant": { "participantType": "Rep", "participantCode": "164" }}' int id = 152 path(salesGoal: 17, "$id") ok() Index: branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/goals/SalesGoalFrequencyFunctionalSpec.groovy =================================================================== diff -u -r9489 -r9547 --- branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/goals/SalesGoalFrequencyFunctionalSpec.groovy (.../SalesGoalFrequencyFunctionalSpec.groovy) (revision 9489) +++ branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/goals/SalesGoalFrequencyFunctionalSpec.groovy (.../SalesGoalFrequencyFunctionalSpec.groovy) (revision 9547) @@ -65,7 +65,7 @@ def 'can NOT create an invalid new SalesGoalFrequency'() { given: - String json = '{ "frequencyInterval": "1" }' + String json = '{ "SalesGoalFrequency": { "frequencyInterval": "1" }}' path(salesGoal: 17) expectedStatusCode = 412 @@ -80,9 +80,11 @@ def 'can create a valid new SalesGoalFrequency'() { given: String json = '''{ + "SalesGoalFrequency": { "frequencyType": "1", "frequencyInterval": "1", "frequencyRecurrenceFactor": "0", "frequencyRelativeInterval": "0", "frequencySubdayInterval": "0", "frequencySubdayType": "0" + } }''' path(salesGoal: 17) ok() @@ -99,7 +101,7 @@ def 'can NOT update an invalid SalesGoalFrequency'() { given: - String json = '{ "frequencyType": "0" }' + String json = '{ "SalesGoalFrequency": { "frequencyType": "0" }}' path('176') expectedStatusCode = 412 @@ -113,7 +115,7 @@ def 'can update a valid SalesGoalFrequency'() { given: - String json = '{ "frequencyType": "4" }' + String json = '{ "SalesGoalFrequency": { "frequencyType": "4" }}' int id = 176 path(id) ok() Index: branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/goals/SalesGoalFunctionalSpec.groovy =================================================================== diff -u -r9529 -r9547 --- branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/goals/SalesGoalFunctionalSpec.groovy (.../SalesGoalFunctionalSpec.groovy) (revision 9529) +++ branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/goals/SalesGoalFunctionalSpec.groovy (.../SalesGoalFunctionalSpec.groovy) (revision 9547) @@ -65,7 +65,11 @@ def 'can NOT create an invalid new SalesGoal'() { given: - String json = """{ "goalName": "someGoal", "endDate": "$endDate", "startDate": "$startDate" }""" + String json = """{ + "SalesGoal" : { + "goalName": "someGoal", "endDate": "$endDate", "startDate": "$startDate" + } + }""" path() expectedStatusCode = 412 @@ -81,6 +85,7 @@ given: String json = """ { + "SalesGoal": { "goalName": "AGoal", "startDate": "$startDate", "endDate": "$endDate", @@ -90,6 +95,7 @@ "goalValue": 1000, "compareToLY": true, "salesGoalOutputTypeId": 61 + } } """ queryParams.dfs = 'iso' @@ -117,7 +123,7 @@ def 'can NOT update an invalid SalesGoal'() { given: - String json = '{ "salesGoalId": "3", "goalUoM": " " }' + String json = '{ "SalesGoal": {"salesGoalId": "3", "goalUoM": " " }}' int id = 3 path(id) expectedStatusCode = 412 @@ -133,7 +139,7 @@ def 'can update a valid SalesGoal'() { given: - String json = '{ "goalUoM": "D" }' + String json = '{ "SalesGoal": { "goalUoM": "D" }}' int id = 3 path(id) ok() Index: branches/grails3_dealer-service/grails-app/controllers/com/lemans/sales/goals/SalesGoalController.groovy =================================================================== diff -u -r9510 -r9547 --- branches/grails3_dealer-service/grails-app/controllers/com/lemans/sales/goals/SalesGoalController.groovy (.../SalesGoalController.groovy) (revision 9510) +++ branches/grails3_dealer-service/grails-app/controllers/com/lemans/sales/goals/SalesGoalController.groovy (.../SalesGoalController.groovy) (revision 9547) @@ -33,7 +33,7 @@ } private save(Integer id = null) { - SalesGoal salesGoal = salesGoalManagerService.saveSalesGoal(request.JSON, id, auditUserName) + SalesGoal salesGoal = salesGoalManagerService.saveSalesGoal(request.JSON.SalesGoal, id, auditUserName) if (salesGoal.hasErrors()) { response.status = 412 render toJson(collectLegacyErrors(salesGoal)) Index: branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/goals/SalesGoalCriteriaFunctionalSpec.groovy =================================================================== diff -u -r9485 -r9547 --- branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/goals/SalesGoalCriteriaFunctionalSpec.groovy (.../SalesGoalCriteriaFunctionalSpec.groovy) (revision 9485) +++ branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/goals/SalesGoalCriteriaFunctionalSpec.groovy (.../SalesGoalCriteriaFunctionalSpec.groovy) (revision 9547) @@ -60,7 +60,7 @@ def 'can NOT create a new duplicate SalesGoalCriteria'() { given: - String json = '{"vendorId": "1691", "exclude": "true" }' + String json = '{ "SalesGoalCriteria": { "vendorId": "1691", "exclude": "true" }}' path(salesGoal: 17) expectedStatusCode = 412 @@ -73,7 +73,7 @@ def 'can NOT update an invalid SalesGoalCriteria'() { given: - String json = '{ "salesGoalId": "" }' + String json = '{ "SalesGoalCriteria": { "salesGoalId": "" }}' path('225') expectedStatusCode = 412 @@ -87,7 +87,7 @@ def 'can NOT update a SalesGoalCriteria with an invalid vendorId'() { given: - String json = '{ "vendorId": "xascf5" }' + String json = '{ "SalesGoalCriteria": { "vendorId": "xascf5" }}' path('225') expectedStatusCode = 412 @@ -101,7 +101,7 @@ def 'can NOT update a SalesGoalCriteria with an invalid brandId'() { given: - String json = '{ "brandId": "-1" }' + String json = '{ "SalesGoalCriteria": { "brandId": "-1" }}' path('225') expectedStatusCode = 412 @@ -115,7 +115,7 @@ def 'can NOT update a SalesGoalCriteria with an unparseable brandId'() { given: - String json = '{ "brandId": "shdvc" }' + String json = '{ "SalesGoalCriteria": { "brandId": "shdvc" }}' path('225') expectedStatusCode = 412 @@ -129,7 +129,7 @@ def 'can NOT update a SalesGoalCriteria with an invalid comCodeId'() { given: - String json = '{ "comCodeId": "-1" }' + String json = '{ "SalesGoalCriteria": { "comCodeId": "-1" }}' path('225') expectedStatusCode = 412 @@ -143,7 +143,7 @@ def 'can NOT update a SalesGoalCriteria with multiple invalid properties'() { given: - String json = '{ "brandId": "-1", "vendorId": "-1", "comCodeId": "-1", "subComCodeId": "-1" }' + String json = '{ "SalesGoalCriteria": { "brandId": "-1", "vendorId": "-1", "comCodeId": "-1", "subComCodeId": "-1" }}' path('225') expectedStatusCode = 412 @@ -156,7 +156,7 @@ def 'can NOT update a SalesGoalCriteria with an invalid subComCodeId'() { given: - String json = '{ "subComCodeId": "-1" }' + String json = '{ "SalesGoalCriteria": { "subComCodeId": "-1" }}' path('225') expectedStatusCode = 412 @@ -170,7 +170,7 @@ def 'can NOT update a SalesGoalCriteria with an invalid productCode'() { given: - String json = '{ "productCode": "dwe7" }' + String json = '{ "SalesGoalCriteria": {"productCode": "dwe7" }}' path('225') expectedStatusCode = 412 @@ -184,7 +184,7 @@ def 'can NOT update a SalesGoalCriteria with an invalid partNumber'() { given: - String json = '{ "partNumber": "cv76dgb" }' + String json = '{ "SalesGoalCriteria": {"partNumber": "cv76dgb" }}' expectedStatusCode = 412 path('225') expectedStatusCode = 412 @@ -199,7 +199,7 @@ def 'can update a SalesGoalCriteria with a valid partNumber'() { given: - String json = '{ "partNumber": "b8es" }' + String json = '{ "SalesGoalCriteria": { "partNumber": "b8es" }}' path('225') ok() @@ -216,7 +216,7 @@ def 'can update a valid SalesGoalCriteria'() { given: - String json = '{ "exclude": "1" }' + String json = '{ "SalesGoalCriteria": { "exclude": "1" }}' path('224') ok() Index: branches/grails3_dealer-service/grails-app/controllers/com/lemans/sales/SalesRepUnavailabilityController.groovy =================================================================== diff -u -r9498 -r9547 --- branches/grails3_dealer-service/grails-app/controllers/com/lemans/sales/SalesRepUnavailabilityController.groovy (.../SalesRepUnavailabilityController.groovy) (revision 9498) +++ branches/grails3_dealer-service/grails-app/controllers/com/lemans/sales/SalesRepUnavailabilityController.groovy (.../SalesRepUnavailabilityController.groovy) (revision 9547) @@ -42,7 +42,7 @@ } private save(Integer id) { - Map values = request.JSON + Map values = request.JSON.SalesmanUnavailability List errors = [] salesmanId(values.salesmanId, errors) if (values.unavailabilityReasonId) { @@ -53,7 +53,6 @@ render toJson(legacyPackage(errors: errors)) return } - SalesmanUnavailability unavailability = salesRepManagerService.saveSalesmanUnavailability(values, id, auditUserName) if (unavailability.hasErrors()) { render toJson(legacyPackage(errors: collectLegacyErrors(unavailability))) } else { show(unavailability.id) } Index: branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/goals/SalesGoalParticipantPersistenceFunctionalSpec.groovy =================================================================== diff -u -r9529 -r9547 --- branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/goals/SalesGoalParticipantPersistenceFunctionalSpec.groovy (.../SalesGoalParticipantPersistenceFunctionalSpec.groovy) (revision 9529) +++ branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/goals/SalesGoalParticipantPersistenceFunctionalSpec.groovy (.../SalesGoalParticipantPersistenceFunctionalSpec.groovy) (revision 9547) @@ -16,8 +16,10 @@ given: String json = ''' { + "SalesGoalParticipant": { "participantType": "Rep", "participantCode": "VEN" + } } ''' path(salesGoal: 17) Index: branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/goals/SalesGoalCriteriaPersistenceSpec.groovy =================================================================== diff -u -r9509 -r9547 --- branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/goals/SalesGoalCriteriaPersistenceSpec.groovy (.../SalesGoalCriteriaPersistenceSpec.groovy) (revision 9509) +++ branches/grails3_dealer-service/src/integration-test/groovy/com/lemans/sales/goals/SalesGoalCriteriaPersistenceSpec.groovy (.../SalesGoalCriteriaPersistenceSpec.groovy) (revision 9547) @@ -14,7 +14,7 @@ def 'can create a valid new SalesGoalCriteria'() { given: - String json = ' {} ' + String json = ' {"SalesGoalCriteria": {}} ' path(salesGoal: 39) ok() Index: branches/grails3_dealer-service/grails-app/controllers/com/lemans/sales/goals/SalesGoalCriteriaController.groovy =================================================================== diff -u -r9485 -r9547 --- branches/grails3_dealer-service/grails-app/controllers/com/lemans/sales/goals/SalesGoalCriteriaController.groovy (.../SalesGoalCriteriaController.groovy) (revision 9485) +++ branches/grails3_dealer-service/grails-app/controllers/com/lemans/sales/goals/SalesGoalCriteriaController.groovy (.../SalesGoalCriteriaController.groovy) (revision 9547) @@ -40,7 +40,7 @@ } private save(Integer id) { - Map values = request.JSON + Map values = request.JSON.SalesGoalCriteria values.locale = params.locale if (!id) { values.salesGoalId = params.salesGoal } SalesGoalCriteria salesGoalCriteria