@@ -26,7 +26,7 @@ public function __construct(
2626 ) {
2727 }
2828
29- private function compileQueryParameters (int $ currentPage = 1 )
29+ private function compileQueryParameters (int $ currentPage = 1 ): array
3030 {
3131 $ parameters = $ this ->queryParameters ;
3232 $ parameters ['searchCriteria[currentPage] ' ] = $ currentPage ;
@@ -37,7 +37,7 @@ private function compileQueryParameters(int $currentPage = 1)
3737 return array_merge ($ parameters , ...$ filters );
3838 }
3939
40- private function compileQueryLongParameters ()
40+ private function compileQueryLongParameters (): array
4141 {
4242 $ filters = array_map (fn (FilterGroup $ item , int $ key ) => $ item ->compileLongFilters ($ key ), $ this ->filters , array_keys ($ this ->filters ));
4343
@@ -96,8 +96,9 @@ public function extract(): iterable
9696 $ currentPage = 1 ;
9797 $ pageCount = ceil ($ response ->getTotalCount () / $ this ->pageSize );
9898 while ($ currentPage ++ < $ pageCount ) {
99+ $ finalQueryParameter ['searchCriteria[currentPage] ' ] = $ currentPage ;
99100 $ response = $ this ->client ->salesOrderRepositoryV1GetListGet (
100- queryParameters: $ this -> compileQueryParameters ( $ currentPage ) ,
101+ queryParameters: $ finalQueryParameter ,
101102 );
102103
103104 yield $ this ->processResponse ($ response );
@@ -108,7 +109,7 @@ public function extract(): iterable
108109 yield new RejectionResultBucket ([
109110 'path ' => 'order ' ,
110111 'method ' => 'get ' ,
111- 'queryParameters ' => $ this ->compileQueryParameters (),
112+ 'queryParameters ' => $ this ->generateFinalQueryParameters ( $ this -> compileQueryParameters (), $ this -> compileQueryLongParameters () ),
112113 ]);
113114 } catch (\Exception $ exception ) {
114115 $ this ->logger ->critical ($ exception ->getMessage (), ['exception ' => $ exception ]);
0 commit comments