ConvertTemplateVersion anonymizes a template version.
(version database.TemplateVersion)
| 1491 | |
| 1492 | // ConvertTemplateVersion anonymizes a template version. |
| 1493 | func ConvertTemplateVersion(version database.TemplateVersion) TemplateVersion { |
| 1494 | snapVersion := TemplateVersion{ |
| 1495 | ID: version.ID, |
| 1496 | CreatedAt: version.CreatedAt, |
| 1497 | OrganizationID: version.OrganizationID, |
| 1498 | JobID: version.JobID, |
| 1499 | } |
| 1500 | if version.TemplateID.Valid { |
| 1501 | snapVersion.TemplateID = &version.TemplateID.UUID |
| 1502 | } |
| 1503 | if version.SourceExampleID.Valid { |
| 1504 | snapVersion.SourceExampleID = &version.SourceExampleID.String |
| 1505 | } |
| 1506 | if version.HasAITask.Valid { |
| 1507 | snapVersion.HasAITask = ptr.Ref(version.HasAITask.Bool) |
| 1508 | } |
| 1509 | return snapVersion |
| 1510 | } |
| 1511 | |
| 1512 | func ConvertLicense(license database.License) License { |
| 1513 | // License is intentionally not anonymized because it's |
no test coverage detected