Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADR-1270 Should able to read returns with items both Some(Seq.empty) and None #21

Merged
merged 3 commits into from
Aug 7, 2024

Conversation

davidfes
Copy link
Contributor

@davidfes davidfes commented Aug 6, 2024

No description provided.

@platops-pr-bot
Copy link


val getReturnUrl = config.getReturnUrl(retId)
val submitReturnUrl = config.submitReturnUrl
val calculateDutyDueByTaxTypeUrl = config.getCalculateDutyDueByTaxTypeUrl

val returnSuccess = successfulReturnExample(appaId, periodKey, submissionId, chargeReference, now)
val returnSuccessJson = """{"success":{"processingDate":"2024-06-11T15:07:47.838Z","idDetails":{"adReference":"XMADP1340593221","submissionID":"788413286170"},"chargeDetails":{"periodKey":"24AC","chargeReference":"XA4732160686346","periodFrom":"2024-03-01","periodTo":"2024-03-31","receiptDate":"2024-06-11T15:07:47.838Z"},"alcoholProducts":{"alcoholProductsProducedFilled":"1","regularReturn":[{"taxType":"301","dutyRate":5.27,"litresProduced":240000.02,"litresOfPureAlcohol":12041,"dutyDue":63456.07}]},"overDeclaration":{"overDeclFilled":"1","reasonForOverDecl":"Why over-declared","overDeclarationProducts":[{"returnPeriodAffected":"24AB","taxType":"302","dutyRate":3.56,"litresProduced":5000.79,"litresOfPureAlcohol":100.58,"dutyDue":358.07}]},"underDeclaration":{"underDeclFilled":"1","reasonForUnderDecl":"Why under-declared","underDeclarationProducts":[{"returnPeriodAffected":"24AA","taxType":"301","dutyRate":5.27,"litresProduced":49000.78,"litresOfPureAlcohol":989,"dutyDue":5212.03}]},"spoiltProduct":{"spoiltProdFilled":"1","spoiltProductProducts":[{"returnPeriodAffected":"23AL","taxType":"305","dutyRate":1.75,"litresProduced":50000.69,"litresOfPureAlcohol":1000.94,"dutyDue":1751.65}]},"drawback":{"drawbackFilled":"1","drawbackProducts":[{"returnPeriodAffected":"23AK","taxType":"309","dutyRate":5.12,"litresProduced":60000.02,"litresOfPureAlcohol":1301.11,"dutyDue":6661.69}]},"repackagedDraught":{"repDraughtFilled":"1","repackagedDraughtProducts":[{"returnPeriodAffected":"23AJ","originaltaxType":"300","originaldutyRate":0.64,"newTaxType":"304","dutyRate":12.76,"litresOfRepackaging":5000.97,"litresOfPureAlcohol":100.81,"dutyDue":1221.82}]},"totalDutyDuebyTaxType":[{"taxType":"301","totalDutyDueTaxType":1}],"totalDutyDue":{"totalDutyDueAlcoholProducts":63456.07,"totalDutyOverDeclaration":358.07,"totalDutyUnderDeclaration":5212.03,"totalDutySpoiltProduct":1751.65,"totalDutyDrawback":6661.69,"totalDutyRepDraughtProducts":1221.82,"totalDutyDue":61118.51},"netDutySuspension":{"netDutySuspensionFilled":"1","netDutySuspensionProducts":{"totalLtsBeer":0.15,"totalLtsWine":0.44,"totalLtsCider":0.38,"totalLtsSpirit":0.02,"totalLtsOtherFermented":0.02,"totalLtsPureAlcoholBeer":0.4248,"totalLtsPureAlcoholWine":0.5965,"totalLtsPureAlcoholCider":0.0379,"totalLtsPureAlcoholSpirit":0.2492,"totalLtsPureAlcoholOtherFermented":0.1894}},"spiritsProduced":{"spiritsProdFilled":"1","spiritsProduced":{"totalSpirits":0.05,"scotchWhiskey":0.26,"irishWhisky":0.16,"typeOfSpirit":["03"],"typeOfSpiritOther":"Coco Pops Vodka","code1MaltedBarley":0.17,"code2Other":"1","maltedGrainQuantity":0.55,"maltedGrainType":"wheat","code3Wheat":0.8,"code4Maize":0.67,"code5Rye":0.13,"code6UnmaltedGrain":0.71,"code7EthyleneGas":0.45,"code8Molasses":0.31,"code9Beer":0.37,"code10Wine":0.76,"code11MadeWine":0.6,"code12CiderOrPerry":0.04,"code13Other":"1","otherMaterialsQuantity":0.26,"otherMaterialsUom":"01","otherMaterialsType":"Coco Pops"}}}}"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please change the APPAID with a random or generated string? I think the charge references and submission ids should be fine, could we double-check, please?

val adrReturnDetails = convertedReturnDetails(periodKey, now)

val nilReturnSuccessJson = """{"success":{"processingDate":"2024-06-11T15:07:47.838Z","idDetails":{"adReference":"XMADP3460801266","submissionID":"247446580820"},"chargeDetails":{"periodKey":"24AC","periodFrom":"2024-03-01","periodTo":"2024-03-31","receiptDate":"2024-06-11T15:07:47.838Z"},"alcoholProducts":{"alcoholProductsProducedFilled":"0"},"overDeclaration":{"overDeclFilled":"0"},"underDeclaration":{"underDeclFilled":"0"},"spoiltProduct":{"spoiltProdFilled":"0"},"drawback":{"drawbackFilled":"0"},"repackagedDraught":{"repDraughtFilled":"0"},"totalDutyDue":{"totalDutyDueAlcoholProducts":0,"totalDutyOverDeclaration":0,"totalDutyUnderDeclaration":0,"totalDutySpoiltProduct":0,"totalDutyDrawback":0,"totalDutyRepDraughtProducts":0,"totalDutyDue":0},"netDutySuspension":{"netDutySuspensionFilled":"0"}}}"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above

@davidfes davidfes merged commit 5a87ac1 into main Aug 7, 2024
1 check passed
@davidfes davidfes deleted the ADR-1270 branch August 7, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants