@snabcentr/client-core 4.24.0 → 4.25.1
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
|
*/
|
|
@@ -2422,6 +2428,12 @@ class ScOrderItem {
|
|
|
2422
2428
|
}
|
|
2423
2429
|
return this.product.isHidden ? 'Товар больше не предоставляется' : '';
|
|
2424
2430
|
}
|
|
2431
|
+
/**
|
|
2432
|
+
* Возвращает предупреждение к позиции, которое не мешает ей попасть в заказ, или пустую строку.
|
|
2433
|
+
*/
|
|
2434
|
+
getNotice() {
|
|
2435
|
+
return '';
|
|
2436
|
+
}
|
|
2425
2437
|
/**
|
|
2426
2438
|
* @inheritDoc
|
|
2427
2439
|
*/
|
|
@@ -7407,6 +7419,7 @@ class ScProfstroyOrderItem extends ScOrderItem {
|
|
|
7407
7419
|
this.groupName = data.groupName?.trim() ? data.groupName.trim() : undefined;
|
|
7408
7420
|
this.isIgnored = data.isIgnored ?? false;
|
|
7409
7421
|
this.lineError = data.lineError?.trim() ? data.lineError.trim() : undefined;
|
|
7422
|
+
this.lineNotice = data.lineNotice?.trim() ? data.lineNotice.trim() : undefined;
|
|
7410
7423
|
if (isProductStub) {
|
|
7411
7424
|
const supplierSku = data.supplierSku ?? data.product?.supplierSku ?? undefined;
|
|
7412
7425
|
this.product = ScProduct.createNotFound(data.product?.name, supplierSku);
|
|
@@ -7430,6 +7443,12 @@ class ScProfstroyOrderItem extends ScOrderItem {
|
|
|
7430
7443
|
get isInactive() {
|
|
7431
7444
|
return this.isIgnored || super.isInactive;
|
|
7432
7445
|
}
|
|
7446
|
+
/**
|
|
7447
|
+
* Признак, что для позиции можно указать товар каталога: товар не найден, а группа участвует в заказе.
|
|
7448
|
+
*/
|
|
7449
|
+
get isProductSpecifiable() {
|
|
7450
|
+
return this.product.isNull && !this.isIgnored;
|
|
7451
|
+
}
|
|
7433
7452
|
/**
|
|
7434
7453
|
* @inheritDoc
|
|
7435
7454
|
*/
|
|
@@ -7448,6 +7467,12 @@ class ScProfstroyOrderItem extends ScOrderItem {
|
|
|
7448
7467
|
}
|
|
7449
7468
|
return super.getUnavailableReason();
|
|
7450
7469
|
}
|
|
7470
|
+
/**
|
|
7471
|
+
* @inheritDoc
|
|
7472
|
+
*/
|
|
7473
|
+
getNotice() {
|
|
7474
|
+
return this.lineNotice ?? '';
|
|
7475
|
+
}
|
|
7451
7476
|
}
|
|
7452
7477
|
|
|
7453
7478
|
/**
|
|
@@ -7789,6 +7814,10 @@ class ScOrderDraftsService {
|
|
|
7789
7814
|
* Коды отказа, после которых черновик перезапрашивается.
|
|
7790
7815
|
*/
|
|
7791
7816
|
static { this.rejectionStatuses = [HttpStatusCode.Forbidden, HttpStatusCode.Conflict]; }
|
|
7817
|
+
/**
|
|
7818
|
+
* Коды отказа и отсутствия позиции, после которых черновик перезапрашивается: позицию могли удалить или собрать заново.
|
|
7819
|
+
*/
|
|
7820
|
+
static { this.rejectionOrMissingStatuses = [...ScOrderDraftsService.rejectionStatuses, HttpStatusCode.NotFound]; }
|
|
7792
7821
|
/**
|
|
7793
7822
|
* Возвращает ключ очереди запросов черновика.
|
|
7794
7823
|
*
|
|
@@ -7949,6 +7978,22 @@ class ScOrderDraftsService {
|
|
|
7949
7978
|
});
|
|
7950
7979
|
}), this.updatesDraft(offerId));
|
|
7951
7980
|
}
|
|
7981
|
+
/**
|
|
7982
|
+
* Указывает товар каталога для позиции черновика Профстрой, по которой товар не найден. После 404 черновик тоже перезапрашивается:
|
|
7983
|
+
* позицию могли удалить или собрать заново.
|
|
7984
|
+
*
|
|
7985
|
+
* @param offerId Идентификатор черновика.
|
|
7986
|
+
* @param itemId Идентификатор позиции.
|
|
7987
|
+
* @param productId Идентификатор товара каталога.
|
|
7988
|
+
*/
|
|
7989
|
+
specifyProfstroyProduct$(offerId, itemId, productId) {
|
|
7990
|
+
const body = { productId };
|
|
7991
|
+
return this.http
|
|
7992
|
+
.patch(`${this.urls.apiUrl}/orders/offers/${offerId}/profstroy/products/${itemId}/product`, body, {
|
|
7993
|
+
context: ScOrderDraftsService.getErrorContext('Не удалось сохранить товар позиции.'),
|
|
7994
|
+
})
|
|
7995
|
+
.pipe(this.updatesDraft(offerId, ScOrderDraftsService.rejectionOrMissingStatuses));
|
|
7996
|
+
}
|
|
7952
7997
|
/**
|
|
7953
7998
|
* Создаёт новое коммерческое предложение/черновик заказа.
|
|
7954
7999
|
*
|
|
@@ -8131,7 +8176,7 @@ class ScOrderDraftsService {
|
|
|
8131
8176
|
body,
|
|
8132
8177
|
context: ScOrderDraftsService.getErrorContext('Не удалось удалить позиции.'),
|
|
8133
8178
|
})
|
|
8134
|
-
.pipe(this.updatesDraft(offerId,
|
|
8179
|
+
.pipe(this.updatesDraft(offerId, ScOrderDraftsService.rejectionOrMissingStatuses));
|
|
8135
8180
|
}
|
|
8136
8181
|
/**
|
|
8137
8182
|
* Возвращает оператор запроса, который отвечает черновиком целиком: ответ кладётся в кэш, после отказа черновик перезапрашивается,
|