# Bulk create production records Creates multiple production records in a single request (offline sync). Requires JWT token authentication in the Authorization header. Each record is processed independently with full validation and idempotency. Returns multi-status response (207) with individual results. Endpoint: POST /api/control/production/records/bulk Version: 2.0.0 Security: bearerAuth ## Request fields (application/json): - `auth0Id` (string, required) User identifier (internal use, derived from JWT token) Example: "user_123456789" - `records` (array, required) Array of production records to create - `records.sessionId` (string, required) Session identifier Example: "6507f1e3c9d8e2a4b1f9c3d5" - `records.workerId` (string, required) Worker identifier Example: "JS0315" - `records.worker_name` (string, required) Worker full name Example: "John Smith" - `records.units` (number) Number of units to record (defaults to 1) Example: 5 - `records.recordedAtUtc` (string, required) Timestamp when the record was created (ISO 8601 UTC) Example: "2025-10-19T14:30:00.000Z" - `records.idempotencyKey` (string) Idempotency key for deduplication Example: "mobile-app-key-timestamp-123456" - `records.clientEventId` (string, required) Unique client-side event identifier for idempotency Example: "evt_1234567890abcdef" ## Response 207 fields (application/json): - `status` (string) Example: "success" - `results` (array) - `results.index` (integer) Index of the record in the request array - `results.statusCode` (integer) HTTP status code for this record (201=created, 200=duplicate, 4xx/5xx=error) Example: 201 - `results.payloadPreview` (object) - `results.payloadPreview.recordId` (string) Example: "rec_1234567890abcdef" - `results.payloadPreview.sessionId` (string) Example: "6507f1e3c9d8e2a4b1f9c3d5" - `results.payloadPreview.workerId` (string) Example: "JS0315" - `results.payloadPreview.units` (number) Example: 5 - `results.idempotent` (boolean) Present when statusCode=200 (duplicate) - `results.error` (string) Error message (only when statusCode indicates error) Example: "Missing sessionId or workerId" - `summary` (object) - `summary.ok` (integer) Number of successfully created records Example: 2 - `summary.duplicated` (integer) Number of idempotent duplicates - `summary.failed` (integer) Number of failed records ## Response 400 fields (application/json): - `status` (string) Example: "error" - `message` (string) Example: "Error message description" - `error` (string) Example: "Detailed error information" ## Response 401 fields (application/json): - `status` (string) Example: "error" - `message` (string) Example: "Error message description" - `error` (string) Example: "Detailed error information" ## Response 500 fields (application/json): - `status` (string) Example: "error" - `message` (string) Example: "Error message description" - `error` (string) Example: "Detailed error information"