Skip to main content

ProjectModelToProject

Transforms a project DB model into a project proto with injected domains.

def ProjectModelToProject(
model: *models.Project,
domains: []*project.Domain
) - > *project.Project, error

Transforms a project database model into a project protobuf message, injecting specified domain information. This function is used to convert internal database representations of projects into a format suitable for API responses or inter-service communication.

Parameters

NameTypeDescription
model*models.ProjectThe database model of the project to be transformed. This model contains the raw project data from the database.
domains[]*project.DomainA slice of project.Domain protobuf messages to be injected into the resulting project. These domains typically represent associated organizational units or logical groupings.

Returns

TypeDescription
*project.Project, errorA pointer to the project.Project protobuf message representing the transformed project, and an error if the unmarshaling of project labels fails.