-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
518 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
source/backend/api/Models/Concepts/Project/ProjectProductMap.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Mapster; | ||
using Entity = Pims.Dal.Entities; | ||
|
||
namespace Pims.Api.Models.Concepts | ||
{ | ||
public class ProjectProductMap : IRegister | ||
{ | ||
public void Register(TypeAdapterConfig config) | ||
{ | ||
config.NewConfig<Entity.PimsProjectProduct, ProjectProductModel>() | ||
.Map(dest => dest.Id, src => src.ProjectProductId) | ||
.Map(dest => dest.ProjectId, src => src.ProjectId) | ||
.Map(dest => dest.Product, src => src.Product) | ||
.Map(dest => dest.ProductId, src => src.ProductId) | ||
.Map(dest => dest.Project, src => src.Project) | ||
.Inherits<Entity.IBaseEntity, BaseModel>(); | ||
|
||
config.NewConfig<ProjectProductModel, Entity.PimsProjectProduct>() | ||
.Map(dest => dest.ProjectProductId, src => src.Id) | ||
.Map(dest => dest.ProjectId, src => src.ProjectId) | ||
.Map(dest => dest.ProductId, src => src.Product.Id) | ||
.Map(dest => dest.Product, src => src.Product) | ||
.Inherits<BaseModel, Entity.IBaseEntity>(); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
source/backend/api/Models/Concepts/Project/ProjectProductModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
namespace Pims.Api.Models.Concepts | ||
{ | ||
/* | ||
* Frontend model | ||
* LINK @frontend/src\models\api\Project.ts | ||
*/ | ||
public class ProjectProductModel : BaseAppModel | ||
{ | ||
#region Properties | ||
|
||
public long Id { get; set; } | ||
|
||
public long ProjectId { get; set; } | ||
|
||
public ProductModel Product { get; set; } | ||
|
||
public long ProductId { get; set; } | ||
|
||
public ProjectModel Project { get; set; } | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.