From 2c20d49609b33130ccbea85c3ca6f45e4743648f Mon Sep 17 00:00:00 2001 From: "ashutosh.nehete" Date: Wed, 14 May 2025 09:51:01 +0000 Subject: [PATCH] revert c7e89630eb494454c1322bdf4cf29ab076af7b86 revert Models, DTOs (Data Transfer Objects), and view models have been created for the directory. --- Marco.Pms.Model/Directory/Bucket.cs | 11 -- Marco.Pms.Model/Directory/Contact.cs | 31 --- .../Directory/ContactBucketMapping.cs | 18 -- .../Directory/ContactCategoryMaster.cs | 11 -- Marco.Pms.Model/Directory/ContactEmail.cs | 21 --- Marco.Pms.Model/Directory/ContactNote.cs | 25 --- Marco.Pms.Model/Directory/ContactPhone.cs | 22 --- .../Directory/ContactTagMapping.cs | 11 -- Marco.Pms.Model/Directory/ContactTagMaster.cs | 11 -- .../Directory/DirectoryUpdateLog.cs | 18 -- .../Directory/EmployeeBucketMapping.cs | 19 -- .../Dtos/Directory/CreateBucketDto.cs | 8 - .../Dtos/Directory/CreateContactDto.cs | 15 -- .../Dtos/Directory/CreateContactEmailDto.cs | 9 - .../Dtos/Directory/CreateContactNoteDto.cs | 8 - .../Dtos/Directory/CreateContactPhoneDto.cs | 9 - .../Dtos/Directory/UpdateContactDto.cs | 16 -- .../Dtos/Directory/UpdateContactEmailDto.cs | 10 - .../Dtos/Directory/UpdateContactNoteDto.cs | 9 - .../Dtos/Directory/UpdateContactPhoneDto.cs | 10 - .../Dtos/Master/CreateContactCategoryDto.cs | 8 - .../Dtos/Master/CreateContactTagDto.cs | 7 - .../Dtos/Master/UpdateContactCategoryDto.cs | 9 - .../Dtos/Master/UpdateContactTagDto.cs | 8 - Marco.Pms.Model/Mapper/DirectoryMapper.cs | 177 ------------------ .../ViewModels/Directory/ContactEmailVM.cs | 10 - .../ViewModels/Directory/ContactPhoneVM.cs | 10 - .../ViewModels/Directory/ContactVM.cs | 18 -- .../ViewModels/Master/ContactCategoryVM.cs | 9 - .../ViewModels/Master/ContactTagVM.cs | 8 - 30 files changed, 556 deletions(-) delete mode 100644 Marco.Pms.Model/Directory/Bucket.cs delete mode 100644 Marco.Pms.Model/Directory/Contact.cs delete mode 100644 Marco.Pms.Model/Directory/ContactBucketMapping.cs delete mode 100644 Marco.Pms.Model/Directory/ContactCategoryMaster.cs delete mode 100644 Marco.Pms.Model/Directory/ContactEmail.cs delete mode 100644 Marco.Pms.Model/Directory/ContactNote.cs delete mode 100644 Marco.Pms.Model/Directory/ContactPhone.cs delete mode 100644 Marco.Pms.Model/Directory/ContactTagMapping.cs delete mode 100644 Marco.Pms.Model/Directory/ContactTagMaster.cs delete mode 100644 Marco.Pms.Model/Directory/DirectoryUpdateLog.cs delete mode 100644 Marco.Pms.Model/Directory/EmployeeBucketMapping.cs delete mode 100644 Marco.Pms.Model/Dtos/Directory/CreateBucketDto.cs delete mode 100644 Marco.Pms.Model/Dtos/Directory/CreateContactDto.cs delete mode 100644 Marco.Pms.Model/Dtos/Directory/CreateContactEmailDto.cs delete mode 100644 Marco.Pms.Model/Dtos/Directory/CreateContactNoteDto.cs delete mode 100644 Marco.Pms.Model/Dtos/Directory/CreateContactPhoneDto.cs delete mode 100644 Marco.Pms.Model/Dtos/Directory/UpdateContactDto.cs delete mode 100644 Marco.Pms.Model/Dtos/Directory/UpdateContactEmailDto.cs delete mode 100644 Marco.Pms.Model/Dtos/Directory/UpdateContactNoteDto.cs delete mode 100644 Marco.Pms.Model/Dtos/Directory/UpdateContactPhoneDto.cs delete mode 100644 Marco.Pms.Model/Dtos/Master/CreateContactCategoryDto.cs delete mode 100644 Marco.Pms.Model/Dtos/Master/CreateContactTagDto.cs delete mode 100644 Marco.Pms.Model/Dtos/Master/UpdateContactCategoryDto.cs delete mode 100644 Marco.Pms.Model/Dtos/Master/UpdateContactTagDto.cs delete mode 100644 Marco.Pms.Model/Mapper/DirectoryMapper.cs delete mode 100644 Marco.Pms.Model/ViewModels/Directory/ContactEmailVM.cs delete mode 100644 Marco.Pms.Model/ViewModels/Directory/ContactPhoneVM.cs delete mode 100644 Marco.Pms.Model/ViewModels/Directory/ContactVM.cs delete mode 100644 Marco.Pms.Model/ViewModels/Master/ContactCategoryVM.cs delete mode 100644 Marco.Pms.Model/ViewModels/Master/ContactTagVM.cs diff --git a/Marco.Pms.Model/Directory/Bucket.cs b/Marco.Pms.Model/Directory/Bucket.cs deleted file mode 100644 index 028b428..0000000 --- a/Marco.Pms.Model/Directory/Bucket.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Marco.Pms.Model.Utilities; - -namespace Marco.Pms.Model.Directory -{ - public class Bucket : TenantRelation - { - public Guid Id { get; set; } - public string Name { get; set; } = string.Empty; - public string Description { get; set; } = string.Empty; - } -} diff --git a/Marco.Pms.Model/Directory/Contact.cs b/Marco.Pms.Model/Directory/Contact.cs deleted file mode 100644 index 87d7698..0000000 --- a/Marco.Pms.Model/Directory/Contact.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel; -using System.ComponentModel.DataAnnotations.Schema; -using Marco.Pms.Model.Employees; -using Marco.Pms.Model.Utilities; -using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; - -namespace Marco.Pms.Model.Directory -{ - public class Contact : TenantRelation - { - public Guid Id { get; set; } - public Guid? ProjectId { get; set; } - public string Name { get; set; } = string.Empty; - public string Description { get; set; } = string.Empty; - public string Organization { get; set; } = string.Empty; - public string? Address { get; set; } - public bool IsActive { get; set; } = true; - public Guid CreatedById { get; set; } - - [ValidateNever] - [ForeignKey("CreatedById")] - public Employee? CreatedBy { get; set; } - - [DisplayName("ContactCategoryId")] - public Guid? ContactCategoryId { get; set; } - [ValidateNever] - [ForeignKey(nameof(ContactCategoryId))] - public ContactCategoryMaster? ContactCategory { get; set; } - public DateTime CreatedAt { get; set; } - } -} diff --git a/Marco.Pms.Model/Directory/ContactBucketMapping.cs b/Marco.Pms.Model/Directory/ContactBucketMapping.cs deleted file mode 100644 index 9444337..0000000 --- a/Marco.Pms.Model/Directory/ContactBucketMapping.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; - -namespace Marco.Pms.Model.Directory -{ - public class ContactBucketMapping - { - public Guid Id { get; set; } - public Guid BucketId { get; set; } - [ValidateNever] - [ForeignKey("BucketId")] - public Bucket? Bucket { get; set; } - public Guid ContactId { get; set; } - [ValidateNever] - [ForeignKey("ContactId")] - public Contact? Contact { get; set; } - } -} diff --git a/Marco.Pms.Model/Directory/ContactCategoryMaster.cs b/Marco.Pms.Model/Directory/ContactCategoryMaster.cs deleted file mode 100644 index 8fb1a94..0000000 --- a/Marco.Pms.Model/Directory/ContactCategoryMaster.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Marco.Pms.Model.Utilities; - -namespace Marco.Pms.Model.Directory -{ - public class ContactCategoryMaster : TenantRelation - { - public Guid Id { get; set; } - public string Name { get; set; } = string.Empty; - public string Description { get; set; } = string.Empty; - } -} diff --git a/Marco.Pms.Model/Directory/ContactEmail.cs b/Marco.Pms.Model/Directory/ContactEmail.cs deleted file mode 100644 index 1eb1b34..0000000 --- a/Marco.Pms.Model/Directory/ContactEmail.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.ComponentModel; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; - -namespace Marco.Pms.Model.Directory -{ - public class ContactEmail - { - public Guid Id { get; set; } - public string Label { get; set; } = string.Empty; - public string EmailAddress { get; set; } = string.Empty; - [DisplayName("ContactId")] - public Guid ContactId { get; set; } - [ValidateNever] - [ForeignKey(nameof(ContactId))] - public Contact? Contact { get; set; } - public bool IsPrimary { get; set; } - public Guid TenantId { get; set; } - - } -} diff --git a/Marco.Pms.Model/Directory/ContactNote.cs b/Marco.Pms.Model/Directory/ContactNote.cs deleted file mode 100644 index e203f1d..0000000 --- a/Marco.Pms.Model/Directory/ContactNote.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.ComponentModel.DataAnnotations.Schema; -using Marco.Pms.Model.Employees; -using Marco.Pms.Model.Utilities; -using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; - -namespace Marco.Pms.Model.Directory -{ - public class ContactNote : TenantRelation - { - public Guid Id { get; set; } - public string Note { get; set; } = string.Empty; - public Guid CreatedById { get; set; } - - [ValidateNever] - [ForeignKey("CreatedById")] - public Employee? Createdby { get; set; } - public DateTime CreatedAt { get; set; } = DateTime.UtcNow; - public Guid ContactId { get; set; } - - [ValidateNever] - [ForeignKey("ContactId")] - public Contact? Contact { get; set; } - public bool IsActive { get; set; } = true; - } -} diff --git a/Marco.Pms.Model/Directory/ContactPhone.cs b/Marco.Pms.Model/Directory/ContactPhone.cs deleted file mode 100644 index d10439b..0000000 --- a/Marco.Pms.Model/Directory/ContactPhone.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.ComponentModel; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; - -namespace Marco.Pms.Model.Directory -{ - public class ContactPhone - { - public Guid Id { get; set; } - public string Label { get; set; } = string.Empty; - public string PhoneNumber { get; set; } = string.Empty; - [DisplayName("ContactId")] - public Guid ContactId { get; set; } - [ValidateNever] - [ForeignKey(nameof(ContactId))] - public Contact? Contact { get; set; } - public bool IsPrimary { get; set; } - - public Guid TenantId { get; set; } - - } -} diff --git a/Marco.Pms.Model/Directory/ContactTagMapping.cs b/Marco.Pms.Model/Directory/ContactTagMapping.cs deleted file mode 100644 index a3d7e9e..0000000 --- a/Marco.Pms.Model/Directory/ContactTagMapping.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Marco.Pms.Model.Directory -{ - public class ContactTagMapping - { - public Guid Id { get; set; } - public Guid ContactId { get; set; } - public Contact? Contact { get; set; } - public Guid ContactTagtId { get; set; } - public ContactTagMaster? ContactTag { get; set; } - } -} diff --git a/Marco.Pms.Model/Directory/ContactTagMaster.cs b/Marco.Pms.Model/Directory/ContactTagMaster.cs deleted file mode 100644 index 86eba76..0000000 --- a/Marco.Pms.Model/Directory/ContactTagMaster.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Marco.Pms.Model.Utilities; - -namespace Marco.Pms.Model.Directory -{ - public class ContactTagMaster : TenantRelation - { - public Guid Id { get; set; } - public string Name { get; set; } = string.Empty; - public string Description { get; set; } = string.Empty; - } -} diff --git a/Marco.Pms.Model/Directory/DirectoryUpdateLog.cs b/Marco.Pms.Model/Directory/DirectoryUpdateLog.cs deleted file mode 100644 index 91b1b7a..0000000 --- a/Marco.Pms.Model/Directory/DirectoryUpdateLog.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.ComponentModel.DataAnnotations.Schema; -using Marco.Pms.Model.Employees; -using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; - -namespace Marco.Pms.Model.Directory -{ - public class DirectoryUpdateLog - { - public Guid Id { get; set; } - public Guid RefereanceId { get; set; } - public DateTime UpdateAt { get; set; } = DateTime.UtcNow; - public Guid UpdatedById { get; set; } - - [ValidateNever] - [ForeignKey("UpdatedById")] - public Employee? Employee { get; set; } - } -} diff --git a/Marco.Pms.Model/Directory/EmployeeBucketMapping.cs b/Marco.Pms.Model/Directory/EmployeeBucketMapping.cs deleted file mode 100644 index db12d3f..0000000 --- a/Marco.Pms.Model/Directory/EmployeeBucketMapping.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.ComponentModel.DataAnnotations.Schema; -using Marco.Pms.Model.Employees; -using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; - -namespace Marco.Pms.Model.Directory -{ - public class EmployeeBucketMapping - { - public Guid Id { get; set; } - public Guid BucketId { get; set; } - [ValidateNever] - [ForeignKey("BucketId")] - public Bucket? Bucket { get; set; } - public Guid EmployeeId { get; set; } - [ValidateNever] - [ForeignKey("EmployeeId")] - public Employee? Employee { get; set; } - } -} diff --git a/Marco.Pms.Model/Dtos/Directory/CreateBucketDto.cs b/Marco.Pms.Model/Dtos/Directory/CreateBucketDto.cs deleted file mode 100644 index ba0918d..0000000 --- a/Marco.Pms.Model/Dtos/Directory/CreateBucketDto.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Marco.Pms.Model.Dtos.Directory -{ - public class CreateBucketDto - { - public string name { get; set; } = string.Empty; - public string description { get; set; } = string.Empty; - } -} diff --git a/Marco.Pms.Model/Dtos/Directory/CreateContactDto.cs b/Marco.Pms.Model/Dtos/Directory/CreateContactDto.cs deleted file mode 100644 index 42937c0..0000000 --- a/Marco.Pms.Model/Dtos/Directory/CreateContactDto.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Marco.Pms.Model.Dtos.Directory -{ - public class CreateContactDto - { - public Guid? ProjectId { get; set; } - public string? Name { get; set; } - public List? ContactPhones { get; set; } - public List? ContactEmails { get; set; } - public Guid ContactCategoryId { get; set; } - public string? Description { get; set; } - public string? Organization { get; set; } - public string? Address { get; set; } - public List? TagIds { get; set; } - } -} diff --git a/Marco.Pms.Model/Dtos/Directory/CreateContactEmailDto.cs b/Marco.Pms.Model/Dtos/Directory/CreateContactEmailDto.cs deleted file mode 100644 index 68bb2b2..0000000 --- a/Marco.Pms.Model/Dtos/Directory/CreateContactEmailDto.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Marco.Pms.Model.Dtos.Directory -{ - public class CreateContactEmailDto - { - public string? Label { get; set; } - public string? EmailAddress { get; set; } - public Guid? ContactId { get; set; } - } -} diff --git a/Marco.Pms.Model/Dtos/Directory/CreateContactNoteDto.cs b/Marco.Pms.Model/Dtos/Directory/CreateContactNoteDto.cs deleted file mode 100644 index 1ccaea9..0000000 --- a/Marco.Pms.Model/Dtos/Directory/CreateContactNoteDto.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Marco.Pms.Model.Dtos.Directory -{ - public class CreateContactNoteDto - { - public string Note { get; set; } = string.Empty; - public Guid ContactId { get; set; } - } -} diff --git a/Marco.Pms.Model/Dtos/Directory/CreateContactPhoneDto.cs b/Marco.Pms.Model/Dtos/Directory/CreateContactPhoneDto.cs deleted file mode 100644 index dc97881..0000000 --- a/Marco.Pms.Model/Dtos/Directory/CreateContactPhoneDto.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Marco.Pms.Model.Dtos.Directory -{ - public class CreateContactPhoneDto - { - public string? Label { get; set; } - public string? PhoneNumber { get; set; } - public Guid? ContactId { get; set; } - } -} diff --git a/Marco.Pms.Model/Dtos/Directory/UpdateContactDto.cs b/Marco.Pms.Model/Dtos/Directory/UpdateContactDto.cs deleted file mode 100644 index 042150d..0000000 --- a/Marco.Pms.Model/Dtos/Directory/UpdateContactDto.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace Marco.Pms.Model.Dtos.Directory -{ - public class UpdateContactDto - { - public Guid Id { get; set; } - public Guid? ProjectId { get; set; } - public string? Name { get; set; } - public List? ContactPhones { get; set; } - public List? ContactEmails { get; set; } - public Guid ContactCategoryId { get; set; } - public string? Description { get; set; } - public string? Organization { get; set; } - public string? Address { get; set; } - public List? TagIds { get; set; } - } -} diff --git a/Marco.Pms.Model/Dtos/Directory/UpdateContactEmailDto.cs b/Marco.Pms.Model/Dtos/Directory/UpdateContactEmailDto.cs deleted file mode 100644 index 8ece036..0000000 --- a/Marco.Pms.Model/Dtos/Directory/UpdateContactEmailDto.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Marco.Pms.Model.Dtos.Directory -{ - public class UpdateContactEmailDto - { - public Guid Id { get; set; } - public string? Label { get; set; } - public string? EmailAddress { get; set; } - public Guid? ContactId { get; set; } - } -} diff --git a/Marco.Pms.Model/Dtos/Directory/UpdateContactNoteDto.cs b/Marco.Pms.Model/Dtos/Directory/UpdateContactNoteDto.cs deleted file mode 100644 index 295357a..0000000 --- a/Marco.Pms.Model/Dtos/Directory/UpdateContactNoteDto.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Marco.Pms.Model.Dtos.Directory -{ - public class UpdateContactNoteDto - { - public Guid Id { get; set; } - public string Note { get; set; } = string.Empty; - public Guid ContactId { get; set; } - } -} diff --git a/Marco.Pms.Model/Dtos/Directory/UpdateContactPhoneDto.cs b/Marco.Pms.Model/Dtos/Directory/UpdateContactPhoneDto.cs deleted file mode 100644 index 1ddfb14..0000000 --- a/Marco.Pms.Model/Dtos/Directory/UpdateContactPhoneDto.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Marco.Pms.Model.Dtos.Directory -{ - public class UpdateContactPhoneDto - { - public Guid Id { get; set; } - public string? Label { get; set; } - public string? PhoneNumber { get; set; } - public Guid? ContactId { get; set; } - } -} diff --git a/Marco.Pms.Model/Dtos/Master/CreateContactCategoryDto.cs b/Marco.Pms.Model/Dtos/Master/CreateContactCategoryDto.cs deleted file mode 100644 index 3efc443..0000000 --- a/Marco.Pms.Model/Dtos/Master/CreateContactCategoryDto.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Marco.Pms.Model.Dtos.Master -{ - public class CreateContactCategoryDto - { - public string? Name { get; set; } - public string? Description { get; set; } - } -} diff --git a/Marco.Pms.Model/Dtos/Master/CreateContactTagDto.cs b/Marco.Pms.Model/Dtos/Master/CreateContactTagDto.cs deleted file mode 100644 index ad91ca7..0000000 --- a/Marco.Pms.Model/Dtos/Master/CreateContactTagDto.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Marco.Pms.Model.Dtos.Master -{ - public class CreateContactTagDto - { - public string? Name { get; set; } - } -} diff --git a/Marco.Pms.Model/Dtos/Master/UpdateContactCategoryDto.cs b/Marco.Pms.Model/Dtos/Master/UpdateContactCategoryDto.cs deleted file mode 100644 index 0bd5cc7..0000000 --- a/Marco.Pms.Model/Dtos/Master/UpdateContactCategoryDto.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Marco.Pms.Model.Dtos.Master -{ - public class UpdateContactCategoryDto - { - public Guid Id { get; set; } - public string? Name { get; set; } - public string? Description { get; set; } - } -} diff --git a/Marco.Pms.Model/Dtos/Master/UpdateContactTagDto.cs b/Marco.Pms.Model/Dtos/Master/UpdateContactTagDto.cs deleted file mode 100644 index 0406a6c..0000000 --- a/Marco.Pms.Model/Dtos/Master/UpdateContactTagDto.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Marco.Pms.Model.Dtos.Master -{ - public class UpdateContactTagDto - { - public Guid Id { get; set; } - public string? Name { get; set; } - } -} diff --git a/Marco.Pms.Model/Mapper/DirectoryMapper.cs b/Marco.Pms.Model/Mapper/DirectoryMapper.cs deleted file mode 100644 index 048a0d2..0000000 --- a/Marco.Pms.Model/Mapper/DirectoryMapper.cs +++ /dev/null @@ -1,177 +0,0 @@ -using Marco.Pms.Model.Directory; -using Marco.Pms.Model.Dtos.Directory; -using Marco.Pms.Model.Dtos.Master; -using Marco.Pms.Model.ViewModels.Directory; -using Marco.Pms.Model.ViewModels.Master; - -namespace Marco.Pms.Model.Mapper -{ - public static class DirectoryMapper - { - public static Contact ToContactFromCreateContactDto(this CreateContactDto createContactDto, Guid tenantId) - { - - return new Contact - { - ProjectId = createContactDto.ProjectId, - Name = createContactDto.Name ?? string.Empty, - ContactCategoryId = createContactDto.ContactCategoryId, - Description = createContactDto.Description ?? string.Empty, - Organization = createContactDto?.Organization ?? string.Empty, - Address = createContactDto != null ? createContactDto.Address : string.Empty, - TenantId = tenantId - }; - } - public static Contact ToContactFromUpdateContactDto(this UpdateContactDto updateContactDto, Guid tenantId) - { - - return new Contact - { - Id = updateContactDto.Id, - ProjectId = updateContactDto.ProjectId, - Name = updateContactDto.Name ?? string.Empty, - ContactCategoryId = updateContactDto.ContactCategoryId, - Description = updateContactDto.Description ?? string.Empty, - Organization = updateContactDto?.Organization ?? string.Empty, - Address = updateContactDto != null ? updateContactDto.Address : string.Empty, - TenantId = tenantId - }; - } - public static ContactVM ToContactVMFromContact(this Contact contact) - { - return new ContactVM - { - Id = contact.Id, - ProjectId = contact.ProjectId, - Name = contact.Name, - ContactType = contact.ContactCategory != null ? contact.ContactCategory.ToContactTypeVMFromContactTypeMaster() : new ContactCategoryVM(), - Description = contact.Description ?? string.Empty, - Organization = contact.Organization ?? string.Empty, - Address = contact.Address ?? string.Empty - }; - } - - //Contact Phone Mapper - public static ContactPhone ToContactPhoneFromCreateContactPhoneDto(this CreateContactPhoneDto createContactPhoneDto, Guid tenantId, Guid contactId) - { - return new ContactPhone - { - Label = createContactPhoneDto.Label ?? string.Empty, - PhoneNumber = createContactPhoneDto.PhoneNumber ?? string.Empty, - ContactId = contactId, - TenantId = tenantId - }; - } - public static ContactPhone ToContactPhoneFromUpdateContactPhoneDto(this UpdateContactPhoneDto updateContactPhoneDto, Guid tenantId, Guid contactId) - { - return new ContactPhone - { - Id = updateContactPhoneDto.Id, - Label = updateContactPhoneDto.Label ?? string.Empty, - PhoneNumber = updateContactPhoneDto.PhoneNumber ?? string.Empty, - ContactId = contactId, - TenantId = tenantId - }; - } - public static ContactPhoneVM ToContactPhoneVMFromContactPhone(this ContactPhone phone) - { - return new ContactPhoneVM - { - Id = phone.Id, - Label = phone.Label ?? string.Empty, - PhoneNumber = phone.PhoneNumber ?? string.Empty, - ContactId = phone.ContactId - }; - } - - //Contact Email Mapper - public static ContactEmail ToContactEmailFromCreateContactEmailDto(this CreateContactEmailDto createContactEmailDto, Guid tenantId, Guid contactId) - { - return new ContactEmail - { - Label = createContactEmailDto.Label ?? string.Empty, - EmailAddress = createContactEmailDto.EmailAddress ?? string.Empty, - ContactId = contactId, - TenantId = tenantId - }; - } - public static ContactEmail ToContactEmailFromUpdateContactEmailDto(this UpdateContactEmailDto updateContactEmailDto, Guid tenantId, Guid contactId) - { - return new ContactEmail - { - Id = updateContactEmailDto.Id, - Label = updateContactEmailDto.Label ?? string.Empty, - EmailAddress = updateContactEmailDto.EmailAddress ?? string.Empty, - ContactId = contactId, - TenantId = tenantId - }; - } - public static ContactEmailVM ToContactEmailVMFromContactEmail(this ContactEmail email) - { - return new ContactEmailVM - { - Id = email.Id, - Label = email.Label ?? string.Empty, - EmailAddress = email.EmailAddress ?? string.Empty, - ContactId = email.ContactId - }; - } - - //Contact Tag Mapper - public static ContactTagMaster ToContactTagMasterFromCreateContactTagDto(this CreateContactTagDto createContactTagDto, Guid tenantId) - { - return new ContactTagMaster - { - Name = createContactTagDto.Name ?? string.Empty, - TenantId = tenantId - }; - } - public static ContactTagMaster ToContactTagMasterFromUpdateContactTagDto(this UpdateContactTagDto updateContactTagDto, Guid tenantId) - { - return new ContactTagMaster - { - Id = updateContactTagDto.Id, - Name = updateContactTagDto.Name ?? string.Empty, - TenantId = tenantId - }; - } - public static ContactTagVM ToContactTagVMFromContactTagMaster(this ContactTagMaster contactTag) - { - return new ContactTagVM - { - Id = contactTag.Id, - Name = contactTag.Name ?? string.Empty, - }; - } - - //Contact Category Mapper - public static ContactCategoryMaster ToContactCategoryMasterFromCreateContactCategoryDto(this CreateContactCategoryDto createContactTypeDto, Guid tenantId) - { - return new ContactCategoryMaster - { - Name = createContactTypeDto.Name ?? string.Empty, - Description = createContactTypeDto.Description ?? string.Empty, - TenantId = tenantId - }; - } - public static ContactCategoryMaster ToContactCategoryMasterFromUpdateContactCategoryDto(this UpdateContactCategoryDto updateContactTypeDto, Guid tenantId) - { - return new ContactCategoryMaster - { - Id = updateContactTypeDto.Id, - Name = updateContactTypeDto.Name ?? string.Empty, - Description = updateContactTypeDto.Description ?? string.Empty, - TenantId = tenantId - }; - } - public static ContactCategoryVM ToContactCategoryVMFromContactCategoryMaster(this ContactCategoryMaster contactType) - { - return new ContactCategoryVM - { - Id = contactType.Id, - Name = contactType.Name ?? string.Empty, - Description = contactType.Description ?? string.Empty, - }; - } - } -} diff --git a/Marco.Pms.Model/ViewModels/Directory/ContactEmailVM.cs b/Marco.Pms.Model/ViewModels/Directory/ContactEmailVM.cs deleted file mode 100644 index 476e44d..0000000 --- a/Marco.Pms.Model/ViewModels/Directory/ContactEmailVM.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Marco.Pms.Model.ViewModels.Directory -{ - public class ContactEmailVM - { - public Guid Id { get; set; } - public string? Label { get; set; } - public string? EmailAddress { get; set; } - public Guid ContactId { get; set; } - } -} diff --git a/Marco.Pms.Model/ViewModels/Directory/ContactPhoneVM.cs b/Marco.Pms.Model/ViewModels/Directory/ContactPhoneVM.cs deleted file mode 100644 index 1dc7672..0000000 --- a/Marco.Pms.Model/ViewModels/Directory/ContactPhoneVM.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Marco.Pms.Model.ViewModels.Directory -{ - public class ContactPhoneVM - { - public Guid Id { get; set; } - public string? Label { get; set; } - public string? PhoneNumber { get; set; } - public Guid ContactId { get; set; } - } -} diff --git a/Marco.Pms.Model/ViewModels/Directory/ContactVM.cs b/Marco.Pms.Model/ViewModels/Directory/ContactVM.cs deleted file mode 100644 index 6d6f82e..0000000 --- a/Marco.Pms.Model/ViewModels/Directory/ContactVM.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Marco.Pms.Model.ViewModels.Master; - -namespace Marco.Pms.Model.ViewModels.Directory -{ - public class ContactVM - { - public Guid Id { get; set; } - public Guid? ProjectId { get; set; } - public string? Name { get; set; } - public List? ContactPhones { get; set; } - public List? ContactEmails { get; set; } - public ContactCategoryVM? ContactType { get; set; } - public string? Description { get; set; } - public string? Organization { get; set; } - public string? Address { get; set; } - public List? Tags { get; set; } - } -} diff --git a/Marco.Pms.Model/ViewModels/Master/ContactCategoryVM.cs b/Marco.Pms.Model/ViewModels/Master/ContactCategoryVM.cs deleted file mode 100644 index eb08d89..0000000 --- a/Marco.Pms.Model/ViewModels/Master/ContactCategoryVM.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Marco.Pms.Model.ViewModels.Master -{ - public class ContactCategoryVM - { - public Guid Id { get; set; } - public string? Name { get; set; } - public string? Description { get; set; } - } -} diff --git a/Marco.Pms.Model/ViewModels/Master/ContactTagVM.cs b/Marco.Pms.Model/ViewModels/Master/ContactTagVM.cs deleted file mode 100644 index 2cb6f8a..0000000 --- a/Marco.Pms.Model/ViewModels/Master/ContactTagVM.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Marco.Pms.Model.ViewModels.Master -{ - public class ContactTagVM - { - public Guid Id { get; set; } - public string? Name { get; set; } - } -}