(record []string, columnMap map[string]int, field string)
| 446 | } |
| 447 | |
| 448 | func getRequiredField(record []string, columnMap map[string]int, field string) (string, error) { |
| 449 | if index, exists := columnMap[field]; exists && index < len(record) { |
| 450 | value := strings.TrimSpace(record[index]) |
| 451 | if value == "" { |
| 452 | return "", fmt.Errorf("required field '%s' is empty", field) |
| 453 | } |
| 454 | return value, nil |
| 455 | } |
| 456 | return "", fmt.Errorf("required field '%s' not found in record", field) |
| 457 | } |
| 458 | |
| 459 | // ProcessJSON now uses batch processing |
| 460 | func ProcessJSON(ctx context.Context, uploadID, source string, reader io.Reader, store StoreFunc) (int, error) { |
no outgoing calls
no test coverage detected