This commit is contained in:
Aditya Siregar
2025-09-12 16:37:16 +07:00
parent 91f51d129e
commit 75ec5274d2
8 changed files with 45 additions and 46 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ func ChartOfAccountEntityToResponse(entity *entities.ChartOfAccount) *models.Cha
response := &models.ChartOfAccountResponse{
ID: entity.ID,
OrganizationID: entity.OrganizationID,
OutletID: entity.OutletID,
OutletID: &entity.OutletID,
ChartOfAccountTypeID: entity.ChartOfAccountTypeID,
ParentID: entity.ParentID,
Name: entity.Name,
@@ -44,7 +44,7 @@ func ChartOfAccountEntityToResponse(entity *entities.ChartOfAccount) *models.Cha
func ChartOfAccountCreateRequestToEntity(req *models.CreateChartOfAccountRequest, organizationID uuid.UUID, outletID *uuid.UUID) *entities.ChartOfAccount {
return &entities.ChartOfAccount{
OrganizationID: organizationID,
OutletID: outletID,
OutletID: *outletID,
ChartOfAccountTypeID: req.ChartOfAccountTypeID,
ParentID: req.ParentID,
Name: req.Name,
+4 -3
View File
@@ -3,6 +3,7 @@ package mappers
import (
"apskel-pos-be/internal/contract"
"apskel-pos-be/internal/models"
"github.com/google/uuid"
"time"
)
@@ -58,10 +59,10 @@ func ContractToModelUpdateChartOfAccountRequest(req *contract.UpdateChartOfAccou
}
}
func ContractToModelListChartOfAccountsRequest(req *contract.ListChartOfAccountsRequest) *models.ListChartOfAccountsRequest {
func ContractToModelListChartOfAccountsRequest(req *contract.ListChartOfAccountsRequest, organizationID, outletID uuid.UUID) *models.ListChartOfAccountsRequest {
return &models.ListChartOfAccountsRequest{
OrganizationID: req.OrganizationID,
OutletID: req.OutletID,
OrganizationID: organizationID,
OutletID: outletID,
ChartOfAccountTypeID: req.ChartOfAccountTypeID,
ParentID: req.ParentID,
IsActive: req.IsActive,