Endpointtoday's app
- Call
DELETE /gateway/portfolio-service/api/v1/portfolios/portfolioLineItem/?logCropActivity&portfolioId&portfolioLineItemId&portfolioLineItemUUID- Service
- portfolio-service
- Features
- Crop Actual (portfolio), Crop Plan
- When
- Queued sync (IE_PORTFOLIO_LINE_ITEM DELETE)
- Auth
- X-SESSIONID stamped when queued (CoreAPI dooWithRetry); X-REQUESTID idempotency key
- In the App Service
Use case
Queued delete of a crop line item (IE_PORTFOLIO_LINE_ITEM DELETE) when the user deletes a crop actual. On success the local PPLI rows and PLI row are deleted. Failures retry.
Headers
| Header | Value | Notes |
|---|
X-SESSIONID | <session token> | Stamped when queued (dooWithRetry); refreshed on 401. |
Content-Type | application/json | Added by CoreAPI even though there is no body. No X-REQUESTID: DELETE ops do not get one. |
Parameters
| Param | In | Required | Example | Notes |
|---|
logCropActivity | query | Yes | true | Always true. |
portfolioId | query | Yes | 5001 | Server portfolio id ('0' if unknown). |
portfolioLineItemId | query | Yes | 6001 | Server PLI id. |
portfolioLineItemUUID | query | Yes | 5f6c1d2e-0000-4000-8000-00000000a001 | Client uuid. |
Request
No body. portfolioId, portfolioLineItemId, portfolioLineItemUUID
Response
| Field | Type | Required | Notes |
|---|
(body) | unknown | | Not read. |
Errors
| Status | When | What the app does |
|---|
401 | Session token expired or invalid | CoreAPI invalidates the session id and retries once immediately; if still failing the op stays in the queue (TryAgain.LATER). |
500 | Server error on a /gateway URL | BaseResponseHandler fetches a new session id (first 5 attempts) and returns TryAgain.LATER; retried per RetryScheduler policy (retry threshold/delay come from app config). |
503 | Service unavailable | CoreAPI retries once immediately, then the op is retried later by the sync queue. |
any non-2xx | Any other failure | Handler onError -> TryAgain.LATER (op stays queued and is visible in Pending Sync); a row is written to the local error_log table (Sync Error Log screen) with URL, body, headers and raw response; every 10th attempt the op is mirrored to Firestore for support. |
Source
- data/src/main/java/org/mindtree/app/agricultor/data/entity/PortfolioLineItem.kt
- data/src/main/java/org/mindtree/app/agricultor/data/sync/work/PortfolioLineItemWorker.kt
- data/src/main/java/org/mindtree/app/agricultor/data/sync/rh/PortfolioLineItemDeleteRH.kt
- app/src/main/java/org/platformcommons/urvi/bridge/BridgeSyncHelper.kt
- data/src/main/java/org/mindtree/app/agricultor/data/manager/CoreAPIManager.kt
- data/src/main/java/org/mindtree/app/agricultor/data/sync/rh/BaseResponseHandler.kt
- offline-core/src/main/java/com/mindtree/bridge/coreapi/offline/SyncQueueProcessor.java
- offline-core/src/main/java/com/mindtree/bridge/coreapi/offline/manager/OperationManagerImpl.java
- core-api/src/main/java/com/mindtree/bridge/coreapi/impl/CoreAPIDefaultImpl.java