@@ -24,4 +24,55 @@ export default class OverseasEntityService {
2424 resource . resource = { ...response . body } ;
2525 return resource ;
2626 }
27+
28+ /**
29+ * Proof of concept for ROE-1271
30+ * Not to be used for Live code
31+ * @param transactionId
32+ * @param body
33+ * @returns
34+ */
35+ public async proofOfConceptPutOverseasEntity ( transactionId : string , body : OverseasEntity ) : Promise < Resource < OverseasEntityCreated > | ApiErrorResponse > {
36+ const URL = `/transactions/${ transactionId } /overseas-entity` ;
37+ const response : HttpResponse = await this . client . httpPut ( URL , mapOverseasEntity ( body ) ) ;
38+
39+ if ( response . error ) {
40+ return {
41+ httpStatusCode : response . status ,
42+ errors : [ response . error ]
43+ } ;
44+ }
45+
46+ const resource : Resource < OverseasEntityCreated > = {
47+ httpStatusCode : response . status
48+ } ;
49+
50+ resource . resource = { ...response . body } ;
51+ return resource ;
52+ }
53+
54+ /**
55+ * Proof of concept for ROE-1271
56+ * Not to be used for Live code
57+ * @param transactionId
58+ * @returns
59+ */
60+ // no id returned, so this needs changing
61+ public async proofOfConceptPatchOverseasEntity ( transactionId : string ) : Promise < Resource < void > | ApiErrorResponse > {
62+ const URL = `/transactions/${ transactionId } /overseas-entity` ;
63+ const response : HttpResponse = await this . client . httpPatch ( URL ) ;
64+
65+ if ( response . error ) {
66+ return {
67+ httpStatusCode : response . status ,
68+ errors : [ response . error ]
69+ } ;
70+ }
71+
72+ const resource : Resource < OverseasEntityCreated > = {
73+ httpStatusCode : response . status
74+ } ;
75+
76+ return resource ;
77+ }
2778}
0 commit comments