Skip to content

Commit cae91b0

Browse files
committed
Fix the version type
1 parent aae1e03 commit cae91b0

6 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/RealtimeServer/scriptureforge/models/translate-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export interface DraftUsfmConfig {
5959
}
6060

6161
export interface QualityEstimationConfig {
62-
version: number;
62+
version: string;
6363
slope: number;
6464
intercept: number;
6565
}

src/RealtimeServer/scriptureforge/services/sf-project-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export class SFProjectService extends ProjectService<SFProject> {
280280
bsonType: 'object',
281281
properties: {
282282
version: {
283-
bsonType: 'decimal'
283+
bsonType: 'string'
284284
},
285285
slope: {
286286
bsonType: 'double'

src/SIL.XForge.Scripture/Controllers/SFProjectsRpcController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ await projectService.SetQualityEstimationConfigAsync(
976976
{
977977
{ "method", "SetQualityEstimationConfig" },
978978
{ "projectId", projectId },
979-
{ "version", qualityEstimationConfig?.Version.ToString(CultureInfo.InvariantCulture) },
979+
{ "version", qualityEstimationConfig?.Version },
980980
{ "slope", qualityEstimationConfig?.Slope.ToString(CultureInfo.InvariantCulture) },
981981
{ "intercept", qualityEstimationConfig?.Intercept.ToString(CultureInfo.InvariantCulture) },
982982
}

src/SIL.XForge.Scripture/Models/QualityEstimationConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace SIL.XForge.Scripture.Models;
22

33
public class QualityEstimationConfig
44
{
5-
public decimal Version { get; set; }
5+
public required string Version { get; set; }
66
public double Slope { get; set; }
77
public double Intercept { get; set; }
88
}

test/SIL.XForge.Scripture.Tests/Controllers/SFProjectsRpcControllerTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ public async Task SetQualityEstimationConfig_Success()
10181018
var env = new TestEnvironment();
10191019
var qualityEstimationConfig = new QualityEstimationConfig
10201020
{
1021-
Version = 0.1M,
1021+
Version = "0.1",
10221022
Slope = 109.6145,
10231023
Intercept = -14.0633,
10241024
};
@@ -1037,7 +1037,7 @@ public async Task SetQualityEstimationConfig_Forbidden()
10371037
var env = new TestEnvironment();
10381038
var qualityEstimationConfig = new QualityEstimationConfig
10391039
{
1040-
Version = 0.1M,
1040+
Version = "0.1",
10411041
Slope = 109.6145,
10421042
Intercept = -14.0633,
10431043
};
@@ -1059,7 +1059,7 @@ public async Task SetQualityEstimationConfig_NotFound()
10591059
var env = new TestEnvironment();
10601060
var qualityEstimationConfig = new QualityEstimationConfig
10611061
{
1062-
Version = 0.1M,
1062+
Version = "0.1",
10631063
Slope = 109.6145,
10641064
Intercept = -14.0633,
10651065
};
@@ -1080,7 +1080,7 @@ public void SetQualityEstimationConfig_UnknownError()
10801080
var env = new TestEnvironment();
10811081
var qualityEstimationConfig = new QualityEstimationConfig
10821082
{
1083-
Version = 0.1M,
1083+
Version = "0.1",
10841084
Slope = 109.6145,
10851085
Intercept = -14.0633,
10861086
};

test/SIL.XForge.Scripture.Tests/Services/SFProjectServiceTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3924,7 +3924,7 @@ public void SetQualityEstimationConfigAsync_ProjectMustExist()
39243924
var env = new TestEnvironment();
39253925
var qualityEstimationConfig = new QualityEstimationConfig
39263926
{
3927-
Version = 0.1M,
3927+
Version = "0.1",
39283928
Slope = 109.6145,
39293929
Intercept = -14.0633,
39303930
};
@@ -3946,7 +3946,7 @@ public async Task SetQualityEstimationConfigAsync_UpdatesProjectDocument()
39463946
var env = new TestEnvironment();
39473947
var qualityEstimationConfig = new QualityEstimationConfig
39483948
{
3949-
Version = 0.1M,
3949+
Version = "0.1",
39503950
Slope = 109.6145,
39513951
Intercept = -14.0633,
39523952
};
@@ -3977,7 +3977,7 @@ public void SetQualityEstimationConfigAsync_UserMustBeServalAdmin()
39773977
var env = new TestEnvironment();
39783978
var qualityEstimationConfig = new QualityEstimationConfig
39793979
{
3980-
Version = 0.1M,
3980+
Version = "0.1",
39813981
Slope = 109.6145,
39823982
Intercept = -14.0633,
39833983
};
@@ -4893,7 +4893,7 @@ public TestEnvironment()
48934893
ServalConfig = "{ existingConfig: true }",
48944894
QualityEstimationConfig = new QualityEstimationConfig
48954895
{
4896-
Version = 0M,
4896+
Version = string.Empty,
48974897
Slope = 0.0,
48984898
Intercept = 0.0,
48994899
},

0 commit comments

Comments
 (0)