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

Got error when get files content #224

Open
sinh117801 opened this issue Mar 7, 2022 · 1 comment
Open

Got error when get files content #224

sinh117801 opened this issue Mar 7, 2022 · 1 comment
Labels
bug Something isn't working hacktoberfest-accepted

Comments

@sinh117801
Copy link

sinh117801 commented Mar 7, 2022

What were you trying to do?
I try to get file content with endpoint GET /files/:id/contents

What did you expect to see?
I expected get file content.

What did you see?

{
	"error": "problem rendering file contents: BundleNumber  ImageViewData does not match Image View Detail count of 1"
}

How can we reproduce the problem?
create file with endpoints POST /files/create with body

{
	"fileHeader": {
		"standardLevel": "35",
		"testIndicator": "T",
		"immediateDestination": "231380102",
		"immediateOrigin": "16198119",
		"fileCreationDate": "2022-03-06T05:35:50.866Z",
		"fileCreationTime": "0000-01-01T00:00:00Z",
		"ResendIndicator": "Y",
		"immediateDestinationName": "Test Bank",
		"ImmediateOriginName": "xxxxxxxxxx",
		"countryCode": "US"
	},
	"cashLetters": [
		{
			"cashLetterHeader": {
				"collectionTypeIndicator": "01",
				"destinationRoutingNumber": "061000146",
				"eceInstitutionRoutingNumber": "16198119",
				"cashLetterBusinessDate": "2022-03-06T05:35:50.866Z",
				"cashLetterCreationDate": "2022-03-06T05:35:50.866Z",
				"cashLetterCreationTime": "0000-01-01T00:00:00Z",
				"cashLetterID": "f0033a89-bb01-4b67-b0c7-5ded39077d18"
			},
			"bundles": [
				{
					"bundleHeader": {
						"collectionTypeIndicator": "01",
						"destinationRoutingNumber": "061000146",
						"eceInstitutionRoutingNumber": "026073150",
						"bundleBusinessDate": "2022-03-07T07:51:15.667Z",
						"bundleCreationDate": "2022-03-07T07:51:15.667Z",
						"BundleSequenceNumber": "0001"
					},
					"checks": [
						{
							"itemAmount": 10000,
							"addendumCount": 1,
							"checkDetailAddendumA": [
								{
									"recordNumber": 1,
									"returnLocationRoutingNumber": "16198119"
								}
							],
							"imageViewData": [
								{
									"imageData": "dGVzdA=="
								},
								{
									"imageData": "dGVzdA=="
								}
							]
						}
					],
					"bundleControl": {
						"bundleItemsCount": 1,
						"bundleTotalAmount": 5000,
						"bundleImagesCount": 1
					}
				}
			],
			"cashLetterControl": {
				"cashLetterItemsCount": 1,
				"cashLetterTotalAmount": 5000,
				"cashLetterImagesCount": 1,
				"eceInstitutionName": "Test Bank"
			}
		}
	],
	"fileControl": {
		"cashLetterCount": 1,
		"totalRecordCount": 1,
		"totalItemCount": 1,
		"fileTotalAmount": 5000
	}
}

after return response use the id to get file contents

@adamdecaf adamdecaf added the bug Something isn't working label Mar 22, 2022
@adamdecaf
Copy link
Member

@sinh117801 (Apologies for the delay in a response)

Should there be image view detail records? That error is coming from this block of code:

imagecashletter/writer.go

Lines 239 to 243 in 15de640

if len(ivDataSlice) > 0 && len(ivDataSlice) != len(ivDetailSlice) {
// should be same number of imageViewData as imageViewDetail
msg := fmt.Sprintf(msgBundleImageDetailCount, len(ivDataSlice))
return &BundleError{FieldName: "ImageViewData", Msg: msg}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hacktoberfest-accepted
Projects
None yet
Development

No branches or pull requests

2 participants