@experteam-mx/ngx-services 18.7.29 → 18.7.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -817,6 +817,80 @@ class ApiCatalogsService {
817
817
  return this.http.get(`${this.url}/shipment-statuses`, { params })
818
818
  .pipe(map(({ data }) => data));
819
819
  }
820
+ /**
821
+ * Fetches questions from the catalogs API.
822
+ *
823
+ * Sends an HTTP GET request to `${this.url}/questions` using the supplied query parameters
824
+ * and returns the unwrapped payload (`data`) from the API response.
825
+ *
826
+ * @param params - Query parameters to include in the request (e.g. paging, filters, sorting).
827
+ * @returns An Observable that emits the QuestionsOut payload (the `data` field from ApiSuccess<QuestionsOut>).
828
+ */
829
+ getQuestions(params) {
830
+ return this.http.get(`${this.url}/questions`, { params })
831
+ .pipe(map(({ data }) => data));
832
+ }
833
+ /**
834
+ * Retrieve a single question by its id.
835
+ *
836
+ * Sends an HTTP GET request to the questions endpoint and returns an Observable that emits
837
+ * the QuestionOut payload extracted from the API success envelope.
838
+ *
839
+ * @param id - The numeric identifier of the question to fetch.
840
+ * @returns An Observable that emits the requested QuestionOut. The Observable will error
841
+ * if the HTTP request fails (for example network issues or non-2xx responses).
842
+ */
843
+ getQuestion(id) {
844
+ return this.http.get(`${this.url}/questions/${id}`)
845
+ .pipe(map(({ data }) => data));
846
+ }
847
+ /**
848
+ * Sends a POST request to create a new question and returns the created resource.
849
+ *
850
+ * The request payload is sent as an object with a `body` property containing the provided
851
+ * QuestionIn value (i.e. { body: QuestionIn }). On success the HTTP response is expected
852
+ * to follow the ApiSuccess<T> shape; the operator maps that response to the inner `data`
853
+ * object and emits it as a QuestionOut.
854
+ *
855
+ * @param body - The question payload to create (QuestionIn).
856
+ * @returns Observable<QuestionOut> that emits the created question on success.
857
+ */
858
+ postQuestion(body) {
859
+ return this.http.post(`${this.url}/questions`, { body })
860
+ .pipe(map(({ data }) => data));
861
+ }
862
+ /**
863
+ * Update a question by its ID.
864
+ *
865
+ * Sends an HTTP PUT to `${this.url}/questions/${id}` with the provided payload.
866
+ * The request body is sent as an object with a `body` property containing the
867
+ * `QuestionIn` data. The server response is expected to be an `ApiSuccess<QuestionOut>`
868
+ * and this method returns an Observable that emits the unwrapped `QuestionOut`.
869
+ *
870
+ * @param id - The identifier of the question to update.
871
+ * @param body - The update payload for the question.
872
+ * @returns An Observable that emits the updated `QuestionOut` on success.
873
+ */
874
+ putQuestion(id, body) {
875
+ return this.http.put(`${this.url}/questions/${id}`, { body })
876
+ .pipe(map(({ data }) => data));
877
+ }
878
+ /**
879
+ * Deletes a question by its ID.
880
+ *
881
+ * Sends an HTTP DELETE request to the backend endpoint `/questions/{id}` and
882
+ * returns an Observable that emits the API response's `data` payload (typically an empty object).
883
+ *
884
+ * The implementation maps an ApiSuccess wrapper to its `data` property before emitting.
885
+ *
886
+ * @param id - The numeric identifier of the question to delete.
887
+ * @returns An Observable that emits the deleted resource payload ({} expected) on success.
888
+ * The Observable will emit an error if the HTTP request fails.
889
+ */
890
+ deleteQuestion(id) {
891
+ return this.http.delete(`${this.url}/questions/${id}`)
892
+ .pipe(map(({ data }) => data));
893
+ }
820
894
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ApiCatalogsService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
821
895
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ApiCatalogsService, providedIn: 'root' });
822
896
  }
@@ -3007,6 +3081,16 @@ class ApiInvoicesService {
3007
3081
  return this.http.get(`${this.url}/operation/document/requests/${id}`)
3008
3082
  .pipe(map(({ data }) => data));
3009
3083
  }
3084
+ /**
3085
+ * Retrieves a list of documents based on the provided query parameters.
3086
+ *
3087
+ * @param params - The query parameters to filter and paginate the documents
3088
+ * @returns An Observable that emits the documents data when the HTTP request completes
3089
+ */
3090
+ getDocuments(params) {
3091
+ return this.http.get(`${this.url}/documents`, { params })
3092
+ .pipe(map(({ data }) => data));
3093
+ }
3010
3094
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ApiInvoicesService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
3011
3095
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ApiInvoicesService, providedIn: 'root' });
3012
3096
  }