-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Story 2067: Refactor thing type (#2095)
* Remove thing types entities * Remove thing types repositories * Remove thing types repositories interfaces * Remove InsertAngGetIdAsync * Add repos DeviceModelRepository and LabelRepository on uof * Add AWS external service to manage aws iot * Remove aws automappers * Remove ThingTypeService * Add AwsDeviceModelService * Remove Aws thing type controller * Update SyncThingTypesJob * Add ef migration to remove thing types entities * Update device model base controller to return device model dto on create * Revert DeviceModelSearch component * Revert DeviceModel pages * Remove Thing Type client service * Remove thing type validator * Remove references to thing type client service * Update CreateDeviceModel method * Update unit tests after deletion of thing types references * Add delete labels before delete device model on aws device model service * Fix code scan warning on test Execute_SyncNewAndExistingAndDepprecatedThingTypes_DeviceModelsSynced * Add unit tests on AwsDeviceModelService * Update unit test SaveAsyncTest * Update exceptions on AwsExternalDeviceService * Fix unit test name * Add unit tests on AwsExternalDeviceService * Remove unused declaration on test CreateDeviceModel_ExistingThingType_ResourceAlreadyExistsExceptionIsThrown * Remove IExternalDeviceServiceV2 * Move IExternalDeviceServiceV2 methods to IExternalDeviceService * Implement IExternalDeviceService * Update AwsDeviceModelService to use IExternalDeviceService * Update unit tests on aws to use IExternalDeviceService * Remove repositories from UnitOfWork * Revert unit tests on UnitOfWorkTests * Add unit tests on ExternalDeviceServiceTests
- Loading branch information
1 parent
d94138a
commit cd1a958
Showing
73 changed files
with
3,108 additions
and
4,512 deletions.
There are no files selected for viewing
55 changes: 0 additions & 55 deletions
55
src/AzureIoTHub.Portal.Application/Mappers/AWS/ThingTypeProfile.cs
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
src/AzureIoTHub.Portal.Application/Mappers/AWS/ThingTypeSearchableAttProfile.cs
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
src/AzureIoTHub.Portal.Application/Mappers/AWS/ThingTypeTagProfile.cs
This file was deleted.
Oops, something went wrong.
66 changes: 42 additions & 24 deletions
66
src/AzureIoTHub.Portal.Application/Mappers/DeviceModelProfile.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 |
---|---|---|
@@ -1,24 +1,42 @@ | ||
// Copyright (c) CGI France. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace AzureIoTHub.Portal.Application.Mappers | ||
{ | ||
using AutoMapper; | ||
using AzureIoTHub.Portal.Domain.Entities; | ||
using Models.v10; | ||
using Models.v10.LoRaWAN; | ||
|
||
public class DeviceModelProfile : Profile | ||
{ | ||
public DeviceModelProfile() | ||
{ | ||
_ = CreateMap<DeviceModelDto, DeviceModel>() | ||
.ForMember(dest => dest.Id, opts => opts.MapFrom(src => src.ModelId)) | ||
.ReverseMap(); | ||
|
||
_ = CreateMap<LoRaDeviceModelDto, DeviceModel>() | ||
.ForMember(dest => dest.Id, opts => opts.MapFrom(src => src.ModelId)) | ||
.ReverseMap(); | ||
} | ||
} | ||
} | ||
// Copyright (c) CGI France. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace AzureIoTHub.Portal.Application.Mappers | ||
{ | ||
using Amazon.IoT.Model; | ||
using AutoMapper; | ||
using AzureIoTHub.Portal.Domain.Entities; | ||
using AzureIoTHub.Portal.Domain.Shared; | ||
using Models.v10; | ||
using Models.v10.LoRaWAN; | ||
|
||
public class DeviceModelProfile : Profile | ||
{ | ||
public DeviceModelProfile() | ||
{ | ||
_ = CreateMap<DeviceModelDto, DeviceModel>() | ||
.ForMember(dest => dest.Id, opts => opts.MapFrom(src => src.ModelId)) | ||
.ReverseMap(); | ||
|
||
_ = CreateMap<LoRaDeviceModelDto, DeviceModel>() | ||
.ForMember(dest => dest.Id, opts => opts.MapFrom(src => src.ModelId)) | ||
.ReverseMap(); | ||
|
||
_ = CreateMap<DeviceModelDto, ExternalDeviceModelDto>() | ||
.ForMember(dest => dest.Name, opts => opts.MapFrom(src => src.Name)) | ||
.ForMember(dest => dest.Description, opts => opts.MapFrom(src => src.Description)); | ||
|
||
_ = CreateMap<ExternalDeviceModelDto, CreateThingTypeRequest>() | ||
.ForMember(dest => dest.ThingTypeName, opts => opts.MapFrom(src => src.Name)) | ||
.ForMember(dest => dest.ThingTypeProperties, opts => opts.MapFrom(src => new ThingTypeProperties | ||
{ | ||
ThingTypeDescription = src.Description | ||
})); | ||
|
||
_ = CreateMap<DescribeThingTypeResponse, DeviceModel>() | ||
.ForMember(dest => dest.Id, opts => opts.MapFrom(src => src.ThingTypeId)) | ||
.ForMember(dest => dest.Name, opts => opts.MapFrom(src => src.ThingTypeName)) | ||
.ForMember(dest => dest.Description, opts => opts.MapFrom(src => src.ThingTypeProperties.ThingTypeDescription ?? string.Empty)); | ||
} | ||
} | ||
} |
30 changes: 0 additions & 30 deletions
30
src/AzureIoTHub.Portal.Application/Services/AWS/IThingTypeService.cs
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.