feat: update profit sharing

This commit is contained in:
efrilm
2026-10-04 21:54:13 +07:00
parent b59b7b4ddd
commit 117e3529aa
23 changed files with 521 additions and 95 deletions
+34
View File
@@ -0,0 +1,34 @@
package mappers
import (
"testing"
"apskel-pos-be/internal/models"
"github.com/google/uuid"
"github.com/stretchr/testify/require"
)
func TestCreateCategoryRequestToEntityDefaultsToTeam(t *testing.T) {
notTeam := false
tests := []struct {
name string
isTeam *bool
want bool
}{
{name: "omitted is a team", isTeam: nil, want: true},
{name: "false is not a team", isTeam: &notTeam, want: false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
entity := CreateCategoryRequestToEntity(&models.CreateCategoryRequest{
OrganizationID: uuid.New(),
Name: "Merchandise",
IsTeam: tt.isTeam,
})
require.Equal(t, tt.want, entity.IsTeam)
})
}
}