package transform

import (
	"github.com/UpmeshLTD/urus-aio/infrastructure/db/entities"
	"github.com/UpmeshLTD/urus-aio/shipment/server/http/dto"
)

func BusinessProfileEntityToDTO(profile *entities.BusinessProfile) *dto.BusinessProfile {
	merchantCode := ""
	if profile.MerchantCode != nil {
		merchantCode = *profile.MerchantCode
	}
	return &dto.BusinessProfile{
		ID:           profile.ID,
		WorkspaceID:  profile.WorkspaceID,
		MerchantCode: merchantCode,
	}
}
