feat(cpone): migrate lab registration endpoints

This commit is contained in:
2026-08-18 14:14:49 +07:00
parent 676d930561
commit a799022bb5
11 changed files with 2590 additions and 7 deletions

View File

@@ -0,0 +1,16 @@
package repository
import "testing"
func TestAbsoluteSharesToPercentagesMatchesLaravel(t *testing.T) {
result := absoluteSharesToPercentages([4]float64{50000, 30000, 10000, 10000}, 100000)
expected := [4]float64{50, 30, 10, 10}
if result != expected {
t.Fatalf("shares = %v, want %v", result, expected)
}
withRounding := absoluteSharesToPercentages([4]float64{1, 1, 1, 0}, 3)
if withRounding != [4]float64{33.34, 33.33, 33.33, 0} {
t.Fatalf("rounded shares = %v", withRounding)
}
}