Skip to content

Commit

Permalink
Add test for AC4
Browse files Browse the repository at this point in the history
  • Loading branch information
Lim Sim committed Jan 10, 2025
1 parent 5bd4a26 commit f018838
Show file tree
Hide file tree
Showing 43 changed files with 2,944 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Btms.Backend.IntegrationTests/DecisionTests/SingleChedH02Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,23 @@ public void SingleChed_ShouldHaveH02CheckValues()
}
}

[Trait("Category", "Integration")]
public class MultiChedDecisionTest(ITestOutputHelper output)
: ScenarioGeneratorBaseTest<MultiChedPMatchScenarioGenerator>(output)
{
[Fact]
public void MultiChed_ShouldHaveH01CheckValues()
{
string decisionCode = "";
var expectedDecision = "H02";
var movements = Client.AsJsonApiClient().Get("api/movements").GetResourceObjects<Movement>().Single().Decisions
.OrderBy(x => x.ServiceHeader?.ServiceCalled).Last().Items!
.All(i =>
{
decisionCode = i.Checks!.First().DecisionCode!;

return decisionCode.Equals(expectedDecision);
}).Should().BeTrue($"Expected {expectedDecision}. Actually {{0}}", decisionCode);
;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"serviceHeader":{"sourceSystem":"CDS","destinationSystem":"ALVS","correlationId":"1315562","serviceCallTimestamp":1733315286000},"header":{"entryReference":"24GBDFPIYGN8YKQAR3","entryVersionNumber":1,"previousVersionNumber":null,"declarationUCR":"4GB279214189000-CL7238","declarationPartNumber":null,"declarationType":"S","arrivalDateTime":null,"submitterTURN":null,"declarantId":"GB279214189000","declarantName":"GB279214189000","dispatchCountryCode":"AE","goodsLocationCode":"LHRLHRLHR","masterUCR":"HARC17602480634"},"items":[{"itemNumber":1,"customsProcedureCode":"4000000","taricCommodityCode":"0106190000","goodsDescription":"11 LIVE CATS","consigneeId":"GB279214189000","consigneeName":"GB279214189000","itemNetMass":112,"itemSupplementaryUnits":0,"itemThirdQuantity":null,"itemOriginCountryCode":"AE","documents":[{"documentCode":"C640","documentReference":"GBCHD2024.5252413","documentStatus":"AE","documentControl":"P","documentQuantity":null}],"checks":[{"checkCode":"H221","departmentCode":"AHVLA"}]},{"itemNumber":2,"customsProcedureCode":"4000000","taricCommodityCode":"0106190000","goodsDescription":"11 LIVE CATS","consigneeId":"GB279214189000","consigneeName":"GB279214189000","itemNetMass":112,"itemSupplementaryUnits":0,"itemThirdQuantity":null,"itemOriginCountryCode":"AE","documents":[{"documentCode":"C640","documentReference":"GBCHD2024.5252370","documentStatus":"AE","documentControl":"P","documentQuantity":null}],"checks":[{"checkCode":"H221","departmentCode":"AHVLA"}]}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id":4254312,"referenceNumber":"CHEDA.GB.2024.5252370","version":2,"lastUpdated":"2024-12-04T11:53:12.349503678Z","lastUpdatedBy":{"displayName":"b034cb8645979899639cfb4915249f5a9aefad128ebbea73643ada1bd4cc8602","userId":"3dd58971-2d3f-e911-a95d-000d3a454f67"},"type":"CVEDA","status":"IN_PROGRESS","isHighRiskEuImport":false,"partOne":{"personResponsible":{"name":"b7f8131fb4ec1853783c804d09180436b7e1664cceaa895222d837989e374713","companyId":"e7a47772-024c-e911-a95e-000d3a454f67","companyName":"8efd3bc3bc390f2fc7455e69fa63b1b8d40e2b83a60d12e59eafae791c7c6521","address":["67b7790a83be11ca87bd541343f4f36ea2578d8d75a3e927bf04449de8261c32","17c5417c8e7e8b105103975c8a30f199ba5880991c19ad06ebf97fbe39743f9d","121df6107cee49c29c1c7be700d188a4fec45b38174fe294abb96622b0fe5fd3"],"country":"GB","tracesID":1001,"phone":"e6f3e484713df5e89e30880624aa3c005152d629a103d7ac665478205b7e0e32","email":"b51b1fdbfd2bc47f2cb98d1eacef6ff1a98775c52f3ea264fe1176b5bf850d42","contactId":"9e9be8a8-6c1e-ef11-840a-000d3a4aeb0e"},"consignor":{"id":"84f6c789-b23a-4c18-a68e-0b22aa796ccb","type":"exporter","status":"nonapproved","companyName":"efac08ec6dd4b06a1213bf5ae84da887b5916b57fb69e01f2fe4dbfb5c24d91b","address":{"addressLine1":"3acbd607f17bc9f9fee01c0ade6252f31f1b51c5f3e8e7c96a7017431713141c","city":"5a4a3b86c74b044afe409427e9a875e6ad468b6ccfbf2a2fbf55e20f26050ebd","postalZipCode":"14f2f2f01cd1cc61563a6c8fff01b8a241a227dfa201e9f11f1d2d3de3bd4d35","countryISOCode":"d2d012b0e942fee087aa546b79d86e8d090c56185f2da2f347392d567a0b3231","telephone":"c6243d485b4a722df8abe66e8fb221428e4435c462ca57e53df18dd64f0d870c","email":"91eee1c6e4636a6e653e24e0674f1b1c93168854d6488b77cebf083df2e0b0f1"},"tracesId":10192492},"consignee":{"id":"0df99af8-c6da-41f8-bfb6-77cf9578716b","type":"consignee","status":"nonapproved","companyName":"ff23b9835a04a565c2346b6582b09c36d8a47bab4337265bee303ff16370cece","address":{"addressLine1":"9c414c51e60de0e972c781c13baa308f8bf524e146616df2f7d865f552589ece","city":"2646141aaf9c5ec01f3335781e5769130b8a2c6a87363fd0cac897a13d8f0595","postalZipCode":"1a3ab35fb040273852863916a1ff09b61805cd99de0833118426ff025c8f4d1a","countryISOCode":"3d48496a4567888e5dae3b1187065cf19955d0c252c83821e2339d3bd51e4795","telephone":"0b0b40b7c787ae1983185af1badd4a516c15a9f3f9e0fd22a39077b2095858c6","email":"91eee1c6e4636a6e653e24e0674f1b1c93168854d6488b77cebf083df2e0b0f1"},"tracesId":10393939},"importer":{"id":"0df99af8-c6da-41f8-bfb6-77cf9578716b","type":"consignee","status":"nonapproved","companyName":"ff23b9835a04a565c2346b6582b09c36d8a47bab4337265bee303ff16370cece","address":{"addressLine1":"9c414c51e60de0e972c781c13baa308f8bf524e146616df2f7d865f552589ece","city":"2646141aaf9c5ec01f3335781e5769130b8a2c6a87363fd0cac897a13d8f0595","postalZipCode":"1a3ab35fb040273852863916a1ff09b61805cd99de0833118426ff025c8f4d1a","countryISOCode":"3d48496a4567888e5dae3b1187065cf19955d0c252c83821e2339d3bd51e4795","telephone":"0b0b40b7c787ae1983185af1badd4a516c15a9f3f9e0fd22a39077b2095858c6","email":"91eee1c6e4636a6e653e24e0674f1b1c93168854d6488b77cebf083df2e0b0f1"},"tracesId":10393939},"placeOfDestination":{"id":"0df99af8-c6da-41f8-bfb6-77cf9578716b","type":"consignee","status":"nonapproved","companyName":"ff23b9835a04a565c2346b6582b09c36d8a47bab4337265bee303ff16370cece","address":{"addressLine1":"9c414c51e60de0e972c781c13baa308f8bf524e146616df2f7d865f552589ece","city":"2646141aaf9c5ec01f3335781e5769130b8a2c6a87363fd0cac897a13d8f0595","postalZipCode":"1a3ab35fb040273852863916a1ff09b61805cd99de0833118426ff025c8f4d1a","countryISOCode":"3d48496a4567888e5dae3b1187065cf19955d0c252c83821e2339d3bd51e4795","telephone":"0b0b40b7c787ae1983185af1badd4a516c15a9f3f9e0fd22a39077b2095858c6","email":"91eee1c6e4636a6e653e24e0674f1b1c93168854d6488b77cebf083df2e0b0f1"},"tracesId":10393939},"commodities":{"numberOfPackages":6,"numberOfAnimals":6,"commodityComplement":[{"commodityID":"01061900","commodityDescription":"Other","complementID":1,"complementName":"Felis catus","speciesID":"277268","speciesName":"Felis catus","speciesType":"2","speciesClass":"189901","speciesNomination":"Felis catus"}],"complementParameterSet":[{"uniqueComplementID":"fba3daba-96b6-4cb6-83ed-c3004acca7cf","complementID":1,"speciesID":"277268","keyDataPair":[{"key":"number_package","data":"6"},{"key":"number_animal","data":"6"}]}],"includeNonAblactedAnimals":false,"countryOfOrigin":"AE","animalsCertifiedAs":"Other"},"purpose":{"forImportOrAdmission":"Definitive import","purposeGroup":"For Re-Import"},"pointOfEntry":"GBLHR4A","arrivalDate":"2024-12-04","arrivalTime":"07:10:00","transporter":{"id":"f4bcf0f9-aa56-4d78-93a0-20fcd0bc7235","type":"commercial transporter","status":"approved","companyName":"7d3b8908a78cb00da9e28e9dce3b55cdee4b6f3a1c0bf66008d61ea93aab7f60","individualName":"7d3b8908a78cb00da9e28e9dce3b55cdee4b6f3a1c0bf66008d61ea93aab7f60","approvalNumber":"UK/REIGA/T2/00114438","address":{"addressLine1":"c4b8f582e6709950568a8211435cf3a56659b5143240c0301301a3409ed3e779","addressLine2":"52f7351da95f2ab671ec91c837018c14abf37c71ac798c7fd6f943e1090b9204","addressLine3":"918c41dd8b8858f6003d140fc5c3074f7038246faf2e165332dd5a0122d8a35d","city":"b4e3e828afcc9b96d902f15b0e99ae63feef0993b4b17146f292e49f5ab67dc7","postalZipCode":"f0afb11cfbaf5906c16c34a109df6576d473436272844f4527e67722c233fcde","countryISOCode":"85bee5313027e26874b0a80974c64b6c46438d6ba8ca93684e2a6d09a3379efe"},"tracesId":10393940},"meansOfTransport":{"id":"HJ22 FWE","type":"Aeroplane","document":"N/A"},"meansOfTransportFromEntryPoint":{"id":"EK007","type":"Aeroplane","document":"176-02480634"},"departureDate":"2024-12-04","departureTime":"12:00:00","estimatedJourneyTimeInMinutes":240,"veterinaryInformation":{"identificationDetails":[{}]},"importerLocalReferenceNumber":"CL7238","route":{},"submissionDate":"2024-12-04T08:40:34.401434701Z","submittedBy":{"displayName":"b7f8131fb4ec1853783c804d09180436b7e1664cceaa895222d837989e374713","userId":"9e9be8a8-6c1e-ef11-840a-000d3a4aeb0e"},"complexCommoditySelected":true},"partTwo":{"decision":{"decision":"Acceptable for Internal Market","ifChanneledOption":"article15"},"consignmentCheck":{"euStandard":"Not Set","nationalRequirements":"Not Set","additionalGuarantees":"Not Set"},"impactOfTransportOnAnimals":{"numberOfDeadAnimalsUnit":"number","numberOfUnfitAnimalsUnit":"number"},"laboratoryTests":{},"controlAuthority":{"officialVeterinarian":{"firstName":"efc1156f1875e7b38f6b943115fc28c76cb0ca32bedcc3d1fb904c6426a266cd","lastName":"9698925466c3b41da0c0ae0065820619304435d7936b4855c6a54a2aec5b8b03","email":"1cb4763847e01dffdf16df4a2536c5e243124ee35ec310c46ca249a3765f5e61","phone":"4302b5032003831d95374de1bdf81eb25f86ea18fdf1a6221013bfc9976ac8f0","signed":"2024-12-04T11:53:12.349403376"}},"consignmentValidation":[{"field":"uk/gov/defra/tracesx/notificationschema/representation/parttwo/decision/consignmentacceptable","message":"What is the decision for this consignment"},{"field":"uk/gov/defra/tracesx/notificationschema/representation/notification/","message":"A document type must be entered"},{"field":"uk/gov/defra/tracesx/notificationschema/representation/parttwo/consignmentcheck","message":"Documentary check"},{"field":"uk/gov/defra/tracesx/notificationschema/representation/parttwo/consignmentcheck/physicalcheckresult","message":"Physical check result"},{"field":"uk/gov/defra/tracesx/notificationschema/representation/parttwo/consignmentcheck/welfarecheck","message":"Welfare check"},{"field":"uk/gov/defra/tracesx/notificationschema/representation/parttwo/consignmentcheck/identitycheckresult","message":"Complete identity check details"},{"field":"uk/gov/defra/tracesx/notificationschema/representation/parttwo/laboratorytestsrequired","message":"Are laboratory tests required"},{"field":"uk/gov/defra/tracesx/notificationschema/representation/parttwo/consignmentcheck/numberofanimalschecked","message":"Animal number checked"}]},"consignmentValidation":[{"field":"uk/gov/defra/tracesx/notificationschema/representation/notification/parttwo/consignmentcheck/welfarecheck","message":"Welfare check"},{"field":"uk/gov/defra/tracesx/notificationschema/representation/notification/parttwo/laboratorytestsrequired","message":"Are laboratory tests required"},{"field":"uk/gov/defra/tracesx/notificationschema/representation/notification/parttwo/decision/consignmentacceptable","message":"What is the decision for this consignment"},{"field":"uk/gov/defra/tracesx/notificationschema/representation/notification/parttwo/consignmentcheck/identitycheckresult","message":"Complete identity check details"},{"field":"uk/gov/defra/tracesx/notificationschema/representation/notification/parttwo/consignmentcheck/physicalcheckresult","message":"Physical check result"},{"field":"uk/gov/defra/tracesx/notificationschema/representation/notification/parttwo/consignmentcheck/numberofanimalschecked","message":"Animal number checked"},{"field":"uk/gov/defra/tracesx/notificationschema/representation/notification/parttwo/consignmentcheck","message":"Documentary check"}],"etag":"0000000004507FF9","chedTypeVersion":1}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id":4252370,"referenceNumber":"CHEDA.GB.2024.5252370","version":1,"lastUpdated":"2024-12-04T08:40:34.431612524Z","lastUpdatedBy":{"displayName":"b7f8131fb4ec1853783c804d09180436b7e1664cceaa895222d837989e374713","userId":"9e9be8a8-6c1e-ef11-840a-000d3a4aeb0e"},"type":"CVEDA","status":"SUBMITTED","isHighRiskEuImport":false,"partOne":{"personResponsible":{"name":"b7f8131fb4ec1853783c804d09180436b7e1664cceaa895222d837989e374713","companyId":"e7a47772-024c-e911-a95e-000d3a454f67","companyName":"8efd3bc3bc390f2fc7455e69fa63b1b8d40e2b83a60d12e59eafae791c7c6521","address":["67b7790a83be11ca87bd541343f4f36ea2578d8d75a3e927bf04449de8261c32","17c5417c8e7e8b105103975c8a30f199ba5880991c19ad06ebf97fbe39743f9d","121df6107cee49c29c1c7be700d188a4fec45b38174fe294abb96622b0fe5fd3"],"country":"GB","tracesID":1001,"phone":"e6f3e484713df5e89e30880624aa3c005152d629a103d7ac665478205b7e0e32","email":"b51b1fdbfd2bc47f2cb98d1eacef6ff1a98775c52f3ea264fe1176b5bf850d42","contactId":"9e9be8a8-6c1e-ef11-840a-000d3a4aeb0e"},"consignor":{"id":"84f6c789-b23a-4c18-a68e-0b22aa796ccb","type":"exporter","status":"nonapproved","companyName":"efac08ec6dd4b06a1213bf5ae84da887b5916b57fb69e01f2fe4dbfb5c24d91b","address":{"addressLine1":"3acbd607f17bc9f9fee01c0ade6252f31f1b51c5f3e8e7c96a7017431713141c","city":"5a4a3b86c74b044afe409427e9a875e6ad468b6ccfbf2a2fbf55e20f26050ebd","postalZipCode":"14f2f2f01cd1cc61563a6c8fff01b8a241a227dfa201e9f11f1d2d3de3bd4d35","countryISOCode":"d2d012b0e942fee087aa546b79d86e8d090c56185f2da2f347392d567a0b3231","telephone":"c6243d485b4a722df8abe66e8fb221428e4435c462ca57e53df18dd64f0d870c","email":"91eee1c6e4636a6e653e24e0674f1b1c93168854d6488b77cebf083df2e0b0f1"},"tracesId":10192492},"consignee":{"id":"0df99af8-c6da-41f8-bfb6-77cf9578716b","type":"consignee","status":"nonapproved","companyName":"ff23b9835a04a565c2346b6582b09c36d8a47bab4337265bee303ff16370cece","address":{"addressLine1":"9c414c51e60de0e972c781c13baa308f8bf524e146616df2f7d865f552589ece","city":"2646141aaf9c5ec01f3335781e5769130b8a2c6a87363fd0cac897a13d8f0595","postalZipCode":"1a3ab35fb040273852863916a1ff09b61805cd99de0833118426ff025c8f4d1a","countryISOCode":"3d48496a4567888e5dae3b1187065cf19955d0c252c83821e2339d3bd51e4795","telephone":"0b0b40b7c787ae1983185af1badd4a516c15a9f3f9e0fd22a39077b2095858c6","email":"91eee1c6e4636a6e653e24e0674f1b1c93168854d6488b77cebf083df2e0b0f1"},"tracesId":10393939},"importer":{"id":"0df99af8-c6da-41f8-bfb6-77cf9578716b","type":"consignee","status":"nonapproved","companyName":"ff23b9835a04a565c2346b6582b09c36d8a47bab4337265bee303ff16370cece","address":{"addressLine1":"9c414c51e60de0e972c781c13baa308f8bf524e146616df2f7d865f552589ece","city":"2646141aaf9c5ec01f3335781e5769130b8a2c6a87363fd0cac897a13d8f0595","postalZipCode":"1a3ab35fb040273852863916a1ff09b61805cd99de0833118426ff025c8f4d1a","countryISOCode":"3d48496a4567888e5dae3b1187065cf19955d0c252c83821e2339d3bd51e4795","telephone":"0b0b40b7c787ae1983185af1badd4a516c15a9f3f9e0fd22a39077b2095858c6","email":"91eee1c6e4636a6e653e24e0674f1b1c93168854d6488b77cebf083df2e0b0f1"},"tracesId":10393939},"placeOfDestination":{"id":"0df99af8-c6da-41f8-bfb6-77cf9578716b","type":"consignee","status":"nonapproved","companyName":"ff23b9835a04a565c2346b6582b09c36d8a47bab4337265bee303ff16370cece","address":{"addressLine1":"9c414c51e60de0e972c781c13baa308f8bf524e146616df2f7d865f552589ece","city":"2646141aaf9c5ec01f3335781e5769130b8a2c6a87363fd0cac897a13d8f0595","postalZipCode":"1a3ab35fb040273852863916a1ff09b61805cd99de0833118426ff025c8f4d1a","countryISOCode":"3d48496a4567888e5dae3b1187065cf19955d0c252c83821e2339d3bd51e4795","telephone":"0b0b40b7c787ae1983185af1badd4a516c15a9f3f9e0fd22a39077b2095858c6","email":"91eee1c6e4636a6e653e24e0674f1b1c93168854d6488b77cebf083df2e0b0f1"},"tracesId":10393939},"commodities":{"numberOfPackages":6,"numberOfAnimals":6,"commodityComplement":[{"commodityID":"01061900","commodityDescription":"Other","complementID":1,"complementName":"Felis catus","speciesID":"277268","speciesName":"Felis catus","speciesType":"2","speciesClass":"189901","speciesNomination":"Felis catus"}],"complementParameterSet":[{"uniqueComplementID":"fba3daba-96b6-4cb6-83ed-c3004acca7cf","complementID":1,"speciesID":"277268","keyDataPair":[{"key":"number_package","data":"6"},{"key":"number_animal","data":"6"}]}],"includeNonAblactedAnimals":false,"countryOfOrigin":"AE","animalsCertifiedAs":"Pets"},"purpose":{"forImportOrAdmission":"Definitive import","purposeGroup":"For Re-Import"},"pointOfEntry":"GBLHR4A","arrivalDate":"2024-12-04","arrivalTime":"07:10:00","transporter":{"id":"f4bcf0f9-aa56-4d78-93a0-20fcd0bc7235","type":"commercial transporter","status":"approved","companyName":"7d3b8908a78cb00da9e28e9dce3b55cdee4b6f3a1c0bf66008d61ea93aab7f60","individualName":"7d3b8908a78cb00da9e28e9dce3b55cdee4b6f3a1c0bf66008d61ea93aab7f60","approvalNumber":"UK/REIGA/T2/00114438","address":{"addressLine1":"c4b8f582e6709950568a8211435cf3a56659b5143240c0301301a3409ed3e779","addressLine2":"52f7351da95f2ab671ec91c837018c14abf37c71ac798c7fd6f943e1090b9204","addressLine3":"918c41dd8b8858f6003d140fc5c3074f7038246faf2e165332dd5a0122d8a35d","city":"b4e3e828afcc9b96d902f15b0e99ae63feef0993b4b17146f292e49f5ab67dc7","postalZipCode":"f0afb11cfbaf5906c16c34a109df6576d473436272844f4527e67722c233fcde","countryISOCode":"85bee5313027e26874b0a80974c64b6c46438d6ba8ca93684e2a6d09a3379efe"},"tracesId":10393940},"meansOfTransport":{"id":"HJ22 FWE","type":"Aeroplane","document":"N/A"},"meansOfTransportFromEntryPoint":{"id":"EK007","type":"Aeroplane","document":"176-02480634"},"departureDate":"2024-12-04","departureTime":"12:00:00","estimatedJourneyTimeInMinutes":240,"veterinaryInformation":{"identificationDetails":[{}]},"importerLocalReferenceNumber":"CL7238","route":{},"submissionDate":"2024-12-04T08:40:34.401434701Z","submittedBy":{"displayName":"b7f8131fb4ec1853783c804d09180436b7e1664cceaa895222d837989e374713","userId":"9e9be8a8-6c1e-ef11-840a-000d3a4aeb0e"},"complexCommoditySelected":true},"etag":"00000000044FCB61","chedTypeVersion":1}
Loading

0 comments on commit f018838

Please sign in to comment.