coa fix
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user