@snabcentr/client-core 4.24.0 → 4.25.0

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.
@@ -2407,6 +2407,12 @@ class ScOrderItem {
2407
2407
  get isUnavailableReasonNeutral() {
2408
2408
  return false;
2409
2409
  }
2410
+ /**
2411
+ * Признак, что для позиции можно указать товар каталога вместо ненайденного.
2412
+ */
2413
+ get isProductSpecifiable() {
2414
+ return false;
2415
+ }
2410
2416
  /**
2411
2417
  * Шаг изменения количества позиции.
2412
2418
  */
@@ -7430,6 +7436,12 @@ class ScProfstroyOrderItem extends ScOrderItem {
7430
7436
  get isInactive() {
7431
7437
  return this.isIgnored || super.isInactive;
7432
7438
  }
7439
+ /**
7440
+ * Признак, что для позиции можно указать товар каталога: товар не найден, а группа участвует в заказе.
7441
+ */
7442
+ get isProductSpecifiable() {
7443
+ return this.product.isNull && !this.isIgnored;
7444
+ }
7433
7445
  /**
7434
7446
  * @inheritDoc
7435
7447
  */
@@ -7789,6 +7801,10 @@ class ScOrderDraftsService {
7789
7801
  * Коды отказа, после которых черновик перезапрашивается.
7790
7802
  */
7791
7803
  static { this.rejectionStatuses = [HttpStatusCode.Forbidden, HttpStatusCode.Conflict]; }
7804
+ /**
7805
+ * Коды отказа и отсутствия позиции, после которых черновик перезапрашивается: позицию могли удалить или собрать заново.
7806
+ */
7807
+ static { this.rejectionOrMissingStatuses = [...ScOrderDraftsService.rejectionStatuses, HttpStatusCode.NotFound]; }
7792
7808
  /**
7793
7809
  * Возвращает ключ очереди запросов черновика.
7794
7810
  *
@@ -7949,6 +7965,22 @@ class ScOrderDraftsService {
7949
7965
  });
7950
7966
  }), this.updatesDraft(offerId));
7951
7967
  }
7968
+ /**
7969
+ * Указывает товар каталога для позиции черновика Профстрой, по которой товар не найден. После 404 черновик тоже перезапрашивается:
7970
+ * позицию могли удалить или собрать заново.
7971
+ *
7972
+ * @param offerId Идентификатор черновика.
7973
+ * @param itemId Идентификатор позиции.
7974
+ * @param productId Идентификатор товара каталога.
7975
+ */
7976
+ specifyProfstroyProduct$(offerId, itemId, productId) {
7977
+ const body = { productId };
7978
+ return this.http
7979
+ .patch(`${this.urls.apiUrl}/orders/offers/${offerId}/profstroy/products/${itemId}/product`, body, {
7980
+ context: ScOrderDraftsService.getErrorContext('Не удалось сохранить товар позиции.'),
7981
+ })
7982
+ .pipe(this.updatesDraft(offerId, ScOrderDraftsService.rejectionOrMissingStatuses));
7983
+ }
7952
7984
  /**
7953
7985
  * Создаёт новое коммерческое предложение/черновик заказа.
7954
7986
  *
@@ -8131,7 +8163,7 @@ class ScOrderDraftsService {
8131
8163
  body,
8132
8164
  context: ScOrderDraftsService.getErrorContext('Не удалось удалить позиции.'),
8133
8165
  })
8134
- .pipe(this.updatesDraft(offerId, [...ScOrderDraftsService.rejectionStatuses, HttpStatusCode.NotFound]));
8166
+ .pipe(this.updatesDraft(offerId, ScOrderDraftsService.rejectionOrMissingStatuses));
8135
8167
  }
8136
8168
  /**
8137
8169
  * Возвращает оператор запроса, который отвечает черновиком целиком: ответ кладётся в кэш, после отказа черновик перезапрашивается,