Skip to content

Missing business/technical codes in upload output #100

Description

@sumbricht

The output of download orders contains all necessary information for debugging:

{
	orderData,
	orderId,

	technicalCode,
	technicalCodeSymbol,
	technicalCodeShortText,
	technicalCodeMeaning,

	businessCode,
	businessCodeSymbol,
	businessCodeShortText,
	businessCodeMeaning,
}

For upload orders, there is however only very limited output, which doesn't allow the user to even see whether the call succeeded:

[transactionId, orderId]

Therefore I'd like to propose changing the return value of Client.upload to the object below. For backwards compability I would even propose keys '0', '1' and the iterator; this should then not even require any code changes for current users of the library:

{
	transactionId,
	orderId,

	technicalCode,
	technicalCodeSymbol,
	technicalCodeShortText,
	technicalCodeMeaning,

	businessCode,
	businessCodeSymbol,
	businessCodeShortText,
	businessCodeMeaning,

	// for backwards compatibility with the earlier return value [transactionId, orderId]:
	'0': transactionId,
	'1': orderId,
	[Symbol.iterator]: function*() {
		yield transactionId
		yield orderId
	},
}

I'll create a PR for these changes but I am of course open to discuss :-)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions