2510 lines
86 KiB
C#
2510 lines
86 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using gehGassi.Dto;
|
|
using gehGassi.Dto.Advertisements;
|
|
using gehGassi.Dto.Banners;
|
|
using gehGassi.Dto.Common;
|
|
using gehGassi.Dto.DogOwners;
|
|
using gehGassi.Dto.Dogs;
|
|
using gehGassi.Dto.DogWalkers;
|
|
using gehGassi.Dto.Favourites;
|
|
using gehGassi.Dto.Feedback;
|
|
using gehGassi.Dto.Listings;
|
|
using gehGassi.Dto.Lookup;
|
|
using gehGassi.Dto.Messages;
|
|
using gehGassi.Dto.News;
|
|
using gehGassi.Dto.Payment;
|
|
using gehGassi.Dto.Pushnotifications;
|
|
using gehGassi.Dto.Ratings;
|
|
using gehGassi.Dto.Subscriptions;
|
|
using gehGassi.Dto.Vouchers;
|
|
using gehGassi.Dto.Walks;
|
|
using gehGassiApp.Domain.Advertisements;
|
|
using gehGassiApp.Domain.AppVersions;
|
|
using gehGassiApp.Domain.Authentication;
|
|
using gehGassiApp.Domain.Banners;
|
|
using gehGassiApp.Domain.Common;
|
|
using gehGassiApp.Domain.Dogs;
|
|
using gehGassiApp.Domain.Favourites;
|
|
using gehGassiApp.Domain.Feedback;
|
|
using gehGassiApp.Domain.Listings;
|
|
using gehGassiApp.Domain.Lookup;
|
|
using gehGassiApp.Domain.Messages;
|
|
using gehGassiApp.Domain.News;
|
|
using gehGassiApp.Domain.Payment;
|
|
using gehGassiApp.Domain.Pushnotifications;
|
|
using gehGassiApp.Domain.Subscriptions;
|
|
using gehGassiApp.Domain.Users;
|
|
using gehGassiApp.Domain.Vouchers;
|
|
using gehGassiApp.Domain.Walkers;
|
|
using gehGassiApp.Domain.Walks;
|
|
using Platform = gehGassiApp.Domain.Common.Platform;
|
|
|
|
namespace gehGassiApp.Core.Mapper
|
|
{
|
|
/// <summary>
|
|
/// Hilfsklasse für das Mapping von Entitäten und DTOs
|
|
/// </summary>
|
|
public static class MappingExtensions
|
|
{
|
|
#region Enums
|
|
|
|
public static SexDto ToDto(this Sex domain)
|
|
{
|
|
return (SexDto)domain;
|
|
}
|
|
|
|
public static Sex ToDomain(this SexDto dto)
|
|
{
|
|
return (Sex)dto;
|
|
}
|
|
|
|
public static AppModeDto ToDto(this AppMode domain)
|
|
{
|
|
return (AppModeDto)domain;
|
|
}
|
|
|
|
public static AppMode ToDomain(this AppModeDto dto)
|
|
{
|
|
return (AppMode)dto;
|
|
}
|
|
|
|
public static OnlineStatusDto ToDto(this OnlineStatus domain)
|
|
{
|
|
return (OnlineStatusDto)domain;
|
|
}
|
|
|
|
public static OnlineStatus ToDomain(this OnlineStatusDto dto)
|
|
{
|
|
return (OnlineStatus)dto;
|
|
}
|
|
|
|
public static AppUserTypeDto ToDto(this AppUserType domain)
|
|
{
|
|
return (AppUserTypeDto)domain;
|
|
}
|
|
|
|
public static AppUserType ToDomain(this AppUserTypeDto dto)
|
|
{
|
|
return (AppUserType)dto;
|
|
}
|
|
|
|
public static CreateStatusDto ToDto(this CreateStatus domain)
|
|
{
|
|
return (CreateStatusDto)domain;
|
|
}
|
|
|
|
public static CreateStatus ToDomain(this CreateStatusDto dto)
|
|
{
|
|
return (CreateStatus)dto;
|
|
}
|
|
|
|
public static ListingTypeDto ToDto(this ListingType domain)
|
|
{
|
|
return (ListingTypeDto)domain;
|
|
}
|
|
|
|
public static ListingType ToDomain(this ListingTypeDto dto)
|
|
{
|
|
return (ListingType)dto;
|
|
}
|
|
|
|
public static BannerStatusDto ToDto(this BannerStatus domain)
|
|
{
|
|
return (BannerStatusDto)domain;
|
|
}
|
|
|
|
public static BannerStatus ToDomain(this BannerStatusDto dto)
|
|
{
|
|
return (BannerStatus)dto;
|
|
}
|
|
|
|
public static BannerSizeDto ToDto(this BannerSize domain)
|
|
{
|
|
return (BannerSizeDto)domain;
|
|
}
|
|
|
|
public static BannerSize ToDomain(this BannerSizeDto dto)
|
|
{
|
|
return (BannerSize)dto;
|
|
}
|
|
|
|
public static BannerLocationDto ToDto(this BannerLocation domain)
|
|
{
|
|
return (BannerLocationDto)domain;
|
|
}
|
|
|
|
public static BannerLocation ToDomain(this BannerLocationDto dto)
|
|
{
|
|
return (BannerLocation)dto;
|
|
}
|
|
|
|
public static DogSexDto ToDto(this DogSex domain)
|
|
{
|
|
return (DogSexDto)domain;
|
|
}
|
|
|
|
public static DogSex ToDomain(this DogSexDto dto)
|
|
{
|
|
return (DogSex)dto;
|
|
}
|
|
|
|
public static DogSizeDto ToDto(this DogSize domain)
|
|
{
|
|
return (DogSizeDto)domain;
|
|
}
|
|
|
|
public static DogSize ToDomain(this DogSizeDto dto)
|
|
{
|
|
return (DogSize)dto;
|
|
}
|
|
|
|
public static DogAggressionLevelDto ToDto(this DogAggressionLevel domain)
|
|
{
|
|
return (DogAggressionLevelDto)domain;
|
|
}
|
|
|
|
public static DogAggressionLevel ToDomain(this DogAggressionLevelDto dto)
|
|
{
|
|
return (DogAggressionLevel)dto;
|
|
}
|
|
|
|
public static DogFeedingTimesDto ToDto(this DogFeedingTimes domain)
|
|
{
|
|
return (DogFeedingTimesDto)domain;
|
|
}
|
|
|
|
public static DogFeedingTimes ToDomain(this DogFeedingTimesDto dto)
|
|
{
|
|
return (DogFeedingTimes)dto;
|
|
}
|
|
|
|
public static DogWalkRequestTypeDto ToDto(this DogWalkRequestType domain)
|
|
{
|
|
return (DogWalkRequestTypeDto)domain;
|
|
}
|
|
|
|
public static DogWalkRequestType ToDomain(this DogWalkRequestTypeDto dto)
|
|
{
|
|
return (DogWalkRequestType)dto;
|
|
}
|
|
|
|
public static PublicWalkRequestTypeDto ToDto(this PublicWalkRequestType domain)
|
|
{
|
|
return (PublicWalkRequestTypeDto)domain;
|
|
}
|
|
|
|
public static PublicWalkRequestType ToDomain(this PublicWalkRequestTypeDto dto)
|
|
{
|
|
return (PublicWalkRequestType)dto;
|
|
}
|
|
|
|
public static PublicWalkRequestStatusDto ToDto(this PublicWalkRequestStatus domain)
|
|
{
|
|
return (PublicWalkRequestStatusDto)domain;
|
|
}
|
|
|
|
public static PublicWalkRequestStatus ToDomain(this PublicWalkRequestStatusDto dto)
|
|
{
|
|
return (PublicWalkRequestStatus)dto;
|
|
}
|
|
|
|
public static PublicWalkResponseStatusDto ToDto(this PublicWalkResponseStatus domain)
|
|
{
|
|
return (PublicWalkResponseStatusDto)domain;
|
|
}
|
|
|
|
public static PublicWalkResponseStatus ToDomain(this PublicWalkResponseStatusDto dto)
|
|
{
|
|
return (PublicWalkResponseStatus)dto;
|
|
}
|
|
|
|
public static WalkTypeDto ToDto(this WalkType domain)
|
|
{
|
|
return (WalkTypeDto)domain;
|
|
}
|
|
|
|
public static WalkType ToDomain(this WalkTypeDto dto)
|
|
{
|
|
return (WalkType)dto;
|
|
}
|
|
|
|
public static WalkServiceTypeDto ToDto(this WalkServiceType domain)
|
|
{
|
|
return (WalkServiceTypeDto)domain;
|
|
}
|
|
|
|
public static WalkServiceType ToDomain(this WalkServiceTypeDto dto)
|
|
{
|
|
return (WalkServiceType)dto;
|
|
}
|
|
|
|
public static WalkStatusDto ToDto(this WalkStatus domain)
|
|
{
|
|
return (WalkStatusDto)domain;
|
|
}
|
|
|
|
public static WalkStatus ToDomain(this WalkStatusDto dto)
|
|
{
|
|
return (WalkStatus)dto;
|
|
}
|
|
|
|
public static CancellationSourceDto ToDto(this CancellationSource domain)
|
|
{
|
|
return (CancellationSourceDto)domain;
|
|
}
|
|
|
|
public static CancellationSource ToDomain(this CancellationSourceDto dto)
|
|
{
|
|
return (CancellationSource)dto;
|
|
}
|
|
|
|
public static PaymentStatusDto ToDto(this PaymentStatus domain)
|
|
{
|
|
return (PaymentStatusDto)domain;
|
|
}
|
|
|
|
public static PaymentStatus ToDomain(this PaymentStatusDto dto)
|
|
{
|
|
return (PaymentStatus)dto;
|
|
}
|
|
|
|
public static SortDirectionDto ToDto(this SortDirection domain)
|
|
{
|
|
return (SortDirectionDto)domain;
|
|
}
|
|
|
|
public static SortDirection ToDomain(this SortDirectionDto dto)
|
|
{
|
|
return (SortDirection)dto;
|
|
}
|
|
|
|
public static RatingTargetDto ToDto(this RatingTarget domain)
|
|
{
|
|
return (RatingTargetDto)domain;
|
|
}
|
|
|
|
public static RatingTarget ToDomain(this RatingTargetDto dto)
|
|
{
|
|
return (RatingTarget)dto;
|
|
}
|
|
|
|
public static AppFeedbackTypeDto ToDto(this AppFeedbackType domain)
|
|
{
|
|
return (AppFeedbackTypeDto)domain;
|
|
}
|
|
|
|
public static AppFeedbackType ToDomain(this AppFeedbackTypeDto dto)
|
|
{
|
|
return (AppFeedbackType)dto;
|
|
}
|
|
|
|
public static AppFeedbackStatusDto ToDto(this AppFeedbackStatus domain)
|
|
{
|
|
return (AppFeedbackStatusDto)domain;
|
|
}
|
|
|
|
public static AppFeedbackStatus ToDomain(this AppFeedbackStatusDto dto)
|
|
{
|
|
return (AppFeedbackStatus)dto;
|
|
}
|
|
|
|
public static SystemMessageTypeDto ToDto(this SystemMessageType domain)
|
|
{
|
|
return (SystemMessageTypeDto)domain;
|
|
}
|
|
|
|
public static SystemMessageType ToDomain(this SystemMessageTypeDto dto)
|
|
{
|
|
return (SystemMessageType)dto;
|
|
}
|
|
|
|
public static NotificationPlatformDto ToDto(this NotificationPlatform domain)
|
|
{
|
|
return (NotificationPlatformDto)domain;
|
|
}
|
|
|
|
public static NotificationPlatform ToDomain(this NotificationPlatformDto dto)
|
|
{
|
|
return (NotificationPlatform)dto;
|
|
}
|
|
|
|
public static PlatformDto ToDto(this Platform domain)
|
|
{
|
|
return (PlatformDto)domain;
|
|
}
|
|
|
|
public static Platform ToDomain(this PlatformDto dto)
|
|
{
|
|
return (Platform)dto;
|
|
}
|
|
|
|
public static WalletTypeDto ToDto(this WalletType domain)
|
|
{
|
|
return (WalletTypeDto)domain;
|
|
}
|
|
|
|
public static WalletType ToDomain(this WalletTypeDto dto)
|
|
{
|
|
return (WalletType)dto;
|
|
}
|
|
|
|
public static PayInTypeDto ToDto(this PayInType domain)
|
|
{
|
|
return (PayInTypeDto)domain;
|
|
}
|
|
|
|
public static PayInType ToDomain(this PayInTypeDto dto)
|
|
{
|
|
return (PayInType)dto;
|
|
}
|
|
|
|
public static IdentityDocumentTypeDto ToDto(this IdentityDocumentType domain)
|
|
{
|
|
return (IdentityDocumentTypeDto)domain;
|
|
}
|
|
|
|
public static IdentityDocumentType ToDomain(this IdentityDocumentTypeDto dto)
|
|
{
|
|
return (IdentityDocumentType)dto;
|
|
}
|
|
|
|
public static IdentityDocumentSourceDto ToDto(this IdentityDocumentSource domain)
|
|
{
|
|
return (IdentityDocumentSourceDto)domain;
|
|
}
|
|
|
|
public static IdentityDocumentSource ToDomain(this IdentityDocumentSourceDto dto)
|
|
{
|
|
return (IdentityDocumentSource)dto;
|
|
}
|
|
|
|
public static IdentityDocumentStatusDto ToDto(this IdentityDocumentStatus domain)
|
|
{
|
|
return (IdentityDocumentStatusDto)domain;
|
|
}
|
|
|
|
public static IdentityDocumentStatus ToDomain(this IdentityDocumentStatusDto dto)
|
|
{
|
|
return (IdentityDocumentStatus)dto;
|
|
}
|
|
|
|
public static PaymentTransactionStatusDto ToDto(this PaymentTransactionStatus domain)
|
|
{
|
|
return (PaymentTransactionStatusDto)domain;
|
|
}
|
|
|
|
public static PaymentTransactionStatus ToDomain(this PaymentTransactionStatusDto dto)
|
|
{
|
|
return (PaymentTransactionStatus)dto;
|
|
}
|
|
|
|
public static WalkComplaintTypeDto ToDto(this WalkComplaintType domain)
|
|
{
|
|
return (WalkComplaintTypeDto)domain;
|
|
}
|
|
|
|
public static WalkComplaintType ToDomain(this WalkComplaintTypeDto dto)
|
|
{
|
|
return (WalkComplaintType)dto;
|
|
}
|
|
|
|
public static WalkComplaintStatusDto ToDto(this WalkComplaintStatus domain)
|
|
{
|
|
return (WalkComplaintStatusDto)domain;
|
|
}
|
|
|
|
public static WalkComplaintStatus ToDomain(this WalkComplaintStatusDto dto)
|
|
{
|
|
return (WalkComplaintStatus)dto;
|
|
}
|
|
|
|
public static WalkComplaintSourceDto ToDto(this WalkComplaintSource domain)
|
|
{
|
|
return (WalkComplaintSourceDto)domain;
|
|
}
|
|
|
|
public static WalkComplaintSource ToDomain(this WalkComplaintSourceDto dto)
|
|
{
|
|
return (WalkComplaintSource)dto;
|
|
}
|
|
|
|
public static AppUserReportSectionDto ToDto(this AppUserReportSection domain)
|
|
{
|
|
return (AppUserReportSectionDto)domain;
|
|
}
|
|
|
|
public static AppUserReportSection ToDomain(this AppUserReportSectionDto dto)
|
|
{
|
|
return (AppUserReportSection)dto;
|
|
}
|
|
|
|
public static AppUserReportTypeDto ToDto(this AppUserReportType domain)
|
|
{
|
|
return (AppUserReportTypeDto)domain;
|
|
}
|
|
|
|
public static AppUserReportType ToDomain(this AppUserReportTypeDto dto)
|
|
{
|
|
return (AppUserReportType)dto;
|
|
}
|
|
|
|
public static AppUserReportBlockTypeDto ToDto(this AppUserReportBlockType domain)
|
|
{
|
|
return (AppUserReportBlockTypeDto)domain;
|
|
}
|
|
|
|
public static AppUserReportBlockType ToDomain(this AppUserReportBlockTypeDto dto)
|
|
{
|
|
return (AppUserReportBlockType)dto;
|
|
}
|
|
|
|
public static VoucherCampaignTypeDto ToDto(this VoucherCampaignType domain)
|
|
{
|
|
return (VoucherCampaignTypeDto)domain;
|
|
}
|
|
|
|
public static VoucherCampaignType ToDomain(this VoucherCampaignTypeDto dto)
|
|
{
|
|
return (VoucherCampaignType)dto;
|
|
}
|
|
|
|
public static VoucherValidationResultDto ToDto(this VoucherValidationResult domain)
|
|
{
|
|
return (VoucherValidationResultDto)domain;
|
|
}
|
|
|
|
public static VoucherValidationResult ToDomain(this VoucherValidationResultDto dto)
|
|
{
|
|
return (VoucherValidationResult)dto;
|
|
}
|
|
|
|
public static SubscriptionLength ToDomain(this SubscriptionLengthDto dto)
|
|
{
|
|
return (SubscriptionLength)dto;
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
public static DynamicSortOrderDto ToDto(this DynamicSortOrder domain)
|
|
{
|
|
var dto = new DynamicSortOrderDto
|
|
{
|
|
Property = domain.Property,
|
|
SortDirection = domain.SortDirection.ToDto()
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static List<DynamicSortOrderDto> ToDto(this List<DynamicSortOrder> dto)
|
|
{
|
|
return dto.Select(ToDto).ToList();
|
|
}
|
|
|
|
public static DynamicSortOrder ToDomain(this DynamicSortOrderDto dto)
|
|
{
|
|
var domain = new DynamicSortOrder()
|
|
{
|
|
Property = dto.Property,
|
|
SortDirection = dto.SortDirection.ToDomain()
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static ContactMinDto ToDto(this ContactMin domain)
|
|
{
|
|
var dto = new ContactMinDto
|
|
{
|
|
Email = domain.Email,
|
|
Mobile = domain.Mobile,
|
|
Phone = domain.Phone
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static ContactMin ToDomain(this ContactMinDto dto)
|
|
{
|
|
var domain = new ContactMin()
|
|
{
|
|
Email = dto.Email,
|
|
Mobile = dto.Mobile,
|
|
Phone = dto.Phone
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static AddressDto ToDto(this Address domain)
|
|
{
|
|
var dto = new AddressDto
|
|
{
|
|
AddressLine1 = domain.AddressLine1,
|
|
AddressLine2 = domain.AddressLine2,
|
|
Zip = domain.Zip,
|
|
City = domain.City,
|
|
State = domain.State,
|
|
CountryCode = domain.CountryCode
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static Address ToDomain(this AddressDto dto)
|
|
{
|
|
var domain = new Address()
|
|
{
|
|
AddressLine1 = dto.AddressLine1,
|
|
AddressLine2 = dto.AddressLine2,
|
|
Zip = dto.Zip,
|
|
City = dto.City,
|
|
State = dto.State,
|
|
CountryCode = dto.CountryCode
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static SocialMediaDto ToDto(this SocialMedia domain)
|
|
{
|
|
var dto = new SocialMediaDto
|
|
{
|
|
Blog = domain.Blog,
|
|
Facebook = domain.Facebook,
|
|
Instagram = domain.Instagram,
|
|
LinkedIn = domain.LinkedIn,
|
|
Pinterest = domain.Pinterest,
|
|
Reddit = domain.Reddit,
|
|
Show = domain.Show,
|
|
SnapChat = domain.SnapChat,
|
|
TikTok = domain.TikTok,
|
|
Twitter = domain.Twitter,
|
|
Vimeo = domain.Vimeo,
|
|
Xing = domain.Xing,
|
|
YouTube = domain.YouTube
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static SocialMedia ToDomain(this SocialMediaDto dto)
|
|
{
|
|
var domain = new SocialMedia()
|
|
{
|
|
Blog = dto.Blog,
|
|
Facebook = dto.Facebook,
|
|
Instagram = dto.Instagram,
|
|
LinkedIn = dto.LinkedIn,
|
|
Pinterest = dto.Pinterest,
|
|
Reddit = dto.Reddit,
|
|
Show = dto.Show,
|
|
SnapChat = dto.SnapChat,
|
|
TikTok = dto.TikTok,
|
|
Twitter = dto.Twitter,
|
|
Vimeo = dto.Vimeo,
|
|
Xing = dto.Xing,
|
|
YouTube = dto.YouTube
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static User ToDomain(this UserDto dto)
|
|
{
|
|
var domain = new User()
|
|
{
|
|
AccessToken = dto.AccessToken,
|
|
AccessTokenExpires = dto.AccessTokenExpires,
|
|
AppUserId = dto.AppUserId,
|
|
FirstName = dto.FirstName,
|
|
LastName = dto.LastName,
|
|
Id = dto.Id,
|
|
LastLoginDate = dto.LastLoginDate,
|
|
Photo = dto.Photo,
|
|
RefreshToken = dto.RefreshToken,
|
|
RefreshTokenExpires = dto.RefreshTokenExpires,
|
|
RegistrationDate = dto.RegistrationDate,
|
|
Roles = dto.Roles,
|
|
UserName = dto.UserName
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static TokenResponse ToDomain(this RefreshTokenResponseDto dto)
|
|
{
|
|
var domain = new TokenResponse()
|
|
{
|
|
AccessTokenExpires = dto.AccessTokenExpires,
|
|
AccessToken = dto.AccessToken,
|
|
RefreshToken = dto.RefreshToken,
|
|
RefreshTokenExpires = dto.RefreshTokenExpires
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static NewsCategory ToDomain(this NewsCategoryDto dto)
|
|
{
|
|
var domain = new NewsCategory()
|
|
{
|
|
Id = dto.Id,
|
|
Name = dto.Name,
|
|
Image = dto.Image,
|
|
Created = dto.Created,
|
|
Deleted = dto.Deleted,
|
|
Description = dto.Description,
|
|
ImageLanguage = dto.ImageLanguage,
|
|
Language = dto.Language,
|
|
OnlineStatus = dto.OnlineStatus.ToDomain(),
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Version = dto.Version
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<NewsCategory> ToDomain(this List<NewsCategoryDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static News ToDomain(this NewsDto dto)
|
|
{
|
|
var domain = new News()
|
|
{
|
|
Id = dto.Id,
|
|
Image = dto.Image,
|
|
Headline = dto.Headline,
|
|
Start = dto.Start,
|
|
Url = dto.Url
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<News> ToDomain(this List<NewsDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static RatingStatisticsDto ToDto(this RatingStatistics domain)
|
|
{
|
|
var dto = new RatingStatisticsDto
|
|
{
|
|
AverageRating = domain.AverageRating,
|
|
TotalPoints = domain.TotalPoints,
|
|
TotalRatings = domain.TotalRatings
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static RatingStatistics ToDomain(this RatingStatisticsDto dto)
|
|
{
|
|
var domain = new RatingStatistics()
|
|
{
|
|
AverageRating = dto.AverageRating,
|
|
TotalPoints = dto.TotalPoints,
|
|
TotalRatings = dto.TotalRatings
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static AppUserDto ToDto(this AppUser domain)
|
|
{
|
|
var dto = new AppUserDto
|
|
{
|
|
Id = domain.Id,
|
|
Created = domain.Created,
|
|
UpdatedAt = domain.UpdatedAt,
|
|
Deleted = domain.Deleted,
|
|
Lat = domain.Lat,
|
|
FirstName = domain.FirstName,
|
|
LastName = domain.LastName,
|
|
Photo = domain.Photo,
|
|
Version = domain.Version,
|
|
Address = domain.Address.ToDto(),
|
|
BirthDate = domain.BirthDate,
|
|
Contact = domain.Contact.ToDto(),
|
|
Lng = domain.Lng,
|
|
Locked = domain.Locked,
|
|
LockedUntil = domain.LockedUntil,
|
|
RatingStatistics = domain.RatingStatistics.ToDto(),
|
|
RatingStatisticsWalker = domain.RatingStatisticsWalker.ToDto(),
|
|
Sex = domain.Sex.ToDto(),
|
|
SocialMedia = domain.SocialMedia.ToDto(),
|
|
TermsAccepted = domain.TermsAccepted,
|
|
TermsAcceptedDate = domain.TermsAcceptedDate,
|
|
PrivacyAccepted = domain.PrivacyAccepted,
|
|
PrivacyAcceptedDate = domain.PrivacyAcceptedDate,
|
|
PaymentTermsAccepted = domain.PaymentTermsAccepted,
|
|
PaymentTermsAcceptedDate = domain.PaymentTermsAcceptedDate,
|
|
NationalityCode = domain.NationalityCode,
|
|
MainResidenceCode = domain.MainResidenceCode,
|
|
PaymentId = domain.PaymentId,
|
|
KycPassed = domain.KycPassed,
|
|
KycPassedDate = domain.KycPassedDate,
|
|
BankId = domain.BankId,
|
|
Verified = domain.Verified,
|
|
VerifiedDate = domain.VerifiedDate,
|
|
AutoPayout = domain.AutoPayout,
|
|
Title = domain.Title,
|
|
Type = domain.Type.ToDto()
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static AppUser ToDomain(this AppUserDto dto)
|
|
{
|
|
var domain = new AppUser()
|
|
{
|
|
Id = dto.Id,
|
|
Title = dto.Title,
|
|
TermsAcceptedDate = dto.TermsAcceptedDate,
|
|
RatingStatistics = dto.RatingStatistics.ToDomain(),
|
|
SocialMedia = dto.SocialMedia.ToDomain(),
|
|
TermsAccepted = dto.TermsAccepted,
|
|
Type = dto.Type.ToDomain(),
|
|
Address = dto.Address.ToDomain(),
|
|
BirthDate = dto.BirthDate,
|
|
Contact = dto.Contact.ToDomain(),
|
|
Created = dto.Created,
|
|
Deleted = dto.Deleted,
|
|
FirstName = dto.FirstName,
|
|
LastName = dto.LastName,
|
|
Photo = dto.Photo,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
RatingStatisticsWalker = dto.RatingStatisticsWalker.ToDomain(),
|
|
Lat = dto.Lat,
|
|
Lng = dto.Lng,
|
|
Locked = dto.Locked,
|
|
LockedUntil = dto.LockedUntil,
|
|
PrivacyAccepted = dto.PrivacyAccepted,
|
|
PrivacyAcceptedDate = dto.PrivacyAcceptedDate,
|
|
PaymentTermsAccepted = dto.PaymentTermsAccepted,
|
|
PaymentTermsAcceptedDate = dto.PaymentTermsAcceptedDate,
|
|
NationalityCode = dto.NationalityCode,
|
|
MainResidenceCode = dto.MainResidenceCode,
|
|
PaymentId = dto.PaymentId,
|
|
KycPassed = dto.KycPassed,
|
|
KycPassedDate = dto.KycPassedDate,
|
|
BankId = dto.BankId,
|
|
Verified = dto.Verified,
|
|
VerifiedDate = dto.VerifiedDate,
|
|
AutoPayout = dto.AutoPayout,
|
|
Sex = dto.Sex.ToDomain()
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static DogWalkerProfileDto ToDto(this DogWalkerProfile domain)
|
|
{
|
|
var dto = new DogWalkerProfileDto
|
|
{
|
|
Id = domain.Id,
|
|
Version = domain.Version,
|
|
UpdatedAt = domain.UpdatedAt,
|
|
Deleted = domain.Deleted,
|
|
DifficultAllowed = domain.DifficultAllowed,
|
|
About = domain.About,
|
|
AcceptedSize = domain.AcceptedSize.ToDto(),
|
|
AggressionLevel = domain.AggressionLevel.ToDto(),
|
|
AllowedRequests = domain.AllowedRequests.ToDto(),
|
|
NotAvailable = domain.NotAvailable,
|
|
NotAvailableInfo = domain.NotAvailableInfo,
|
|
PriceDay = domain.PriceDay,
|
|
PriceSitting = domain.PriceSitting,
|
|
PriceWalk = domain.PriceWalk,
|
|
PuppyAllowed = domain.PuppyAllowed,
|
|
Radius = domain.Radius,
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static DogWalkerProfile ToDomain(this DogWalkerProfileDto dto)
|
|
{
|
|
var domain = new DogWalkerProfile()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
DifficultAllowed = dto.DifficultAllowed,
|
|
About = dto.About,
|
|
AcceptedSize = dto.AcceptedSize.ToDomain(),
|
|
AggressionLevel = dto.AggressionLevel.ToDomain(),
|
|
AllowedRequests = dto.AllowedRequests.ToDomain(),
|
|
NotAvailable = dto.NotAvailable,
|
|
NotAvailableInfo = dto.NotAvailableInfo,
|
|
PriceDay = dto.PriceDay,
|
|
PriceSitting = dto.PriceSitting,
|
|
PriceWalk = dto.PriceWalk,
|
|
PuppyAllowed = dto.PuppyAllowed,
|
|
Radius = dto.Radius
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static AppUserLookup ToDomain(this AppUserLookupDto dto)
|
|
{
|
|
var domain = new AppUserLookup()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Distance = 0,
|
|
FirstName = dto.FirstName,
|
|
LastName = dto.LastName,
|
|
Lat = dto.Lat,
|
|
Lng = dto.Lng,
|
|
LocationHint = dto.LocationHint,
|
|
Photo = dto.Photo,
|
|
Type = dto.Type.ToDomain()
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<AppUserLookup> ToDomain(this List<AppUserLookupDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static Conversation ToDomain(this ConversationDto dto)
|
|
{
|
|
var domain = new Conversation()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Created = dto.Created,
|
|
ReceipientType = dto.ReceipientType.ToDomain(),
|
|
Recipient = dto.Recipient,
|
|
RecipientName = dto.RecipientName,
|
|
RecipientPhoto = dto.RecipientPhoto,
|
|
RecipientShort = dto.RecipientShort
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<Conversation> ToDomain(this List<ConversationDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static MessageDto ToDto(this Message domain)
|
|
{
|
|
var dto = new MessageDto
|
|
{
|
|
Id = domain.Id,
|
|
Version = domain.Version,
|
|
UpdatedAt = domain.UpdatedAt,
|
|
Deleted = domain.Deleted,
|
|
Content = domain.Content,
|
|
ConversationId = domain.ConversationId
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static Message ToDomain(this MessageDto dto)
|
|
{
|
|
var domain = new Message()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Content = dto.Content,
|
|
ConversationId = dto.ConversationId
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<Message> ToDomain(this List<MessageDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static DogWalkerLookup ToDomain(this DogWalkerLookupDto dto)
|
|
{
|
|
var domain = new DogWalkerLookup()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
FirstName = dto.FirstName,
|
|
Photo = dto.Photo,
|
|
About = dto.About,
|
|
AverageRating = dto.AverageRating,
|
|
TotalRatings = dto.TotalRatings,
|
|
LastName = dto.LastName,
|
|
Lat = dto.Lat,
|
|
Lng = dto.Lng,
|
|
City = dto.City,
|
|
NotAvailable = dto.NotAvailable,
|
|
PriceDay = dto.PriceDay,
|
|
PriceSitting = dto.PriceSitting,
|
|
PriceWalk = dto.PriceWalk,
|
|
Type = dto.Type.ToDomain(),
|
|
Verified = dto.Verified
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<DogWalkerLookup> ToDomain(this List<DogWalkerLookupDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static DogWalkerInfo ToDomain(this DogWalkerInfoDto dto)
|
|
{
|
|
var domain = new DogWalkerInfo()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
FirstName = dto.FirstName,
|
|
Photo = dto.Photo,
|
|
About = dto.About,
|
|
LastName = dto.LastName,
|
|
Lat = dto.Lat,
|
|
Lng = dto.Lng,
|
|
NotAvailable = dto.NotAvailable,
|
|
PriceDay = dto.PriceDay,
|
|
PriceSitting = dto.PriceSitting,
|
|
PriceWalk = dto.PriceWalk,
|
|
Type = dto.Type.ToDomain(),
|
|
Created = dto.Created,
|
|
RatingStatistics = dto.RatingStatistics.ToDomain(),
|
|
Title = dto.Title,
|
|
Sex = dto.Sex.ToDomain(),
|
|
BirthDate = dto.BirthDate,
|
|
Contact = dto.Contact.ToDomain(),
|
|
Address = dto.Address.ToDomain(),
|
|
RatingStatisticsWalker = dto.RatingStatisticsWalker.ToDomain(),
|
|
AcceptedSize = dto.AcceptedSize.ToDomain(),
|
|
AggressionLevel = dto.AggressionLevel.ToDomain(),
|
|
AllowedRequests = dto.AllowedRequests.ToDomain(),
|
|
Comment = dto.Comment,
|
|
DifficultAllowed = dto.DifficultAllowed,
|
|
NotAvailableInfo = dto.NotAvailableInfo,
|
|
Number = dto.Number,
|
|
PuppyAllowed = dto.PuppyAllowed,
|
|
Radius = dto.Radius,
|
|
Verified = dto.Verified,
|
|
VerifiedDate = dto.VerifiedDate,
|
|
Locked = dto.Locked,
|
|
Blocked = dto.Blocked
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<DogWalkerInfo> ToDomain(this List<DogWalkerInfoDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static DogOwnerInfo ToDomain(this DogOwnerInfoDto dto)
|
|
{
|
|
var domain = new DogOwnerInfo()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
FirstName = dto.FirstName,
|
|
Photo = dto.Photo,
|
|
LastName = dto.LastName,
|
|
Lat = dto.Lat,
|
|
Lng = dto.Lng,
|
|
Type = dto.Type.ToDomain(),
|
|
Created = dto.Created,
|
|
RatingStatistics = dto.RatingStatistics.ToDomain(),
|
|
Title = dto.Title,
|
|
Sex = dto.Sex.ToDomain(),
|
|
BirthDate = dto.BirthDate,
|
|
Contact = dto.Contact.ToDomain(),
|
|
Address = dto.Address.ToDomain(),
|
|
Comment = dto.Comment,
|
|
Number = dto.Number,
|
|
Blocked = dto.Blocked,
|
|
Locked = dto.Locked
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static Branch ToDomain(this BranchDto dto)
|
|
{
|
|
var domain = new Branch()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Created = dto.Created,
|
|
Title = dto.Title,
|
|
Comment = dto.Comment,
|
|
Image = dto.Image,
|
|
ImageLanguage = dto.ImageLanguage,
|
|
Description = dto.Description,
|
|
OnlineStatus = dto.OnlineStatus.ToDomain(),
|
|
ListingAllowed = dto.ListingAllowed,
|
|
Name = dto.Name,
|
|
Order = dto.Order
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static Listing ToDomain(this ListingDto dto)
|
|
{
|
|
var domain = new Listing()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Image = dto.Image,
|
|
Image2 = dto.Image2,
|
|
ImageLanguage = dto.ImageLanguage,
|
|
Image2Language = dto.Image2Language,
|
|
Description = dto.Description,
|
|
Name = dto.Name,
|
|
Url = dto.Url,
|
|
BranchId = dto.BranchId,
|
|
BranchName = dto.BranchName,
|
|
CustomerId = dto.CustomerId,
|
|
CustomerName = dto.CustomerName,
|
|
EndDate = dto.EndDate,
|
|
ListingAddress = dto.ListingAddress.ToDomain(),
|
|
ListingLat = dto.ListingLat,
|
|
ListingLng = dto.ListingLng,
|
|
ListingType = dto.ListingType.ToDomain(),
|
|
StartDate = dto.StartDate,
|
|
UrlLanguage = dto.UrlLanguage
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<Listing> ToDomain(this List<ListingDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static BranchWithListings ToDomain(this BranchWithListingsDto dto)
|
|
{
|
|
var domain = new BranchWithListings()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Image = dto.Image,
|
|
ImageLanguage = dto.ImageLanguage,
|
|
Description = dto.Description,
|
|
Name = dto.Name,
|
|
Created = dto.Created,
|
|
Title = dto.Title,
|
|
OnlineStatus = dto.OnlineStatus.ToDomain(),
|
|
Comment = dto.Comment,
|
|
Order = dto.Order,
|
|
ListingAllowed = dto.ListingAllowed,
|
|
Listings = dto.Listings.ToDomain()
|
|
};
|
|
|
|
return domain;
|
|
}
|
|
|
|
public static List<BranchWithListings> ToDomain(this List<BranchWithListingsDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static Banner ToDomain(this BannerDto dto)
|
|
{
|
|
var domain = new Banner()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Image = dto.Image,
|
|
Name = dto.Name,
|
|
Url = dto.Url,
|
|
EndDate = dto.EndDate,
|
|
StartDate = dto.StartDate,
|
|
BannerLocation = dto.BannerLocation.ToDomain(),
|
|
BannerSize = dto.BannerSize.ToDomain(),
|
|
Status = dto.Status.ToDomain()
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static Advertisement ToDomain(this AdvertisementDto dto)
|
|
{
|
|
var domain = new Advertisement()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Image = dto.Image,
|
|
Image2 = dto.Image2,
|
|
Name = dto.Name,
|
|
Url = dto.Url,
|
|
EndDate = dto.EndDate,
|
|
StartDate = dto.StartDate,
|
|
Description = dto.Description,
|
|
ImageLanguage = dto.ImageLanguage,
|
|
Image2Language = dto.Image2Language,
|
|
AdvertisementCategoryId = dto.AdvertisementCategoryId,
|
|
AdvertisementCategoryName = dto.AdvertisementCategoryName,
|
|
CustomerId = dto.CustomerId,
|
|
CustomerName = dto.CustomerName,
|
|
UrlLanguage = dto.UrlLanguage,
|
|
Discount = dto.Discount
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<Advertisement> ToDomain(this List<AdvertisementDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static AdvertisementCategory ToDomain(this AdvertisementCategoryDto dto)
|
|
{
|
|
var domain = new AdvertisementCategory()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Image = dto.Image,
|
|
Name = dto.Name,
|
|
Description = dto.Description,
|
|
ImageLanguage = dto.ImageLanguage,
|
|
Title = dto.Title
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<AdvertisementCategory> ToDomain(this List<AdvertisementCategoryDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static DogRace ToDomain(this DogRaceDto dto)
|
|
{
|
|
var domain = new DogRace()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Name = dto.Name,
|
|
Description = dto.Description,
|
|
Created = dto.Created,
|
|
Photo = dto.Photo,
|
|
Age = dto.Age,
|
|
Care = dto.Care,
|
|
Coexistence = dto.Coexistence,
|
|
Decision = dto.Decision,
|
|
Personality = dto.Personality,
|
|
SizeAndWeight = dto.SizeAndWeight
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<DogRace> ToDomain(this List<DogRaceDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static DogDto ToDto(this Dog domain)
|
|
{
|
|
var dto = new DogDto
|
|
{
|
|
Id = domain.Id,
|
|
Version = domain.Version,
|
|
UpdatedAt = domain.UpdatedAt,
|
|
Deleted = domain.Deleted,
|
|
AggressionLevel = domain.AggressionLevel.ToDto(),
|
|
Created = domain.Created,
|
|
Photo = domain.Photo,
|
|
Description = domain.Description,
|
|
BirthDate = domain.BirthDate,
|
|
Sex = domain.Sex.ToDto(),
|
|
RatingStatistics = domain.RatingStatistics.ToDto(),
|
|
AppUserId = domain.AppUserId,
|
|
Number = domain.Number,
|
|
Name = domain.Name,
|
|
BasicCommands = domain.BasicCommands,
|
|
Chiped = domain.Chiped,
|
|
DogRaceId = domain.DogRaceId,
|
|
Eating = domain.Eating,
|
|
FeedingIndividual = domain.FeedingIndividual,
|
|
FeedingTimes = domain.FeedingTimes.ToDto(),
|
|
HouseTrained = domain.HouseTrained,
|
|
Hunter = domain.Hunter,
|
|
Intolerances = domain.Intolerances,
|
|
IsAggressiv = domain.IsAggressiv,
|
|
IsCalm = domain.IsCalm,
|
|
IsGuard = domain.IsGuard,
|
|
IsLoneGunner = domain.IsLoneGunner,
|
|
IsPeeing = domain.IsPeeing,
|
|
IsShy = domain.IsShy,
|
|
IsTrustful = domain.IsTrustful,
|
|
Jumper = domain.Jumper,
|
|
LikesAdults = domain.LikesAdults,
|
|
LikesChildren = domain.LikesChildren,
|
|
LikesConspecifics = domain.LikesConspecifics,
|
|
MedicalInfo = domain.MedicalInfo,
|
|
PullsTheLeash = domain.PullsTheLeash,
|
|
RushesOutside = domain.RushesOutside,
|
|
Size = domain.Size.ToDto(),
|
|
Sterilized = domain.Sterilized,
|
|
WalksTheLeash = domain.WalksTheLeash,
|
|
Locked = domain.Locked,
|
|
Blocked = domain.Blocked
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static Dog ToDomain(this DogDto dto)
|
|
{
|
|
var domain = new Dog()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
AggressionLevel = dto.AggressionLevel.ToDomain(),
|
|
Created = dto.Created,
|
|
Photo = dto.Photo,
|
|
Description = dto.Description,
|
|
BirthDate = dto.BirthDate,
|
|
Sex = dto.Sex.ToDomain(),
|
|
RatingStatistics = dto.RatingStatistics.ToDomain(),
|
|
AppUserId = dto.AppUserId,
|
|
Number = dto.Number,
|
|
Name = dto.Name,
|
|
BasicCommands = dto.BasicCommands,
|
|
Chiped = dto.Chiped,
|
|
DogRaceId = dto.DogRaceId,
|
|
Eating = dto.Eating,
|
|
FeedingIndividual = dto.FeedingIndividual,
|
|
FeedingTimes = dto.FeedingTimes.ToDomain(),
|
|
HouseTrained = dto.HouseTrained,
|
|
Hunter = dto.Hunter,
|
|
Intolerances = dto.Intolerances,
|
|
IsAggressiv = dto.IsAggressiv,
|
|
IsCalm = dto.IsCalm,
|
|
IsGuard = dto.IsGuard,
|
|
IsLoneGunner = dto.IsLoneGunner,
|
|
IsPeeing = dto.IsPeeing,
|
|
IsShy = dto.IsShy,
|
|
IsTrustful = dto.IsTrustful,
|
|
Jumper = dto.Jumper,
|
|
LikesAdults = dto.LikesAdults,
|
|
LikesChildren = dto.LikesChildren,
|
|
LikesConspecifics = dto.LikesConspecifics,
|
|
MedicalInfo = dto.MedicalInfo,
|
|
PullsTheLeash = dto.PullsTheLeash,
|
|
RushesOutside = dto.RushesOutside,
|
|
Size = dto.Size.ToDomain(),
|
|
Sterilized = dto.Sterilized,
|
|
WalksTheLeash = dto.WalksTheLeash,
|
|
Locked = dto.Locked,
|
|
Blocked = dto.Blocked
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<Dog> ToDomain(this List<DogDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static DogMinInfo ToDomain(this DogMinInfoDto dto)
|
|
{
|
|
var domain = new DogMinInfo()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Photo = dto.Photo,
|
|
BirthDate = dto.BirthDate,
|
|
Sex = dto.Sex.ToDomain(),
|
|
Name = dto.Name,
|
|
DogRaceId = dto.DogRaceId,
|
|
Size = dto.Size.ToDomain(),
|
|
DogRaceName = dto.DogRaceName,
|
|
AverageRating = dto.AverageRating,
|
|
TotalRatings = dto.TotalRatings,
|
|
Locked = dto.Locked,
|
|
Blocked = dto.Blocked
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<DogMinInfo> ToDomain(this List<DogMinInfoDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static PublicWalkRequestDto ToDto(this PublicWalkRequest domain)
|
|
{
|
|
var dto = new PublicWalkRequestDto
|
|
{
|
|
Id = domain.Id,
|
|
Version = domain.Version,
|
|
UpdatedAt = domain.UpdatedAt,
|
|
Deleted = domain.Deleted,
|
|
Created = domain.Created,
|
|
Lat = domain.Lat,
|
|
Lng = domain.Lng,
|
|
PickupAddress = domain.PickupAddress.ToDto(),
|
|
EndDate = domain.EndDate,
|
|
StartDate = domain.StartDate,
|
|
Status = domain.Status.ToDto(),
|
|
DogCount = domain.DogCount,
|
|
DogId = domain.DogId,
|
|
DogOwnerId = domain.DogOwnerId,
|
|
DogWalkerId = domain.DogWalkerId,
|
|
DogsJson = domain.DogsJson,
|
|
Exclusive = domain.Exclusive,
|
|
ExpirationDate = domain.ExpirationDate,
|
|
Info = domain.Info,
|
|
PlacedDate = domain.PlacedDate,
|
|
Price = domain.Price,
|
|
PublicWalkResponseId = domain.PublicWalkResponseId,
|
|
RequestType = domain.RequestType.ToDto(),
|
|
ResponseCount = domain.ResponseCount
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static PublicWalkRequest ToDomain(this PublicWalkRequestDto dto)
|
|
{
|
|
var domain = new PublicWalkRequest()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Created = dto.Created,
|
|
Lat = dto.Lat,
|
|
Lng = dto.Lng,
|
|
PickupAddress = dto.PickupAddress.ToDomain(),
|
|
EndDate = dto.EndDate,
|
|
StartDate = dto.StartDate,
|
|
Status = dto.Status.ToDomain(),
|
|
DogCount = dto.DogCount,
|
|
DogId = dto.DogId,
|
|
DogOwnerId = dto.DogOwnerId,
|
|
DogWalkerId = dto.DogWalkerId,
|
|
DogsJson = dto.DogsJson,
|
|
Exclusive = dto.Exclusive,
|
|
ExpirationDate = dto.ExpirationDate,
|
|
Info = dto.Info,
|
|
PlacedDate = dto.PlacedDate,
|
|
Price = dto.Price,
|
|
PublicWalkResponseId = dto.PublicWalkResponseId,
|
|
RequestType = dto.RequestType.ToDomain(),
|
|
ResponseCount = dto.ResponseCount
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<PublicWalkRequest> ToDomain(this List<PublicWalkRequestDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static PublicWalkRequestCreateDto ToCreateDto(this PublicWalkRequest domain)
|
|
{
|
|
var dto = new PublicWalkRequestCreateDto
|
|
{
|
|
Id = domain.Id,
|
|
Version = domain.Version,
|
|
UpdatedAt = domain.UpdatedAt,
|
|
Deleted = domain.Deleted,
|
|
Created = domain.Created,
|
|
Lat = domain.Lat,
|
|
Lng = domain.Lng,
|
|
PickupAddress = domain.PickupAddress.ToDto(),
|
|
EndDate = domain.EndDate,
|
|
StartDate = domain.StartDate,
|
|
DogCount = domain.DogCount,
|
|
DogId = domain.DogId,
|
|
DogOwnerId = domain.DogOwnerId,
|
|
DogsJson = domain.DogsJson,
|
|
Exclusive = domain.Exclusive,
|
|
ExpirationDate = domain.ExpirationDate,
|
|
Info = domain.Info,
|
|
Price = domain.Price,
|
|
RequestType = domain.RequestType.ToDto()
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static PublicWalkRequestWithNames ToDomain(this PublicWalkRequestWithNamesDto dto)
|
|
{
|
|
var domain = new PublicWalkRequestWithNames()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Created = dto.Created,
|
|
Lat = dto.Lat,
|
|
Lng = dto.Lng,
|
|
EndDate = dto.EndDate,
|
|
StartDate = dto.StartDate,
|
|
Status = dto.Status.ToDomain(),
|
|
DogCount = dto.DogCount,
|
|
DogId = dto.DogId,
|
|
DogOwnerId = dto.DogOwnerId,
|
|
DogWalkerId = dto.DogWalkerId,
|
|
Exclusive = dto.Exclusive,
|
|
ExpirationDate = dto.ExpirationDate,
|
|
Info = dto.Info,
|
|
PlacedDate = dto.PlacedDate,
|
|
Price = dto.Price,
|
|
PublicWalkResponseId = dto.PublicWalkResponseId,
|
|
RequestType = dto.RequestType.ToDomain(),
|
|
ResponseCount = dto.ResponseCount,
|
|
DogName = dto.DogName,
|
|
DogOwnerName = dto.DogOwnerName,
|
|
DogOwnerPhoto = dto.DogOwnerPhoto,
|
|
DogPhoto = dto.DogPhoto,
|
|
Dogs = dto.Dogs.ToDomain(),
|
|
PickupAddress_AddressLine1 = dto.PickupAddress_AddressLine1,
|
|
PickupAddress_AddressLine2 = dto.PickupAddress_AddressLine2,
|
|
PickupAddress_City = dto.PickupAddress_City,
|
|
PickupAddress_Zip = dto.PickupAddress_Zip,
|
|
PickupAddress_State = dto.PickupAddress_State,
|
|
PickupAddress_CountryCode = dto.PickupAddress_CountryCode,
|
|
Locked = dto.Locked,
|
|
Blocked = dto.Blocked
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<PublicWalkRequestWithNames> ToDomain(this List<PublicWalkRequestWithNamesDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static PublicWalkRequestWithNamesAndResponseStatus ToDomain(this PublicWalkRequestWithNamesAndResponseStatusDto dto)
|
|
{
|
|
var domain = new PublicWalkRequestWithNamesAndResponseStatus()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Created = dto.Created,
|
|
Lat = dto.Lat,
|
|
Lng = dto.Lng,
|
|
EndDate = dto.EndDate,
|
|
StartDate = dto.StartDate,
|
|
Status = dto.Status.ToDomain(),
|
|
DogCount = dto.DogCount,
|
|
DogId = dto.DogId,
|
|
DogOwnerId = dto.DogOwnerId,
|
|
DogWalkerId = dto.DogWalkerId,
|
|
DogOwnerBlocked = dto.DogOwnerBlocked,
|
|
DogOwnerLocked = dto.DogOwnerLocked,
|
|
Exclusive = dto.Exclusive,
|
|
ExpirationDate = dto.ExpirationDate,
|
|
Info = dto.Info,
|
|
PlacedDate = dto.PlacedDate,
|
|
Price = dto.Price,
|
|
PublicWalkResponseId = dto.PublicWalkResponseId,
|
|
RequestType = dto.RequestType.ToDomain(),
|
|
ResponseCount = dto.ResponseCount,
|
|
DogName = dto.DogName,
|
|
DogOwnerName = dto.DogOwnerName,
|
|
DogOwnerPhoto = dto.DogOwnerPhoto,
|
|
DogPhoto = dto.DogPhoto,
|
|
Dogs = dto.Dogs.ToDomain(),
|
|
PickupAddress_AddressLine1 = dto.PickupAddress_AddressLine1,
|
|
PickupAddress_AddressLine2 = dto.PickupAddress_AddressLine2,
|
|
PickupAddress_City = dto.PickupAddress_City,
|
|
PickupAddress_Zip = dto.PickupAddress_Zip,
|
|
PickupAddress_State = dto.PickupAddress_State,
|
|
PickupAddress_CountryCode = dto.PickupAddress_CountryCode,
|
|
ResponseStatus = dto.ResponseStatus?.ToDomain()
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<PublicWalkRequestWithNamesAndResponseStatus> ToDomain(this List<PublicWalkRequestWithNamesAndResponseStatusDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static PublicWalkResponseDto ToDto(this PublicWalkResponse domain)
|
|
{
|
|
var dto = new PublicWalkResponseDto
|
|
{
|
|
Id = domain.Id,
|
|
Version = domain.Version,
|
|
UpdatedAt = domain.UpdatedAt,
|
|
Deleted = domain.Deleted,
|
|
Created = domain.Created,
|
|
Status = domain.Status.ToDto(),
|
|
DogWalkerId = domain.DogWalkerId,
|
|
Info = domain.Info,
|
|
Price = domain.Price,
|
|
Answer = domain.Answer,
|
|
CancellationReason = domain.CancellationReason,
|
|
PublicWalkRequestId = domain.PublicWalkRequestId
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static PublicWalkResponse ToDomain(this PublicWalkResponseDto dto)
|
|
{
|
|
var domain = new PublicWalkResponse()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Created = dto.Created,
|
|
Status = dto.Status.ToDomain(),
|
|
DogWalkerId = dto.DogWalkerId,
|
|
Info = dto.Info,
|
|
Price = dto.Price,
|
|
CancellationReason = dto.CancellationReason,
|
|
PublicWalkRequestId = dto.PublicWalkRequestId,
|
|
Answer = dto.Answer
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<PublicWalkResponse> ToDomain(this List<PublicWalkResponseDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static PublicWalkResponseWithNames ToDomain(this PublicWalkResponseWithNamesDto dto)
|
|
{
|
|
var domain = new PublicWalkResponseWithNames()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Created = dto.Created,
|
|
Status = dto.Status.ToDomain(),
|
|
DogWalkerId = dto.DogWalkerId,
|
|
Info = dto.Info,
|
|
Price = dto.Price,
|
|
CancellationReason = dto.CancellationReason,
|
|
PublicWalkRequestId = dto.PublicWalkRequestId,
|
|
Answer = dto.Answer,
|
|
DogWalkerName = dto.DogWalkerName,
|
|
DogWalkerPhoto = dto.DogWalkerPhoto,
|
|
DogWalkerVerified = dto.DogWalkerVerified,
|
|
DogWalkerBlocked = dto.DogWalkerBlocked,
|
|
DogWalkerLocked = dto.DogWalkerLocked
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<PublicWalkResponseWithNames> ToDomain(this List<PublicWalkResponseWithNamesDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static WalkDto ToDto(this Walk domain)
|
|
{
|
|
var dto = new WalkDto
|
|
{
|
|
Id = domain.Id,
|
|
Version = domain.Version,
|
|
UpdatedAt = domain.UpdatedAt,
|
|
Deleted = domain.Deleted,
|
|
Created = domain.Created,
|
|
PickupAddress = domain.PickupAddress.ToDto(),
|
|
Status = domain.Status.ToDto(),
|
|
DogCount = domain.DogCount,
|
|
DogOwnerId = domain.DogOwnerId,
|
|
DogWalkerId = domain.DogWalkerId,
|
|
DogsJson = domain.DogsJson,
|
|
Info = domain.Info,
|
|
Price = domain.Price,
|
|
PublicWalkRequestId = domain.PublicWalkRequestId,
|
|
CancelledBy = domain.CancelledBy.ToDto(),
|
|
CancelledReason = domain.CancelledReason,
|
|
Completed = domain.Completed,
|
|
CompletedInfo = domain.CompletedInfo,
|
|
Confirmed = domain.Confirmed,
|
|
Complained = domain.Complained,
|
|
ComplainReason = domain.ComplainReason,
|
|
DeclinedReason = domain.DeclinedReason,
|
|
Defactation = domain.Defactation,
|
|
End = domain.End,
|
|
PaymentStatus = domain.PaymentStatus.ToDto(),
|
|
PickupAddressLat = domain.PickupAddressLat,
|
|
PickupAddressLng = domain.PickupAddressLng,
|
|
ReturnAddress = domain.ReturnAddress.ToDto(),
|
|
ReturnAddressLat = domain.ReturnAddressLat,
|
|
ReturnAddressLng = domain.ReturnAddressLng,
|
|
ServiceType = domain.ServiceType.ToDto(),
|
|
Start = domain.Start,
|
|
Started = domain.Started,
|
|
Type = domain.Type.ToDto()
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static Walk ToDomain(this WalkDto dto)
|
|
{
|
|
var domain = new Walk()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Created = dto.Created,
|
|
PickupAddress = dto.PickupAddress.ToDomain(),
|
|
Status = dto.Status.ToDomain(),
|
|
DogCount = dto.DogCount,
|
|
DogOwnerId = dto.DogOwnerId,
|
|
DogWalkerId = dto.DogWalkerId,
|
|
DogsJson = dto.DogsJson,
|
|
Info = dto.Info,
|
|
Price = dto.Price,
|
|
PublicWalkRequestId = dto.PublicWalkRequestId,
|
|
CancelledBy = dto.CancelledBy.ToDomain(),
|
|
CancelledReason = dto.CancelledReason,
|
|
Completed = dto.Completed,
|
|
CompletedInfo = dto.CompletedInfo,
|
|
Confirmed = dto.Confirmed,
|
|
Complained = dto.Complained,
|
|
ComplainReason = dto.ComplainReason,
|
|
DeclinedReason = dto.DeclinedReason,
|
|
Defactation = dto.Defactation,
|
|
End = dto.End,
|
|
PaymentStatus = dto.PaymentStatus.ToDomain(),
|
|
PickupAddressLat = dto.PickupAddressLat,
|
|
PickupAddressLng = dto.PickupAddressLng,
|
|
ReturnAddress = dto.ReturnAddress.ToDomain(),
|
|
ReturnAddressLat = dto.ReturnAddressLat,
|
|
ReturnAddressLng = dto.ReturnAddressLng,
|
|
ServiceType = dto.ServiceType.ToDomain(),
|
|
Start = dto.Start,
|
|
Started = dto.Started,
|
|
Type = dto.Type.ToDomain()
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<Walk> ToDomain(this List<WalkDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static WalkWithNames ToDomain(this WalkWithNamesDto dto)
|
|
{
|
|
var domain = new WalkWithNames()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Created = dto.Created,
|
|
PickupAddress = dto.PickupAddress.ToDomain(),
|
|
Status = dto.Status.ToDomain(),
|
|
DogCount = dto.DogCount,
|
|
DogOwnerId = dto.DogOwnerId,
|
|
DogWalkerId = dto.DogWalkerId,
|
|
DogWalkerLocked = dto.DogWalkerLocked,
|
|
DogWalkerBlocked = dto.DogWalkerBlocked,
|
|
Info = dto.Info,
|
|
Price = dto.Price,
|
|
PublicWalkRequestId = dto.PublicWalkRequestId,
|
|
CancelledBy = dto.CancelledBy.ToDomain(),
|
|
CancelledReason = dto.CancelledReason,
|
|
Completed = dto.Completed,
|
|
CompletedInfo = dto.CompletedInfo,
|
|
Confirmed = dto.Confirmed,
|
|
Complained = dto.Complained,
|
|
ComplainReason = dto.ComplainReason,
|
|
DeclinedReason = dto.DeclinedReason,
|
|
Defactation = dto.Defactation,
|
|
End = dto.End,
|
|
PaymentStatus = dto.PaymentStatus.ToDomain(),
|
|
VoucherId = dto.VoucherId,
|
|
VoucherAmmount = dto.VoucherAmmount,
|
|
PickupAddressLat = dto.PickupAddressLat,
|
|
PickupAddressLng = dto.PickupAddressLng,
|
|
ReturnAddress = dto.ReturnAddress.ToDomain(),
|
|
ReturnAddressLat = dto.ReturnAddressLat,
|
|
ReturnAddressLng = dto.ReturnAddressLng,
|
|
ServiceType = dto.ServiceType.ToDomain(),
|
|
Start = dto.Start,
|
|
Started = dto.Started,
|
|
Type = dto.Type.ToDomain(),
|
|
DogOwnerName = dto.DogOwnerName,
|
|
Dogs = dto.Dogs.ToDomain(),
|
|
DogOwnerPhoto = dto.DogOwnerPhoto,
|
|
DogWalkerName = dto.DogWalkerName,
|
|
DogWalkerPhoto = dto.DogWalkerPhoto,
|
|
DogOwnerLocked = dto.DogOwnerLocked,
|
|
DogOwnerBlocked = dto.DogOwnerBlocked,
|
|
Locked = dto.Locked,
|
|
Blocked = dto.Blocked
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<WalkWithNames> ToDomain(this List<WalkWithNamesDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static WalkingTimeDto ToDto(this WalkingTime domain)
|
|
{
|
|
var dto = new WalkingTimeDto
|
|
{
|
|
Id = domain.Id,
|
|
Version = domain.Version,
|
|
UpdatedAt = domain.UpdatedAt,
|
|
Deleted = domain.Deleted,
|
|
DogWalkerId = domain.DogWalkerId,
|
|
End = domain.End,
|
|
Start = domain.Start,
|
|
Day = domain.Day,
|
|
Enabled = domain.Enabled
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static WalkingTime ToDomain(this WalkingTimeDto dto)
|
|
{
|
|
var domain = new WalkingTime()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
DogWalkerId = dto.DogWalkerId,
|
|
End = dto.End,
|
|
Start = dto.Start,
|
|
Day = dto.Day,
|
|
Enabled = dto.Enabled
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<WalkingTime> ToDomain(this List<WalkingTimeDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static RatingDto ToDto(this Rating domain)
|
|
{
|
|
var dto = new RatingDto
|
|
{
|
|
Id = domain.Id,
|
|
Version = domain.Version,
|
|
UpdatedAt = domain.UpdatedAt,
|
|
Deleted = domain.Deleted,
|
|
Created = domain.Created,
|
|
Info = domain.Info,
|
|
FromId = domain.FromId,
|
|
FromType = domain.FromType.ToDto(),
|
|
Points = domain.Points,
|
|
TargetId = domain.TargetId,
|
|
TargetType = domain.TargetType.ToDto(),
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static Rating ToDomain(this RatingDto dto)
|
|
{
|
|
var domain = new Rating()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Created = dto.Created,
|
|
Info = dto.Info,
|
|
FromId = dto.FromId,
|
|
FromType = dto.FromType.ToDomain(),
|
|
Points = dto.Points,
|
|
TargetId = dto.TargetId,
|
|
TargetType = dto.TargetType.ToDomain()
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<Rating> ToDomain(this List<RatingDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static RatingWithNames ToDomain(this RatingWithNamesDto dto)
|
|
{
|
|
var domain = new RatingWithNames
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Created = dto.Created,
|
|
Info = dto.Info,
|
|
FromId = dto.FromId,
|
|
FromType = dto.FromType.ToDomain(),
|
|
Points = dto.Points,
|
|
TargetId = dto.TargetId,
|
|
TargetType = dto.TargetType.ToDomain(),
|
|
FromName = dto.FromName,
|
|
FromPhoto = dto.FromPhoto,
|
|
TargetName = dto.TargetName,
|
|
TargetPhoto = dto.TargetPhoto,
|
|
FromBlocked = dto.FromBlocked,
|
|
FromLocked = dto.FromLocked
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<RatingWithNames> ToDomain(this List<RatingWithNamesDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static AppFeedbackDto ToDto(this AppFeedback domain)
|
|
{
|
|
var dto = new AppFeedbackDto
|
|
{
|
|
Id = domain.Id,
|
|
AppUserId = domain.AppUserId,
|
|
UserName = domain.UserName,
|
|
Name = domain.Name,
|
|
FeedbackType = domain.FeedbackType.ToDto(),
|
|
Status = domain.Status.ToDto(),
|
|
Message = domain.Message,
|
|
AppMode = domain.AppMode.ToDto(),
|
|
Language = domain.Language,
|
|
Country = domain.Country,
|
|
AppVersion = domain.AppVersion,
|
|
DeviceInfoAllowed = domain.DeviceInfoAllowed,
|
|
DeviceIdiom = domain.DeviceIdiom,
|
|
DeviceManufacturer = domain.DeviceManufacturer,
|
|
DeviceModel = domain.DeviceModel,
|
|
DevicePlatform = domain.DevicePlatform,
|
|
DeviceType = domain.DeviceType,
|
|
DeviceVersion = domain.DeviceVersion,
|
|
Created = domain.Created
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static AppFeedbackCreateDto ToCreateDto(this AppFeedback domain)
|
|
{
|
|
var dto = new AppFeedbackCreateDto()
|
|
{
|
|
AppUserId = domain.AppUserId,
|
|
FeedbackType = domain.FeedbackType.ToDto(),
|
|
Message = domain.Message,
|
|
AppMode = domain.AppMode.ToDto(),
|
|
Language = domain.Language,
|
|
Country = domain.Country,
|
|
AppVersion = domain.AppVersion,
|
|
DeviceInfoAllowed = domain.DeviceInfoAllowed,
|
|
DeviceIdiom = domain.DeviceIdiom,
|
|
DeviceManufacturer = domain.DeviceManufacturer,
|
|
DeviceModel = domain.DeviceModel,
|
|
DevicePlatform = domain.DevicePlatform,
|
|
DeviceType = domain.DeviceType,
|
|
DeviceVersion = domain.DeviceVersion
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static AppFeedback ToDomain(this AppFeedbackDto dto)
|
|
{
|
|
var domain = new AppFeedback()
|
|
{
|
|
Id = dto.Id,
|
|
AppUserId = dto.AppUserId,
|
|
UserName = dto.UserName,
|
|
Name = dto.Name,
|
|
FeedbackType = dto.FeedbackType.ToDomain(),
|
|
Status = dto.Status.ToDomain(),
|
|
Message = dto.Message,
|
|
AppMode = dto.AppMode.ToDomain(),
|
|
Language = dto.Language,
|
|
Country = dto.Country,
|
|
AppVersion = dto.AppVersion,
|
|
DeviceInfoAllowed = dto.DeviceInfoAllowed,
|
|
DeviceIdiom = dto.DeviceIdiom,
|
|
DeviceManufacturer = dto.DeviceManufacturer,
|
|
DeviceModel = dto.DeviceModel,
|
|
DevicePlatform = dto.DevicePlatform,
|
|
DeviceType = dto.DeviceType,
|
|
DeviceVersion = dto.DeviceVersion,
|
|
Created = dto.Created
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static FavouriteDto ToDto(this Favourite domain)
|
|
{
|
|
var dto = new FavouriteDto
|
|
{
|
|
Id = domain.Id,
|
|
AppUserId = domain.AppUserId,
|
|
Created = domain.Created,
|
|
Version = domain.Version,
|
|
UpdatedAt = domain.UpdatedAt,
|
|
Deleted = domain.Deleted,
|
|
Key = domain.Key,
|
|
Table = domain.Table
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static List<Favourite> ToDomain(this List<FavouriteDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static Favourite ToDomain(this FavouriteDto dto)
|
|
{
|
|
var domain = new Favourite()
|
|
{
|
|
Id = dto.Id,
|
|
AppUserId = dto.AppUserId,
|
|
Created = dto.Created,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Key = dto.Key,
|
|
Table = dto.Table
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static FavouriteListItem ToDomain(this FavouriteListItemDto dto)
|
|
{
|
|
var domain = new FavouriteListItem()
|
|
{
|
|
Id = dto.Id,
|
|
AppUserId = dto.AppUserId,
|
|
Created = dto.Created,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Key = dto.Key,
|
|
Table = dto.Table,
|
|
Advertisement = dto.Advertisement?.ToDomain(),
|
|
Listing = dto.Listing?.ToDomain(),
|
|
Dog = dto.Dog?.ToDomain(),
|
|
DogWalker = dto.DogWalker?.ToDomain(),
|
|
NotAvailable = dto.NotAvailable,
|
|
Locked = dto.Locked,
|
|
Blocked = dto.Blocked
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<FavouriteListItem> ToDomain(this List<FavouriteListItemDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static SystemMessageDto ToDto(this SystemMessage domain)
|
|
{
|
|
var dto = new SystemMessageDto
|
|
{
|
|
Id = domain.Id,
|
|
AppUserId = domain.AppUserId,
|
|
AppUserType = domain.AppUserType.ToDto(),
|
|
Created = domain.Created,
|
|
Version = domain.Version,
|
|
UpdatedAt = domain.UpdatedAt,
|
|
Deleted = domain.Deleted,
|
|
Key = domain.Key,
|
|
Table = domain.Table,
|
|
Type = domain.Type.ToDto(),
|
|
Message = domain.Message,
|
|
Expires = domain.Expires,
|
|
Read = domain.Read,
|
|
ReadDate = domain.ReadDate
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static SystemMessage ToDomain(this SystemMessageDto dto)
|
|
{
|
|
var domain = new SystemMessage()
|
|
{
|
|
Id = dto.Id,
|
|
AppUserId = dto.AppUserId,
|
|
AppUserType = dto.AppUserType.ToDomain(),
|
|
Created = dto.Created,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
Key = dto.Key,
|
|
Table = dto.Table,
|
|
Type = dto.Type.ToDomain(),
|
|
Message = dto.Message,
|
|
Expires = dto.Expires,
|
|
Read = dto.Read,
|
|
ReadDate = dto.ReadDate
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<SystemMessage> ToDomain(this List<SystemMessageDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static DeviceInstallationDto ToDto(this DeviceInstallation domain)
|
|
{
|
|
var dto = new DeviceInstallationDto
|
|
{
|
|
InstallationId = domain.InstallationId,
|
|
Platform = domain.Platform.ToDto(),
|
|
NotificationPlatform = domain.NotificationPlatform.ToDto(),
|
|
Channel = domain.Channel,
|
|
Language = domain.Language
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static DeviceInstallation ToDomain(this DeviceInstallationDto dto)
|
|
{
|
|
var domain = new DeviceInstallation()
|
|
{
|
|
InstallationId = dto.InstallationId,
|
|
Platform = dto.Platform.ToDomain(),
|
|
NotificationPlatform = dto.NotificationPlatform.ToDomain(),
|
|
Channel = dto.Channel,
|
|
Language = dto.Language
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static WalletDto ToDto(this Wallet domain)
|
|
{
|
|
var dto = new WalletDto
|
|
{
|
|
Id = domain.Id,
|
|
Version = domain.Version,
|
|
UpdatedAt = domain.UpdatedAt,
|
|
Deleted = domain.Deleted,
|
|
AppUserId = domain.AppUserId,
|
|
WalletId = domain.WalletId,
|
|
Type = domain.Type.ToDto(),
|
|
OwnerId = domain.OwnerId,
|
|
Currency = domain.Currency,
|
|
Balance = domain.Balance,
|
|
Description = domain.Description
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static Wallet ToDomain(this WalletDto dto)
|
|
{
|
|
var domain = new Wallet()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
AppUserId = dto.AppUserId,
|
|
WalletId = dto.WalletId,
|
|
Type = dto.Type.ToDomain(),
|
|
OwnerId = dto.OwnerId,
|
|
Currency = dto.Currency,
|
|
Balance = dto.Balance,
|
|
Description = dto.Description
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<Wallet> ToDomain(this List<WalletDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static TransactionFeeDto ToDto(this TransactionFee domain)
|
|
{
|
|
var dto = new TransactionFeeDto
|
|
{
|
|
Id = domain.Id,
|
|
Version = domain.Version,
|
|
UpdatedAt = domain.UpdatedAt,
|
|
Deleted = domain.Deleted,
|
|
PayInType = domain.PayInType.ToDto(),
|
|
Percent = domain.Percent,
|
|
Fixed = domain.Fixed
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static TransactionFee ToDomain(this TransactionFeeDto dto)
|
|
{
|
|
var domain = new TransactionFee()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
PayInType = dto.PayInType.ToDomain(),
|
|
Percent = dto.Percent,
|
|
Fixed = dto.Fixed
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<TransactionFee> ToDomain(this List<TransactionFeeDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static BankAccountDto ToDto(this BankAccount domain)
|
|
{
|
|
var dto = new BankAccountDto
|
|
{
|
|
AppUserId = domain.AppUserId,
|
|
PaymentId = domain.PaymentId,
|
|
BankId = domain.BankId,
|
|
OwnerName = domain.OwnerName,
|
|
Address = domain.Address.ToDto(),
|
|
Iban = domain.Iban,
|
|
Bic = domain.Bic
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static BankAccount ToDomain(this BankAccountDto dto)
|
|
{
|
|
var domain = new BankAccount()
|
|
{
|
|
AppUserId = dto.AppUserId,
|
|
PaymentId = dto.PaymentId,
|
|
BankId = dto.BankId,
|
|
OwnerName = dto.OwnerName,
|
|
Address = dto.Address.ToDomain(),
|
|
Iban = dto.Iban,
|
|
Bic = dto.Bic
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static IdentityDocumentDto ToDto(this IdentityDocument domain)
|
|
{
|
|
var dto = new IdentityDocumentDto
|
|
{
|
|
Id = domain.Id,
|
|
Version = domain.Version,
|
|
UpdatedAt = domain.UpdatedAt,
|
|
Deleted = domain.Deleted,
|
|
AppUserId = domain.AppUserId,
|
|
MangoPayId = domain.MangoPayId,
|
|
MangoPayUserId = domain.MangoPayUserId,
|
|
Type = domain.Type.ToDto(),
|
|
Source = domain.Source.ToDto(),
|
|
Status = domain.Status.ToDto(),
|
|
PageCount = domain.PageCount,
|
|
Processed = domain.Processed,
|
|
RefusedReasonType = domain.RefusedReasonType,
|
|
RefusedReasonMessage = domain.RefusedReasonMessage,
|
|
FlagsValue = domain.FlagsValue,
|
|
Created = domain.Created
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static IdentityDocument ToDomain(this IdentityDocumentDto dto)
|
|
{
|
|
var domain = new IdentityDocument()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
AppUserId = dto.AppUserId,
|
|
MangoPayId = dto.MangoPayId,
|
|
MangoPayUserId = dto.MangoPayUserId,
|
|
Type = dto.Type.ToDomain(),
|
|
Source = dto.Source.ToDomain(),
|
|
Status = dto.Status.ToDomain(),
|
|
PageCount = dto.PageCount,
|
|
Processed = dto.Processed,
|
|
RefusedReasonType = dto.RefusedReasonType,
|
|
RefusedReasonMessage = dto.RefusedReasonMessage,
|
|
FlagsValue = dto.FlagsValue,
|
|
Created = dto.Created
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static PayoutDto ToDto(this Payout domain)
|
|
{
|
|
var dto = new PayoutDto
|
|
{
|
|
Id = domain.Id,
|
|
Version = domain.Version,
|
|
UpdatedAt = domain.UpdatedAt,
|
|
Deleted = domain.Deleted,
|
|
AppUserId = domain.AppUserId,
|
|
MangoPayId = domain.MangoPayId,
|
|
MangoPayUserId = domain.MangoPayUserId,
|
|
WalletId = domain.WalletId,
|
|
MangoPayWalletId = domain.MangoPayWalletId,
|
|
MangoPayBankId = domain.MangoPayBankId,
|
|
Iban = domain.Iban,
|
|
Bic = domain.Bic,
|
|
Status = domain.Status.ToDto(),
|
|
Ammount = domain.Ammount,
|
|
Currency = domain.Currency,
|
|
ResultCode = domain.ResultCode,
|
|
ResultMessage = domain.ResultMessage,
|
|
ExecutionDate = domain.ExecutionDate,
|
|
Refunded = domain.Refunded,
|
|
RefundReasonType = domain.RefundReasonType,
|
|
RefundReasonMessage = domain.RefundReasonMessage,
|
|
Created = domain.Created
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static Payout ToDomain(this PayoutDto dto)
|
|
{
|
|
var domain = new Payout()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
AppUserId = dto.AppUserId,
|
|
MangoPayId = dto.MangoPayId,
|
|
MangoPayUserId = dto.MangoPayUserId,
|
|
WalletId = dto.WalletId,
|
|
MangoPayWalletId = dto.MangoPayWalletId,
|
|
MangoPayBankId = dto.MangoPayBankId,
|
|
Iban = dto.Iban,
|
|
Bic = dto.Bic,
|
|
Status = dto.Status.ToDomain(),
|
|
Ammount = dto.Ammount,
|
|
Currency = dto.Currency,
|
|
ResultCode = dto.ResultCode,
|
|
ResultMessage = dto.ResultMessage,
|
|
ExecutionDate = dto.ExecutionDate,
|
|
Refunded = dto.Refunded,
|
|
RefundReasonType = dto.RefundReasonType,
|
|
RefundReasonMessage = dto.RefundReasonMessage,
|
|
Created = dto.Created
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<Payout> ToDomain(this List<PayoutDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static WalkComplaintDto ToDto(this WalkComplaint domain)
|
|
{
|
|
var dto = new WalkComplaintDto
|
|
{
|
|
Id = domain.Id,
|
|
Version = domain.Version,
|
|
UpdatedAt = domain.UpdatedAt,
|
|
Deleted = domain.Deleted,
|
|
WalkId = domain.WalkId,
|
|
Source = domain.Source.ToDto(),
|
|
Type = domain.Type.ToDto(),
|
|
Message = domain.Message,
|
|
Status = domain.Status.ToDto(),
|
|
UserName = domain.UserName,
|
|
Comment = domain.Comment,
|
|
Resolved = domain.Resolved,
|
|
Created = domain.Created
|
|
};
|
|
return dto;
|
|
}
|
|
|
|
public static WalkComplaint ToDomain(this WalkComplaintDto dto)
|
|
{
|
|
var domain = new WalkComplaint()
|
|
{
|
|
Id = dto.Id,
|
|
Version = dto.Version,
|
|
UpdatedAt = dto.UpdatedAt,
|
|
Deleted = dto.Deleted,
|
|
WalkId = dto.WalkId,
|
|
Source = dto.Source.ToDomain(),
|
|
Type = dto.Type.ToDomain(),
|
|
Message = dto.Message,
|
|
Status = dto.Status.ToDomain(),
|
|
UserName = dto.UserName,
|
|
Comment = dto.Comment,
|
|
Resolved = dto.Resolved,
|
|
Created = dto.Created
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static AppUserBlockWithNames ToDomain(this AppUserBlockWithNamesDto dto)
|
|
{
|
|
var domain = new AppUserBlockWithNames()
|
|
{
|
|
Id = dto.Id,
|
|
BlockingAppUserId = dto.BlockingAppUserId,
|
|
BlockedAppUserId = dto.BlockedAppUserId,
|
|
BlockedUntil = dto.BlockedUntil,
|
|
AppUserReportId = dto.AppUserReportId,
|
|
CreatedBy = dto.CreatedBy,
|
|
Created = dto.Created,
|
|
Type = dto.Type.ToDomain(),
|
|
FirstName = dto.FirstName,
|
|
LastName = dto.LastName,
|
|
Photo = dto.Photo,
|
|
LocationHint = dto.LocationHint,
|
|
Lat = dto.Lat,
|
|
Lng = dto.Lng,
|
|
Locked = dto.Locked,
|
|
Deleted = dto.Deleted
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<AppUserBlockWithNames> ToDomain(this List<AppUserBlockWithNamesDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static AppVersion ToDomain(this AppVersionDto dto)
|
|
{
|
|
var domain = new AppVersion()
|
|
{
|
|
Id = dto.Id,
|
|
Platform = dto.Platform.ToDomain(),
|
|
Major = dto.Major,
|
|
Minor = dto.Minor,
|
|
Build = dto.Build,
|
|
Revision = dto.Revision,
|
|
Version = dto.Version,
|
|
IsCurrent = dto.IsCurrent,
|
|
IsMandatory = dto.IsMandatory,
|
|
ReleaseTitle = dto.ReleaseTitle,
|
|
ReleaseNotes = dto.ReleaseNotes,
|
|
ReleaseDate = dto.ReleaseDate,
|
|
LastUpdate = dto.LastUpdate,
|
|
Created = dto.Created
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static AppVersionCheck ToDomain(this AppVersionCheckDto dto)
|
|
{
|
|
var domain = new AppVersionCheck()
|
|
{
|
|
Id = dto.Id,
|
|
Platform = dto.Platform.ToDomain(),
|
|
Major = dto.Major,
|
|
Minor = dto.Minor,
|
|
Build = dto.Build,
|
|
Revision = dto.Revision,
|
|
Version = dto.Version,
|
|
IsCurrent = dto.IsCurrent,
|
|
IsMandatory = dto.IsMandatory,
|
|
ReleaseDate = dto.ReleaseDate
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static CheckVoucherCodeResult ToDomain(this CheckVoucherCodeResultDto dto)
|
|
{
|
|
var domain = new CheckVoucherCodeResult()
|
|
{
|
|
VoucherId = dto.VoucherId,
|
|
VoucherCampaignId = dto.VoucherCampaignId,
|
|
CampaignType = dto.CampaignType.ToDomain(),
|
|
VoucherAmmount = dto.VoucherAmmount,
|
|
ValidationResult = dto.ValidationResult.ToDomain()
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static ReserveVoucherResult ToDomain(this ReserveVoucherResultDto dto)
|
|
{
|
|
var domain = new ReserveVoucherResult()
|
|
{
|
|
Success = dto.Success,
|
|
VoucherUsageId = dto.VoucherUsageId,
|
|
ValidationResult = dto.ValidationResult.ToDomain(),
|
|
TransferFailed = dto.TransferFailed,
|
|
VoucherNotFound = dto.VoucherNotFound,
|
|
CampaignNotFound = dto.CampaignNotFound,
|
|
CustomerNotFound = dto.CustomerNotFound
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static Subscription ToDomain(this SubscriptionDto dto)
|
|
{
|
|
var domain = new Subscription()
|
|
{
|
|
Id = dto.Id,
|
|
Code = dto.Code,
|
|
Length = dto.Length.ToDomain(),
|
|
Price = dto.Price,
|
|
AppMode = dto.AppMode.ToDomain(),
|
|
GracePeriodInDays = dto.GracePeriodInDays,
|
|
Hidden = dto.Hidden,
|
|
MaxRegisteredDate = dto.MaxRegisteredDate,
|
|
Name = dto.Name,
|
|
Description = dto.Description
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<Subscription> ToDomain(this List<SubscriptionDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
|
|
public static AppUserSubscription ToDomain(this AppUserSubscriptionDto dto)
|
|
{
|
|
var domain = new AppUserSubscription()
|
|
{
|
|
Id = dto.Id,
|
|
SubscriptionId = dto.SubscriptionId,
|
|
SubscriptionCode = dto.SubscriptionCode,
|
|
SubscriptionLength = dto.SubscriptionLength.ToDomain(),
|
|
SubscriptionPrice = dto.SubscriptionPrice,
|
|
SubscriptionAppMode = dto.SubscriptionAppMode.ToDomain(),
|
|
SubscriptionName = dto.SubscriptionName,
|
|
SubscriptionGracePeriodInDays = dto.SubscriptionGracePeriodInDays,
|
|
IsValid = dto.IsValid,
|
|
ExpirationDate = dto.ExpirationDate,
|
|
ExpirationDateWithGrace = dto.ExpirationDateWithGrace,
|
|
LastRenewalDate = dto.LastRenewalDate,
|
|
Manual = dto.Manual,
|
|
Platform = dto.Platform.ToDomain(),
|
|
Created = dto.Created
|
|
};
|
|
return domain;
|
|
}
|
|
|
|
public static List<AppUserSubscription> ToDomain(this List<AppUserSubscriptionDto> dto)
|
|
{
|
|
return dto.Select(ToDomain).ToList();
|
|
}
|
|
}
|
|
}
|