detectUserReportFormat checks CSV headers to determine if this is the new user_report format
(headers []string)
| 171 | |
| 172 | // detectUserReportFormat checks CSV headers to determine if this is the new user_report format |
| 173 | func detectUserReportFormat(headers []string) bool { |
| 174 | for _, h := range headers { |
| 175 | trimmed := strings.TrimSpace(h) |
| 176 | if trimmed == "Client_Type" || trimmed == "Credits_Used" { |
| 177 | return true |
| 178 | } |
| 179 | } |
| 180 | return false |
| 181 | } |
| 182 | |
| 183 | // createUserReportData creates a QDevUserReport from a new-format CSV record |
| 184 | func createUserReportData(logger interface { |
no outgoing calls