# API Extensions - Batches ### Get & Create - old queries ---------------- ### Update **Scenarios**: - [x] Update platform for a batch with jobs - error: `"Cannot update platform for batch with existing jobs"` - [x] Regression - [x] Update platform for a batch without jobs - updates platform - [x] Regression - [x] Unset platformId - Platform is removed - [x] Regression - [x] Update name, delivery end&start date, job name format - [x] Regression - ok both on batch with or without jobs - [x] Update a batch that doesn't exist - error: `"Batch with name: test-auto_jobsBatch_mihaUpdated was not found on organization: c8b2d689-90b5-4a81-8dfc-5ae0aff74f1e!"` - [x] Regression - [x] Pass empty input (update nothing) - query returns success, nothing is updated - [x] Regression - [x] Update all details (including platform) on multiple batches with the same name and without jobs - updates all batches ---------------- ### Delete **Scenarios**: - [x] Delete batch with no jobs - [x] Delete multiple batches with the same name (and with no jobs) - [x] Delete multiple batches with the same name when one has one or more jobs - deletes batches with no jobs - query returns `"Cannot delete this Batch because it is referenced by one or more jobs"` ---------------- ### Add Jobs to Batch **Scenarios**: - [x] Add one job to the Batch - job successfully added - [x] Regression - [x] Add multiple jobs to the Batch - jobs successfully added - [x] Regression - [x] Add multiple jobs (10) to the same Batch with the same "lookupField" (name, value) - jobs added - [x] Regression - [x] Add multiple jobs to different Batches - issue raised: https://ateliere.atlassian.net/browse/CD-10948 - [x] Regression - [x] Add jobs to a Batch which doesn't exist - error: ` "message": "Batch with name: June was not found on organization: c8b2d689-90b5-4a81-8dfc-5ae0aff74f1e!"` - [x] Regression - [x] Add jobs with empty packageTemplateID - error: `"message": "Job creation requires either a packageTemplateId or a packageId"` - [x] Add jobs to Batch with entityTypeName which is not assigned to any title - error: ` "message": "No candidate entities found for key: raluca june,Global,cirese. Please ensure your entity exists and the attribute used for the lookup is of type String"` - [x] Add multiple jobs to the same Batch - all jobs are successfully added to the same Batch - [x] Add jobs to Batch with empty "deliveryTargetDate" - error: ` "message": "invalid input syntax for type timestamp with time zone: \"Invalid date\""` - error: `"message": "deliveryTargetDate is required"` - [x] Add jobs to Batch with a different "deliveryTargetDate" as the Batch - issue raised: https://ateliere.atlassian.net/browse/CD-10954 - [x] Add the same title multiple times in the same Batch ----------------