Added the Inventory relasted Tables and master APIs of Purchase Order Status and Requisition Status
This commit is contained in:
parent
c6744f0556
commit
fba12f577d
@ -8,6 +8,7 @@ using Marco.Pms.Model.Employees;
|
||||
using Marco.Pms.Model.Entitlements;
|
||||
using Marco.Pms.Model.Expenses;
|
||||
using Marco.Pms.Model.Forum;
|
||||
using Marco.Pms.Model.Inventory;
|
||||
using Marco.Pms.Model.Mail;
|
||||
using Marco.Pms.Model.Master;
|
||||
using Marco.Pms.Model.OrganizationModel;
|
||||
@ -141,6 +142,32 @@ namespace Marco.Pms.DataAccess.Data
|
||||
public DbSet<ReceivedInvoicePayment> ReceivedInvoicePayments { get; set; }
|
||||
public DbSet<PaymentAdjustmentHead> PaymentAdjustmentHeads { get; set; }
|
||||
|
||||
// Inventory
|
||||
public DbSet<Item> Items { get; set; }
|
||||
public DbSet<ItemCategoryMaster> ItemCategoryMasters { get; set; }
|
||||
public DbSet<ItemGroupMaster> ItemGroupMasters { get; set; }
|
||||
public DbSet<ItemManufacturerMapping> ItemManufacturerMappings { get; set; }
|
||||
public DbSet<ItemSupplierMapping> ItemSupplierMappings { get; set; }
|
||||
public DbSet<ItemTaxTypeMapping> ItemTaxTypeMappings { get; set; }
|
||||
public DbSet<PurchaseOrder> PurchaseOrders { get; set; }
|
||||
public DbSet<PurchaseOrderStatus> PurchaseOrderStatus { get; set; }
|
||||
public DbSet<PurchaseOrderStatusLogs> PurchaseOrderStatusLogs { get; set; }
|
||||
public DbSet<PurchaseStatusEmployeeMapping> PurchaseStatusEmployeeMappings { get; set; }
|
||||
public DbSet<PurchaseStatusMapping> PurchaseStatusMappings { get; set; }
|
||||
public DbSet<Requisition> Requisitions { get; set; }
|
||||
public DbSet<RequisitionStatus> RequisitionStatus { get; set; }
|
||||
public DbSet<RequisitionStatusEmployeeMapping> RequisitionStatusEmployeeMappings { get; set; }
|
||||
public DbSet<RequisitionStatusLogs> RequisitionStatusLogs { get; set; }
|
||||
public DbSet<RequisitionStatusMapping> RequisitionStatusMappings { get; set; }
|
||||
public DbSet<Supplier> Suppliers { get; set; }
|
||||
public DbSet<SupplierStateMapping> SupplierStateMappings { get; set; }
|
||||
public DbSet<Manufacturer> Manufacturers { get; set; }
|
||||
public DbSet<ServicesTaxType> ServicesTaxTypes { get; set; }
|
||||
public DbSet<StateMaster> StateMasters { get; set; }
|
||||
public DbSet<TaxSlabMaster> TaxSlabMasters { get; set; }
|
||||
public DbSet<TechnicalUnit> TechnicalUnits { get; set; }
|
||||
public DbSet<UnitType> UnitTypes { get; set; }
|
||||
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
@ -467,6 +494,7 @@ namespace Marco.Pms.DataAccess.Data
|
||||
.WithMany()
|
||||
.HasForeignKey(ar => ar.TenantId);
|
||||
// Configure the relationship between ApplicationRole and FeaturePermission via a join table
|
||||
|
||||
modelBuilder.Entity<RolePermissionMappings>(entity =>
|
||||
{
|
||||
entity.HasKey(rfp => new { rfp.ApplicationRoleId, rfp.FeaturePermissionId });
|
||||
@ -480,8 +508,6 @@ namespace Marco.Pms.DataAccess.Data
|
||||
.HasForeignKey(rfp => rfp.FeaturePermissionId);
|
||||
});
|
||||
|
||||
|
||||
|
||||
modelBuilder.Entity<ExpensesStatusMaster>().HasData(
|
||||
new ExpensesStatusMaster
|
||||
{
|
||||
|
||||
8002
Marco.Pms.DataAccess/Migrations/20251027073344_Added_Inventory_Related_Tables.Designer.cs
generated
Normal file
8002
Marco.Pms.DataAccess/Migrations/20251027073344_Added_Inventory_Related_Tables.Designer.cs
generated
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
14
Marco.Pms.Model/Dtos/Inventory/ItemDto.cs
Normal file
14
Marco.Pms.Model/Dtos/Inventory/ItemDto.cs
Normal file
@ -0,0 +1,14 @@
|
||||
namespace Marco.Pms.Model.Dtos.Inventory
|
||||
{
|
||||
public class ItemDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
public string Description { get; set; } = default!;
|
||||
public Guid ItemGroupId { get; set; }
|
||||
public Guid TechnicalUnitId { get; set; }
|
||||
public int Threshold { get; set; }
|
||||
public List<SupplierManufacturerDto>? Suppliers { get; set; }
|
||||
public List<ItemTaxTypeDto>? TaxRates { get; set; }
|
||||
}
|
||||
}
|
||||
8
Marco.Pms.Model/Dtos/Inventory/ItemTaxTypeDto.cs
Normal file
8
Marco.Pms.Model/Dtos/Inventory/ItemTaxTypeDto.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace Marco.Pms.Model.Dtos.Inventory
|
||||
{
|
||||
public class ItemTaxTypeDto
|
||||
{
|
||||
public Guid ServicesTaxTypeId { get; set; }
|
||||
public int Rate { get; set; }
|
||||
}
|
||||
}
|
||||
9
Marco.Pms.Model/Dtos/Inventory/PurchaseOrderStatusDto.cs
Normal file
9
Marco.Pms.Model/Dtos/Inventory/PurchaseOrderStatusDto.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace Marco.Pms.Model.Dtos.Inventory
|
||||
{
|
||||
public class PurchaseOrderStatusDto
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public required string Name { get; set; }
|
||||
public required string Description { get; set; }
|
||||
}
|
||||
}
|
||||
9
Marco.Pms.Model/Dtos/Inventory/RequisitionStatusDto.cs
Normal file
9
Marco.Pms.Model/Dtos/Inventory/RequisitionStatusDto.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace Marco.Pms.Model.Dtos.Inventory
|
||||
{
|
||||
public class RequisitionStatusDto
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public required string Name { get; set; }
|
||||
public required string Description { get; set; }
|
||||
}
|
||||
}
|
||||
12
Marco.Pms.Model/Dtos/Inventory/SupplierManufacturerDto.cs
Normal file
12
Marco.Pms.Model/Dtos/Inventory/SupplierManufacturerDto.cs
Normal file
@ -0,0 +1,12 @@
|
||||
namespace Marco.Pms.Model.Dtos.Inventory
|
||||
{
|
||||
public class SupplierManufacturerDto
|
||||
{
|
||||
public Guid ManufacturerId { get; set; }
|
||||
public Guid SupplierId { get; set; }
|
||||
public double BasePrice { get; set; }
|
||||
public int PurchaseLeadTime { get; set; }
|
||||
public Guid CurrencyId { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
}
|
||||
}
|
||||
40
Marco.Pms.Model/Inventory/Item.cs
Normal file
40
Marco.Pms.Model/Inventory/Item.cs
Normal file
@ -0,0 +1,40 @@
|
||||
using Marco.Pms.Model.Employees;
|
||||
using Marco.Pms.Model.Master;
|
||||
using Marco.Pms.Model.Utilities;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Marco.Pms.Model.Inventory
|
||||
{
|
||||
public class Item : TenantRelation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
public string Description { get; set; } = default!;
|
||||
public Guid ItemGroupId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("ItemGroupId")]
|
||||
public ItemGroupMaster? ItemGroup { get; set; }
|
||||
public Guid TechnicalUnitId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("TechnicalUnitId")]
|
||||
public TechnicalUnit? ItemCategTechnicalUnitory { get; set; }
|
||||
public string ItemUId { get; set; } = "Item-00001";
|
||||
public int Threshold { get; set; }
|
||||
public bool IsActive { get; set; } = true;
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public Guid CreatedById { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("CreatedById")]
|
||||
public Employee? CreatedBy { get; set; }
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
public Guid? UpdatedById { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("UpdatedById")]
|
||||
public Employee? UpdatedBy { get; set; }
|
||||
}
|
||||
}
|
||||
12
Marco.Pms.Model/Inventory/ItemCategoryMaster.cs
Normal file
12
Marco.Pms.Model/Inventory/ItemCategoryMaster.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using Marco.Pms.Model.Utilities;
|
||||
|
||||
namespace Marco.Pms.Model.Inventory
|
||||
{
|
||||
public class ItemCategoryMaster : TenantRelation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
public string Description { get; set; } = default!;
|
||||
public bool IsActive { get; set; } = true;
|
||||
}
|
||||
}
|
||||
18
Marco.Pms.Model/Inventory/ItemGroupMaster.cs
Normal file
18
Marco.Pms.Model/Inventory/ItemGroupMaster.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Marco.Pms.Model.Inventory
|
||||
{
|
||||
public class ItemGroupMaster
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
public string Description { get; set; } = default!;
|
||||
public bool IsActive { get; set; } = true;
|
||||
public Guid ItemCategoryId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("ItemCategoryId")]
|
||||
public ItemCategoryMaster? ItemCategory { get; set; }
|
||||
}
|
||||
}
|
||||
23
Marco.Pms.Model/Inventory/ItemManufacturerMapping.cs
Normal file
23
Marco.Pms.Model/Inventory/ItemManufacturerMapping.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using Marco.Pms.Model.Master;
|
||||
using Marco.Pms.Model.Utilities;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Marco.Pms.Model.Inventory
|
||||
{
|
||||
public class ItemManufacturerMapping : TenantRelation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid ItemId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("ItemId")]
|
||||
public Item? Item { get; set; }
|
||||
public Guid ManufacturerId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("ManufacturerId")]
|
||||
public Manufacturer? Manufacturer { get; set; }
|
||||
public bool IsActive { get; set; } = true;
|
||||
}
|
||||
}
|
||||
30
Marco.Pms.Model/Inventory/ItemSupplierMapping.cs
Normal file
30
Marco.Pms.Model/Inventory/ItemSupplierMapping.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using Marco.Pms.Model.Master;
|
||||
using Marco.Pms.Model.Utilities;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Marco.Pms.Model.Inventory
|
||||
{
|
||||
public class ItemSupplierMapping : TenantRelation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid ItemManufacturerMappingId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("ItemManufacturerMappingId")]
|
||||
public ItemManufacturerMapping? ItemManufacturerMapping { get; set; }
|
||||
public Guid SupplierId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("SupplierId")]
|
||||
public Supplier? Supplier { get; set; }
|
||||
public double BasePrice { get; set; }
|
||||
public int PurchaseLeadTime { get; set; }
|
||||
public Guid CurrencyId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("CurrencyId")]
|
||||
public CurrencyMaster? Currency { get; set; }
|
||||
public bool IsActive { get; set; } = true;
|
||||
}
|
||||
}
|
||||
24
Marco.Pms.Model/Inventory/ItemTaxTypeMapping.cs
Normal file
24
Marco.Pms.Model/Inventory/ItemTaxTypeMapping.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using Marco.Pms.Model.Master;
|
||||
using Marco.Pms.Model.Utilities;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Marco.Pms.Model.Inventory
|
||||
{
|
||||
public class ItemTaxTypeMapping : TenantRelation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid ItemId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("ItemId")]
|
||||
public Item? Item { get; set; }
|
||||
public Guid ServicesTaxTypeId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("ServicesTaxTypeId")]
|
||||
public ServicesTaxType? ServicesTaxType { get; set; }
|
||||
public int Rate { get; set; }
|
||||
public bool IsActive { get; set; } = true;
|
||||
}
|
||||
}
|
||||
50
Marco.Pms.Model/Inventory/PurchaseOrder.cs
Normal file
50
Marco.Pms.Model/Inventory/PurchaseOrder.cs
Normal file
@ -0,0 +1,50 @@
|
||||
using Marco.Pms.Model.Employees;
|
||||
using Marco.Pms.Model.Projects;
|
||||
using Marco.Pms.Model.Utilities;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Marco.Pms.Model.Inventory
|
||||
{
|
||||
public class PurchaseOrder : TenantRelation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid ItemSupplierMappingId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("ItemSupplierMappingId")]
|
||||
public ItemSupplierMapping? ItemSupplierMapping { get; set; }
|
||||
public Guid ProjectId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("ProjectId")]
|
||||
public Project? Project { get; set; }
|
||||
public Guid RequisitionBatchId { get; set; }
|
||||
public int NumberOfItems { get; set; }
|
||||
public double PricePerItem { get; set; }
|
||||
public double TotalBasePrice { get; set; }
|
||||
public double TotalTaxPrice { get; set; }
|
||||
public double TotalDiscountPrice { get; set; }
|
||||
public double TotalPrice { get; set; }
|
||||
public Guid PurchaseOrderStatusId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("PurchaseOrderStatusId")]
|
||||
public PurchaseOrderStatus? PurchaseOrderStatus { get; set; }
|
||||
public Guid BatchId { get; set; }
|
||||
public string PurchaseOrderUId { get; set; } = "PO-00001";
|
||||
public bool IsActive { get; set; } = true;
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public Guid CreatedById { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("CreatedById")]
|
||||
public Employee? CreatedBy { get; set; }
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
public Guid? UpdatedById { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("UpdatedById")]
|
||||
public Employee? UpdatedBy { get; set; }
|
||||
}
|
||||
}
|
||||
12
Marco.Pms.Model/Inventory/PurchaseOrderStatus.cs
Normal file
12
Marco.Pms.Model/Inventory/PurchaseOrderStatus.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using Marco.Pms.Model.Utilities;
|
||||
|
||||
namespace Marco.Pms.Model.Inventory
|
||||
{
|
||||
public class PurchaseOrderStatus : TenantRelation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
public string Description { get; set; } = default!;
|
||||
public bool IsActive { get; set; } = true;
|
||||
}
|
||||
}
|
||||
29
Marco.Pms.Model/Inventory/PurchaseOrderStatusLogs.cs
Normal file
29
Marco.Pms.Model/Inventory/PurchaseOrderStatusLogs.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using Marco.Pms.Model.Employees;
|
||||
using Marco.Pms.Model.Utilities;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Marco.Pms.Model.Inventory
|
||||
{
|
||||
public class PurchaseOrderStatusLogs : TenantRelation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid PreviousPurchaseStatusId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("PreviousPurchaseStatusId")]
|
||||
public PurchaseOrderStatus? PreviousPurchaseStatus { get; set; }
|
||||
public string? Comment { get; set; }
|
||||
public Guid PurchaseStatusId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("PurchaseStatusId")]
|
||||
public PurchaseOrderStatus? PurchaseStatus { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
public Guid UpdatedById { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("UpdatedById")]
|
||||
public Employee? UpdatedBy { get; set; }
|
||||
}
|
||||
}
|
||||
22
Marco.Pms.Model/Inventory/PurchaseStatusEmployeeMapping.cs
Normal file
22
Marco.Pms.Model/Inventory/PurchaseStatusEmployeeMapping.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using Marco.Pms.Model.Employees;
|
||||
using Marco.Pms.Model.Utilities;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Marco.Pms.Model.Inventory
|
||||
{
|
||||
public class PurchaseStatusEmployeeMapping : TenantRelation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid PurchaseOrderStatusId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("PurchaseOrderStatusId")]
|
||||
public PurchaseOrderStatus? PurchaseOrderStatus { get; set; }
|
||||
public Guid EmployeeId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("EmployeeId")]
|
||||
public Employee? Employee { get; set; }
|
||||
}
|
||||
}
|
||||
26
Marco.Pms.Model/Inventory/PurchaseStatusMapping.cs
Normal file
26
Marco.Pms.Model/Inventory/PurchaseStatusMapping.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using Marco.Pms.Model.Utilities;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Marco.Pms.Model.Inventory
|
||||
{
|
||||
public class PurchaseStatusMapping : TenantRelation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid PreviousPurchaseStatusId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("PreviousPurchaseStatusId")]
|
||||
public PurchaseOrderStatus? PreviousPurchaseStatus { get; set; }
|
||||
public Guid PurchaseStatusId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("PurchaseStatusId")]
|
||||
public PurchaseOrderStatus? PurchaseStatus { get; set; }
|
||||
public Guid NextPurchaseStatusId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("NextPurchaseStatusId")]
|
||||
public PurchaseOrderStatus? NextPurchaseStatus { get; set; }
|
||||
}
|
||||
}
|
||||
44
Marco.Pms.Model/Inventory/Requisition.cs
Normal file
44
Marco.Pms.Model/Inventory/Requisition.cs
Normal file
@ -0,0 +1,44 @@
|
||||
using Marco.Pms.Model.Employees;
|
||||
using Marco.Pms.Model.Projects;
|
||||
using Marco.Pms.Model.Utilities;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Marco.Pms.Model.Inventory
|
||||
{
|
||||
public class Requisition : TenantRelation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid ItemId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("ItemId")]
|
||||
public Item? Item { get; set; }
|
||||
public Guid ProjectId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("ProjectId")]
|
||||
public Project? Project { get; set; }
|
||||
public Guid BatchId { get; set; }
|
||||
public int NumberOfItems { get; set; }
|
||||
public Guid RequisitionStatusId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("RequisitionStatusId")]
|
||||
public RequisitionStatus? RequisitionStatus { get; set; }
|
||||
public string RequisitionUId { get; set; } = "Requisition-00001";
|
||||
public bool IsActive { get; set; } = true;
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public Guid CreatedById { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("CreatedById")]
|
||||
public Employee? CreatedBy { get; set; }
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
public Guid? UpdatedById { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("UpdatedById")]
|
||||
public Employee? UpdatedBy { get; set; }
|
||||
}
|
||||
}
|
||||
12
Marco.Pms.Model/Inventory/RequisitionStatus.cs
Normal file
12
Marco.Pms.Model/Inventory/RequisitionStatus.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using Marco.Pms.Model.Utilities;
|
||||
|
||||
namespace Marco.Pms.Model.Inventory
|
||||
{
|
||||
public class RequisitionStatus : TenantRelation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
public string Description { get; set; } = default!;
|
||||
public bool IsActive { get; set; } = true;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
using Marco.Pms.Model.Employees;
|
||||
using Marco.Pms.Model.Utilities;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Marco.Pms.Model.Inventory
|
||||
{
|
||||
public class RequisitionStatusEmployeeMapping : TenantRelation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid RequisitionStatusId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("RequisitionStatusId")]
|
||||
public RequisitionStatus? RequisitionStatus { get; set; }
|
||||
public Guid EmployeeId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("EmployeeId")]
|
||||
public Employee? Employee { get; set; }
|
||||
}
|
||||
}
|
||||
29
Marco.Pms.Model/Inventory/RequisitionStatusLogs.cs
Normal file
29
Marco.Pms.Model/Inventory/RequisitionStatusLogs.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using Marco.Pms.Model.Employees;
|
||||
using Marco.Pms.Model.Utilities;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Marco.Pms.Model.Inventory
|
||||
{
|
||||
public class RequisitionStatusLogs : TenantRelation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid PreviousRequisitionStatusId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("PreviousRequisitionStatusId")]
|
||||
public PurchaseOrderStatus? PreviousRequisitionStatus { get; set; }
|
||||
public string? Comment { get; set; }
|
||||
public Guid RequisitionStatusId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("RequisitionStatusId")]
|
||||
public RequisitionStatus? RequisitionStatus { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
public Guid UpdatedById { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("UpdatedById")]
|
||||
public Employee? UpdatedBy { get; set; }
|
||||
}
|
||||
}
|
||||
26
Marco.Pms.Model/Inventory/RequisitionStatusMapping.cs
Normal file
26
Marco.Pms.Model/Inventory/RequisitionStatusMapping.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using Marco.Pms.Model.Utilities;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Marco.Pms.Model.Inventory
|
||||
{
|
||||
public class RequisitionStatusMapping : TenantRelation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid PreviousRequisitionStatusId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("PreviousRequisitionStatusId")]
|
||||
public RequisitionStatus? PreviousRequisitionStatus { get; set; }
|
||||
public Guid RequisitionStatusId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("RequisitionStatusId")]
|
||||
public RequisitionStatus? RequisitionStatus { get; set; }
|
||||
public Guid NextRequisitionStatusId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("NextRequisitionStatusId")]
|
||||
public RequisitionStatus? NextRequisitionStatus { get; set; }
|
||||
}
|
||||
}
|
||||
31
Marco.Pms.Model/Inventory/Supplier.cs
Normal file
31
Marco.Pms.Model/Inventory/Supplier.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using Marco.Pms.Model.Employees;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Marco.Pms.Model.Inventory
|
||||
{
|
||||
public class Supplier
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
public string? Email { get; set; }
|
||||
public string SupplierGroup { get; set; } = default!;
|
||||
public string BankName { get; set; } = default!;
|
||||
public string AccountNumber { get; set; } = default!;
|
||||
public string IFSC { get; set; } = default!;
|
||||
public string SupplierUId { get; set; } = "Supplier-00001";
|
||||
public bool IsActive { get; set; } = true;
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public Guid CreatedById { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("CreatedById")]
|
||||
public Employee? CreatedBy { get; set; }
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
public Guid? UpdatedById { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("UpdatedById")]
|
||||
public Employee? UpdatedBy { get; set; }
|
||||
}
|
||||
}
|
||||
29
Marco.Pms.Model/Inventory/SupplierStateMapping.cs
Normal file
29
Marco.Pms.Model/Inventory/SupplierStateMapping.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using Marco.Pms.Model.Master;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Marco.Pms.Model.Inventory
|
||||
{
|
||||
public class SupplierStateMapping
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid StateId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("StateId")]
|
||||
public StateMaster? State { get; set; }
|
||||
public string Street { get; set; } = default!;
|
||||
public string CityName { get; set; } = default!;
|
||||
public string PinCode { get; set; } = default!;
|
||||
public string Country { get; set; } = default!;
|
||||
public string GSTNumber { get; set; } = default!;
|
||||
public string ContactPerson { get; set; } = default!;
|
||||
public string ContactEmail { get; set; } = default!;
|
||||
public string ContactPhone { get; set; } = default!;
|
||||
public Guid SupplierId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("SupplierId")]
|
||||
public Supplier? Supplier { get; set; }
|
||||
}
|
||||
}
|
||||
8
Marco.Pms.Model/Master/Manufacturer.cs
Normal file
8
Marco.Pms.Model/Master/Manufacturer.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace Marco.Pms.Model.Master
|
||||
{
|
||||
public class Manufacturer
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
9
Marco.Pms.Model/Master/ServicesTaxType.cs
Normal file
9
Marco.Pms.Model/Master/ServicesTaxType.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace Marco.Pms.Model.Master
|
||||
{
|
||||
public class ServicesTaxType
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
public string Description { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
9
Marco.Pms.Model/Master/StateMaster.cs
Normal file
9
Marco.Pms.Model/Master/StateMaster.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace Marco.Pms.Model.Master
|
||||
{
|
||||
public class StateMaster
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
public string StateCode { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
8
Marco.Pms.Model/Master/TaxSlabMaster.cs
Normal file
8
Marco.Pms.Model/Master/TaxSlabMaster.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace Marco.Pms.Model.Master
|
||||
{
|
||||
public class TaxSlabMaster
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public int Percentage { get; set; }
|
||||
}
|
||||
}
|
||||
17
Marco.Pms.Model/Master/TechnicalUnit.cs
Normal file
17
Marco.Pms.Model/Master/TechnicalUnit.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Marco.Pms.Model.Master
|
||||
{
|
||||
public class TechnicalUnit
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
public string Description { get; set; } = default!;
|
||||
public Guid UnitTypeId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("UnitTypeId")]
|
||||
public UnitType? UnitType { get; set; }
|
||||
}
|
||||
}
|
||||
9
Marco.Pms.Model/Master/UnitType.cs
Normal file
9
Marco.Pms.Model/Master/UnitType.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace Marco.Pms.Model.Master
|
||||
{
|
||||
public class UnitType
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
public string Description { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
namespace Marco.Pms.Model.ViewModels.Inventory
|
||||
{
|
||||
public class PurchaseOrderStatusDetailsVM
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public List<PurchaseOrderStatusVM>? PreviousPurchaseStatus { get; set; }
|
||||
public List<PurchaseOrderStatusVM>? NextPurchaseStatus { get; set; }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
namespace Marco.Pms.Model.ViewModels.Inventory
|
||||
{
|
||||
public class PurchaseOrderStatusVM
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
namespace Marco.Pms.Model.ViewModels.Inventory
|
||||
{
|
||||
public class RequisitionStatusDetailsVM
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public List<RequisitionStatusVM>? PreviousRequisitionStatus { get; set; }
|
||||
public List<RequisitionStatusVM>? NextRequisitionStatus { get; set; }
|
||||
}
|
||||
}
|
||||
10
Marco.Pms.Model/ViewModels/Inventory/RequisitionStatusVM.cs
Normal file
10
Marco.Pms.Model/ViewModels/Inventory/RequisitionStatusVM.cs
Normal file
@ -0,0 +1,10 @@
|
||||
namespace Marco.Pms.Model.ViewModels.Inventory
|
||||
{
|
||||
public class RequisitionStatusVM
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
}
|
||||
}
|
||||
@ -2,6 +2,7 @@
|
||||
using Marco.Pms.Model.Dtos.Activities;
|
||||
using Marco.Pms.Model.Dtos.Collection;
|
||||
using Marco.Pms.Model.Dtos.DocumentManager;
|
||||
using Marco.Pms.Model.Dtos.Inventory;
|
||||
using Marco.Pms.Model.Dtos.Master;
|
||||
using Marco.Pms.Model.Forum;
|
||||
using Marco.Pms.Model.Mapper;
|
||||
@ -977,6 +978,94 @@ namespace Marco.Pms.Services.Controllers
|
||||
|
||||
#endregion
|
||||
|
||||
#region =================================================================== Requisition Status APIs ===================================================================
|
||||
|
||||
[HttpGet("requisition-status/list")]
|
||||
public async Task<IActionResult> GetRequisitionStatusList([FromQuery] bool isActive = true)
|
||||
{
|
||||
var loggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
||||
var response = await _masterService.GetRequisitionStatusListAsync(isActive, loggedInEmployee, tenantId);
|
||||
return StatusCode(response.StatusCode, response);
|
||||
}
|
||||
|
||||
[HttpGet("requisition-status/details/{id}")]
|
||||
public async Task<IActionResult> GetRequisitionStatusDetails(Guid id)
|
||||
{
|
||||
var loggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
||||
var response = await _masterService.GetRequisitionStatusDetailsAsync(id, loggedInEmployee, tenantId);
|
||||
return StatusCode(response.StatusCode, response);
|
||||
}
|
||||
|
||||
[HttpPost("requisition-status/create")]
|
||||
public async Task<IActionResult> CreateRequisitionStatus([FromForm] RequisitionStatusDto model)
|
||||
{
|
||||
var loggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
||||
var response = await _masterService.CreateRequisitionStatusAsync(model, loggedInEmployee, tenantId);
|
||||
return StatusCode(response.StatusCode, response);
|
||||
}
|
||||
|
||||
[HttpPut("requisition-status/edit/{id}")]
|
||||
public async Task<IActionResult> UpdateRequisitionStatus(Guid id, [FromForm] RequisitionStatusDto model)
|
||||
{
|
||||
var loggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
||||
var response = await _masterService.UpdateRequisitionStatusAsync(id, model, loggedInEmployee, tenantId);
|
||||
return StatusCode(response.StatusCode, response);
|
||||
}
|
||||
|
||||
[HttpGet("requisition-status/delete/{id}")]
|
||||
public async Task<IActionResult> DeleteRequisitionStatus(Guid id, [FromQuery] bool isActive = true)
|
||||
{
|
||||
var loggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
||||
var response = await _masterService.DeleteRequisitionStatusAsync(id, isActive, loggedInEmployee, tenantId);
|
||||
return StatusCode(response.StatusCode, response);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region =================================================================== Purchase Order Status APIs ===================================================================
|
||||
|
||||
[HttpGet("purchase-order-status/list")]
|
||||
public async Task<IActionResult> GetPurchaseOrderStatusList([FromQuery] bool isActive = true)
|
||||
{
|
||||
var loggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
||||
var response = await _masterService.GetPurchaseOrderStatusListAsync(isActive, loggedInEmployee, tenantId);
|
||||
return StatusCode(response.StatusCode, response);
|
||||
}
|
||||
|
||||
[HttpGet("purchase-order-status/details/{id}")]
|
||||
public async Task<IActionResult> GetPurchaseOrderStatusDetails(Guid id)
|
||||
{
|
||||
var loggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
||||
var response = await _masterService.GetPurchaseOrderStatusDetailsAsync(id, loggedInEmployee, tenantId);
|
||||
return StatusCode(response.StatusCode, response);
|
||||
}
|
||||
|
||||
[HttpPost("purchase-order-status/create")]
|
||||
public async Task<IActionResult> CreatePurchaseOrderStatus([FromForm] PurchaseOrderStatusDto model)
|
||||
{
|
||||
var loggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
||||
var response = await _masterService.CreatePurchaseOrderStatusAsync(model, loggedInEmployee, tenantId);
|
||||
return StatusCode(response.StatusCode, response);
|
||||
}
|
||||
|
||||
[HttpPut("purchase-order-status/edit/{id}")]
|
||||
public async Task<IActionResult> UpdatePurchaseOrderStatus(Guid id, [FromForm] PurchaseOrderStatusDto model)
|
||||
{
|
||||
var loggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
||||
var response = await _masterService.UpdatePurchaseOrderStatusAsync(id, model, loggedInEmployee, tenantId);
|
||||
return StatusCode(response.StatusCode, response);
|
||||
}
|
||||
|
||||
[HttpGet("purchase-order-status/delete/{id}")]
|
||||
public async Task<IActionResult> DeletePurchaseOrderStatus(Guid id, [FromQuery] bool isActive = true)
|
||||
{
|
||||
var loggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
||||
var response = await _masterService.DeletePurchaseOrderStatusAsync(id, isActive, loggedInEmployee, tenantId);
|
||||
return StatusCode(response.StatusCode, response);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region =================================================================== Payment Adjustment Head APIs ===================================================================
|
||||
[HttpGet("payment-adjustment-head/list")]
|
||||
public async Task<IActionResult> GetpaymentAdjustmentHeadsList([FromQuery] bool isActive = true)
|
||||
|
||||
@ -7,15 +7,18 @@ using Marco.Pms.Model.DocumentManager;
|
||||
using Marco.Pms.Model.Dtos.Activities;
|
||||
using Marco.Pms.Model.Dtos.Collection;
|
||||
using Marco.Pms.Model.Dtos.DocumentManager;
|
||||
using Marco.Pms.Model.Dtos.Inventory;
|
||||
using Marco.Pms.Model.Dtos.Master;
|
||||
using Marco.Pms.Model.Employees;
|
||||
using Marco.Pms.Model.Entitlements;
|
||||
using Marco.Pms.Model.Inventory;
|
||||
using Marco.Pms.Model.Master;
|
||||
using Marco.Pms.Model.MongoDBModels.Utility;
|
||||
using Marco.Pms.Model.Utilities;
|
||||
using Marco.Pms.Model.ViewModels.Activities;
|
||||
using Marco.Pms.Model.ViewModels.Collection;
|
||||
using Marco.Pms.Model.ViewModels.DocumentManager;
|
||||
using Marco.Pms.Model.ViewModels.Inventory;
|
||||
using Marco.Pms.Model.ViewModels.Master;
|
||||
using Marco.Pms.Services.Service.ServiceInterfaces;
|
||||
using MarcoBMS.Services.Service;
|
||||
@ -3124,6 +3127,458 @@ namespace Marco.Pms.Services.Service
|
||||
|
||||
#endregion
|
||||
|
||||
#region =================================================================== Requisition Status APIs ===================================================================
|
||||
|
||||
public async Task<ApiResponse<object>> GetRequisitionStatusListAsync(bool isActive, Employee loggedInEmployee, Guid tenantId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var requisitionStatusList = await _context.RequisitionStatus.Where(rs => rs.TenantId == tenantId && rs.IsActive == isActive).ToListAsync();
|
||||
|
||||
var reponse = _mapper.Map<List<RequisitionStatusVM>>(requisitionStatusList);
|
||||
|
||||
return ApiResponse<object>.SuccessResponse(reponse, $"{reponse.Count} records are fetched successfully Requisition Status", 200);
|
||||
}
|
||||
catch (DbUpdateException dbEx)
|
||||
{
|
||||
_logger.LogError(dbEx, "Database Exception occured while fetching list of Requisition Status by employee {EmployeeId}", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(dbEx), 500);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Exception occured while fetching list of Requisition Status by employee {EmployeeId}", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(ex), 500);
|
||||
}
|
||||
}
|
||||
public async Task<ApiResponse<object>> GetRequisitionStatusDetailsAsync(Guid id, Employee loggedInEmployee, Guid tenantId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var requisitionStatus = await _context.RequisitionStatus.FirstOrDefaultAsync(rs => rs.Id == id && rs.TenantId == tenantId);
|
||||
if (requisitionStatus == null)
|
||||
{
|
||||
_logger.LogWarning("Requisition Status {RequisitionStatusId} not found in database for tenant {TenantId}", id, tenantId);
|
||||
return ApiResponse<object>.ErrorResponse("Requisition Status not found", "Requisition Status not found in database for current tenant", 404);
|
||||
}
|
||||
var purchaseOrderStatusMapping = await _context.RequisitionStatusMappings
|
||||
.Include(rsm => rsm.NextRequisitionStatus)
|
||||
.Include(rsm => rsm.PreviousRequisitionStatus)
|
||||
.Where(rsm => rsm.RequisitionStatusId == id &&
|
||||
rsm.NextRequisitionStatus != null &&
|
||||
rsm.PreviousRequisitionStatus != null &&
|
||||
rsm.TenantId == tenantId)
|
||||
.ToListAsync();
|
||||
|
||||
var previousRequisitionStatus = purchaseOrderStatusMapping.Select(rsm => _mapper.Map<RequisitionStatusVM>(rsm.PreviousRequisitionStatus)).ToList();
|
||||
var nextRequisitionStatus = purchaseOrderStatusMapping.Select(rsm => _mapper.Map<RequisitionStatusVM>(rsm.NextRequisitionStatus)).ToList();
|
||||
|
||||
var reponse = new RequisitionStatusDetailsVM
|
||||
{
|
||||
Id = requisitionStatus.Id,
|
||||
Name = requisitionStatus.Name,
|
||||
Description = requisitionStatus.Description,
|
||||
IsActive = requisitionStatus.IsActive,
|
||||
PreviousRequisitionStatus = previousRequisitionStatus,
|
||||
NextRequisitionStatus = nextRequisitionStatus
|
||||
};
|
||||
return ApiResponse<object>.SuccessResponse(reponse, "Requisition Status details fetched successfully", 200);
|
||||
}
|
||||
catch (DbUpdateException dbEx)
|
||||
{
|
||||
_logger.LogError(dbEx, "Database Exception occured while adding new Requisition Status by employee {EmployeeId}", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(dbEx), 500);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Exception occured while adding new Requisition Status by employee {EmployeeId}", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(ex), 500);
|
||||
}
|
||||
}
|
||||
public async Task<ApiResponse<object>> CreateRequisitionStatusAsync(RequisitionStatusDto model, Employee loggedInEmployee, Guid tenantId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var hasManagePermission = await _permission.HasPermission(PermissionsMaster.ManageMasters, loggedInEmployee.Id);
|
||||
if (!hasManagePermission)
|
||||
{
|
||||
_logger.LogWarning("Access DENIED for employee {EmployeeId} for managing REQUISITION STATUS.", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Access Denied.", "You do not have permission to Manage masters", 403);
|
||||
}
|
||||
|
||||
var requisitionStatusExists = await _context.RequisitionStatus.AnyAsync(rs => rs.Name == model.Name && rs.TenantId == tenantId);
|
||||
if (requisitionStatusExists)
|
||||
{
|
||||
_logger.LogWarning("Requisition Status of name {Name} already existed in database", model.Name);
|
||||
return ApiResponse<object>.ErrorResponse("Requisition Status of same name already exists", "Requisition Status of same name already exists", 409);
|
||||
}
|
||||
var requisitionStatus = _mapper.Map<RequisitionStatus>(model);
|
||||
requisitionStatus.IsActive = true;
|
||||
requisitionStatus.TenantId = tenantId;
|
||||
|
||||
_context.RequisitionStatus.Add(requisitionStatus);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
var response = _mapper.Map<RequisitionStatusVM>(requisitionStatus);
|
||||
|
||||
return ApiResponse<object>.SuccessResponse(response, "Successfully updated Requisition Status", 200);
|
||||
}
|
||||
catch (DbUpdateException dbEx)
|
||||
{
|
||||
_logger.LogError(dbEx, "Database Exception occured while adding new Requisition Status by employee {EmployeeId}", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(dbEx), 500);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Exception occured while adding new Requisition Status by employee {EmployeeId}", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(ex), 500);
|
||||
}
|
||||
|
||||
}
|
||||
public async Task<ApiResponse<object>> UpdateRequisitionStatusAsync(Guid id, RequisitionStatusDto model, Employee loggedInEmployee, Guid tenantId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var hasManagePermission = await _permission.HasPermission(PermissionsMaster.ManageMasters, loggedInEmployee.Id);
|
||||
if (!hasManagePermission)
|
||||
{
|
||||
_logger.LogWarning("Access DENIED for employee {EmployeeId} for managing REQUISITION STATUS.", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Access Denied.", "You do not have permission to Manage masters", 403);
|
||||
}
|
||||
|
||||
var requisitionStatusExists = await _context.RequisitionStatus.AnyAsync(pos => pos.Id != id && pos.Name == model.Name && pos.TenantId == tenantId);
|
||||
if (requisitionStatusExists)
|
||||
{
|
||||
_logger.LogWarning("Requisition Status of name {Name} already existed in database", model.Name);
|
||||
return ApiResponse<object>.ErrorResponse("Requisition Status of same name already exists", "Requisition Status of same name already exists", 409);
|
||||
}
|
||||
|
||||
if (model.Id.HasValue && model.Id == id)
|
||||
{
|
||||
_logger.LogWarning("User provided invalid information while updating Requisition Status");
|
||||
return ApiResponse<object>.ErrorResponse("Invalid information", "User provided invalid information", 400);
|
||||
}
|
||||
|
||||
var existingRequisitionStatus = await _context.RequisitionStatus.FirstOrDefaultAsync(pos => pos.Id == id && pos.TenantId == tenantId);
|
||||
if (existingRequisitionStatus == null)
|
||||
{
|
||||
_logger.LogWarning("Requisition Status {RequisitionStatusId} not found in database for tenant {TenantId}", id, tenantId);
|
||||
return ApiResponse<object>.ErrorResponse("Requisition Status not found", "Requisition Status not found in database for current tenant", 404);
|
||||
}
|
||||
|
||||
var existingEntityBson = _updateLogHelper.EntityToBsonDocument(existingRequisitionStatus);
|
||||
|
||||
_mapper.Map(model, existingRequisitionStatus);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
var response = _mapper.Map<RequisitionStatusVM>(existingRequisitionStatus);
|
||||
|
||||
await _updateLogHelper.PushToUpdateLogsAsync(new UpdateLogsObject
|
||||
{
|
||||
EntityId = existingRequisitionStatus.Id.ToString(),
|
||||
UpdatedById = loggedInEmployee.Id.ToString(),
|
||||
OldObject = existingEntityBson,
|
||||
UpdatedAt = DateTime.UtcNow
|
||||
}, "RequisitionStatusMasterModificationLog");
|
||||
|
||||
return ApiResponse<object>.SuccessResponse(response, "Successfully created the new Requisition Status", 200);
|
||||
}
|
||||
catch (DbUpdateException dbEx)
|
||||
{
|
||||
_logger.LogError(dbEx, "Database Exception occured while updating Requisition Status by employee {EmployeeId}", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(dbEx), 500);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Exception occured while updating Requisition Status by employee {EmployeeId}", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(ex), 500);
|
||||
}
|
||||
}
|
||||
public async Task<ApiResponse<object>> DeleteRequisitionStatusAsync(Guid id, bool active, Employee loggedInEmployee, Guid tenantId)
|
||||
{
|
||||
var message = active ? "restoring" : "deleting";
|
||||
try
|
||||
{
|
||||
var hasManagePermission = await _permission.HasPermission(PermissionsMaster.ManageMasters, loggedInEmployee.Id);
|
||||
if (!hasManagePermission)
|
||||
{
|
||||
_logger.LogWarning("Access DENIED for employee {EmployeeId} for managing REQUISITION STATUS.", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Access Denied.", "You do not have permission to Manage masters", 403);
|
||||
}
|
||||
|
||||
var existingRequisitionStatus = await _context.RequisitionStatus.FirstOrDefaultAsync(pos => pos.Id == id && pos.TenantId == tenantId);
|
||||
if (existingRequisitionStatus == null)
|
||||
{
|
||||
_logger.LogWarning("Requisition Status {RequisitionStatusId} not found in database for tenant {TenantId} while {Message} Requisition Status", id, tenantId, message);
|
||||
return ApiResponse<object>.ErrorResponse("Requisition Status not found", "Requisition Status not found in database for current tenant", 404);
|
||||
}
|
||||
|
||||
var requisitionStatusMappingExists = await _context.RequisitionStatusMappings.AnyAsync(psm => psm.PreviousRequisitionStatusId == id || psm.NextRequisitionStatusId == id);
|
||||
if (requisitionStatusMappingExists)
|
||||
{
|
||||
message = active ? "restore" : "delete";
|
||||
_logger.LogWarning("Employee {EmployeeId} tries to {Message} Requisition Status but mapping founded", loggedInEmployee.Id, message);
|
||||
return ApiResponse<object>.ErrorResponse($"Requisition status mapping founded can not be {message}d", $"Requisition status mapping founded can not be {message}d", 400);
|
||||
}
|
||||
|
||||
var existingEntityBson = _updateLogHelper.EntityToBsonDocument(existingRequisitionStatus);
|
||||
|
||||
existingRequisitionStatus.IsActive = active;
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
var response = _mapper.Map<RequisitionStatusVM>(existingRequisitionStatus);
|
||||
|
||||
await _updateLogHelper.PushToUpdateLogsAsync(new UpdateLogsObject
|
||||
{
|
||||
EntityId = existingRequisitionStatus.Id.ToString(),
|
||||
UpdatedById = loggedInEmployee.Id.ToString(),
|
||||
OldObject = existingEntityBson,
|
||||
UpdatedAt = DateTime.UtcNow
|
||||
}, "RequisitionStatusMasterModificationLog");
|
||||
|
||||
message = active ? "restored" : "deleted";
|
||||
return ApiResponse<object>.SuccessResponse(response, $"Successfully {message} Requisition Status", 200);
|
||||
}
|
||||
catch (DbUpdateException dbEx)
|
||||
{
|
||||
_logger.LogError(dbEx, "Database Exception occured while {Message} Requisition Status by employee {EmployeeId}", message, loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(dbEx), 500);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Exception occured while {Message} Requisition Status by employee {EmployeeId}", message, loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(ex), 500);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region =================================================================== Purchase Order Status APIs ===================================================================
|
||||
|
||||
public async Task<ApiResponse<object>> GetPurchaseOrderStatusListAsync(bool isActive, Employee loggedInEmployee, Guid tenantId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var purchaseOrderStatusList = await _context.PurchaseOrderStatus.Where(pos => pos.TenantId == tenantId && pos.IsActive == isActive).ToListAsync();
|
||||
|
||||
var reponse = _mapper.Map<List<PurchaseOrderStatusVM>>(purchaseOrderStatusList);
|
||||
|
||||
return ApiResponse<object>.SuccessResponse(reponse, $"{reponse.Count} records are fetched successfully Purchase Order Status", 200);
|
||||
}
|
||||
catch (DbUpdateException dbEx)
|
||||
{
|
||||
_logger.LogError(dbEx, "Database Exception occured while fetching list of Purchase Order Status by employee {EmployeeId}", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(dbEx), 500);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Exception occured while fetching list of Purchase Order Status by employee {EmployeeId}", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(ex), 500);
|
||||
}
|
||||
}
|
||||
public async Task<ApiResponse<object>> GetPurchaseOrderStatusDetailsAsync(Guid id, Employee loggedInEmployee, Guid tenantId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var purchaseOrderStatus = await _context.PurchaseOrderStatus.FirstOrDefaultAsync(pos => pos.Id == id && pos.TenantId == tenantId);
|
||||
if (purchaseOrderStatus == null)
|
||||
{
|
||||
_logger.LogWarning("Purchase Order Status {PurchaseOrderStatusId} not found in database for tenant {TenantId}", id, tenantId);
|
||||
return ApiResponse<object>.ErrorResponse("Purchase Order Status not found", "Purchase Order Status not found in database for current tenant", 404);
|
||||
}
|
||||
var purchaseOrderStatusMapping = await _context.PurchaseStatusMappings
|
||||
.Include(psm => psm.NextPurchaseStatus)
|
||||
.Include(psm => psm.PreviousPurchaseStatus)
|
||||
.Where(psm => psm.PurchaseStatusId == id &&
|
||||
psm.NextPurchaseStatus != null &&
|
||||
psm.PreviousPurchaseStatus != null &&
|
||||
psm.TenantId == tenantId)
|
||||
.ToListAsync();
|
||||
|
||||
var previousPurchaseStatus = purchaseOrderStatusMapping.Select(psm => _mapper.Map<PurchaseOrderStatusVM>(psm.PreviousPurchaseStatus)).ToList();
|
||||
var nextPurchaseStatus = purchaseOrderStatusMapping.Select(psm => _mapper.Map<PurchaseOrderStatusVM>(psm.NextPurchaseStatus)).ToList();
|
||||
|
||||
var reponse = new PurchaseOrderStatusDetailsVM
|
||||
{
|
||||
Id = purchaseOrderStatus.Id,
|
||||
Name = purchaseOrderStatus.Name,
|
||||
Description = purchaseOrderStatus.Description,
|
||||
IsActive = purchaseOrderStatus.IsActive,
|
||||
PreviousPurchaseStatus = previousPurchaseStatus,
|
||||
NextPurchaseStatus = nextPurchaseStatus
|
||||
};
|
||||
return ApiResponse<object>.SuccessResponse(reponse, "Purchase Order Status details fetched successfully", 200);
|
||||
}
|
||||
catch (DbUpdateException dbEx)
|
||||
{
|
||||
_logger.LogError(dbEx, "Database Exception occured while adding new Purchase Order Status by employee {EmployeeId}", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(dbEx), 500);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Exception occured while adding new Purchase Order Status by employee {EmployeeId}", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(ex), 500);
|
||||
}
|
||||
}
|
||||
public async Task<ApiResponse<object>> CreatePurchaseOrderStatusAsync(PurchaseOrderStatusDto model, Employee loggedInEmployee, Guid tenantId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var hasManagePermission = await _permission.HasPermission(PermissionsMaster.ManageMasters, loggedInEmployee.Id);
|
||||
if (!hasManagePermission)
|
||||
{
|
||||
_logger.LogWarning("Access DENIED for employee {EmployeeId} for managing PURCHASE ORDER STATUS.", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Access Denied.", "You do not have permission to Manage masters", 403);
|
||||
}
|
||||
|
||||
var purchaseOrderStatusExists = await _context.PurchaseOrderStatus.AnyAsync(pos => pos.Name == model.Name && pos.TenantId == tenantId);
|
||||
if (purchaseOrderStatusExists)
|
||||
{
|
||||
_logger.LogWarning("Purchase Order Status of name {Name} already existed in database", model.Name);
|
||||
return ApiResponse<object>.ErrorResponse("Purchase Order Status of same name already exists", "Purchase Order Status of same name already exists", 409);
|
||||
}
|
||||
var purchaseOrderStatus = _mapper.Map<PurchaseOrderStatus>(model);
|
||||
purchaseOrderStatus.IsActive = true;
|
||||
purchaseOrderStatus.TenantId = tenantId;
|
||||
|
||||
_context.PurchaseOrderStatus.Add(purchaseOrderStatus);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
var response = _mapper.Map<PurchaseOrderStatusVM>(purchaseOrderStatus);
|
||||
|
||||
return ApiResponse<object>.SuccessResponse(response, "Successfully updated Purchase Order Status", 200);
|
||||
}
|
||||
catch (DbUpdateException dbEx)
|
||||
{
|
||||
_logger.LogError(dbEx, "Database Exception occured while adding new Purchase Order Status by employee {EmployeeId}", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(dbEx), 500);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Exception occured while adding new Purchase Order Status by employee {EmployeeId}", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(ex), 500);
|
||||
}
|
||||
|
||||
}
|
||||
public async Task<ApiResponse<object>> UpdatePurchaseOrderStatusAsync(Guid id, PurchaseOrderStatusDto model, Employee loggedInEmployee, Guid tenantId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var hasManagePermission = await _permission.HasPermission(PermissionsMaster.ManageMasters, loggedInEmployee.Id);
|
||||
if (!hasManagePermission)
|
||||
{
|
||||
_logger.LogWarning("Access DENIED for employee {EmployeeId} for managing PURCHASE ORDER STATUS.", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Access Denied.", "You do not have permission to Manage masters", 403);
|
||||
}
|
||||
|
||||
var purchaseOrderStatusExists = await _context.PurchaseOrderStatus.AnyAsync(pos => pos.Id != id && pos.Name == model.Name && pos.TenantId == tenantId);
|
||||
if (purchaseOrderStatusExists)
|
||||
{
|
||||
_logger.LogWarning("Purchase Order Status of name {Name} already existed in database", model.Name);
|
||||
return ApiResponse<object>.ErrorResponse("Purchase Order Status of same name already exists", "Purchase Order Status of same name already exists", 409);
|
||||
}
|
||||
|
||||
if (model.Id.HasValue && model.Id == id)
|
||||
{
|
||||
_logger.LogWarning("User provided invalid information while updating Purchase Order Status");
|
||||
return ApiResponse<object>.ErrorResponse("Invalid information", "User provided invalid information", 400);
|
||||
}
|
||||
|
||||
var existingPurchaseStatus = await _context.PurchaseOrderStatus.AsNoTracking().FirstOrDefaultAsync(pos => pos.Id == id && pos.TenantId == tenantId);
|
||||
if (existingPurchaseStatus == null)
|
||||
{
|
||||
_logger.LogWarning("Purchase Order Status {PurchaseOrderStatusId} not found in database for tenant {TenantId}", id, tenantId);
|
||||
return ApiResponse<object>.ErrorResponse("Purchase Order Status not found", "Purchase Order Status not found in database for current tenant", 404);
|
||||
}
|
||||
|
||||
var existingEntityBson = _updateLogHelper.EntityToBsonDocument(existingPurchaseStatus);
|
||||
|
||||
_mapper.Map(model, existingPurchaseStatus);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
await _updateLogHelper.PushToUpdateLogsAsync(new UpdateLogsObject
|
||||
{
|
||||
EntityId = existingPurchaseStatus.Id.ToString(),
|
||||
UpdatedById = loggedInEmployee.Id.ToString(),
|
||||
OldObject = existingEntityBson,
|
||||
UpdatedAt = DateTime.UtcNow
|
||||
}, "PurchaseOrderStatusMasterModificationLog");
|
||||
|
||||
var response = _mapper.Map<PurchaseOrderStatusVM>(existingPurchaseStatus);
|
||||
|
||||
return ApiResponse<object>.SuccessResponse(response, "Successfully created the new Purchase Order Status", 200);
|
||||
}
|
||||
catch (DbUpdateException dbEx)
|
||||
{
|
||||
_logger.LogError(dbEx, "Database Exception occured while updating Purchase Order Status by employee {EmployeeId}", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(dbEx), 500);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Exception occured while updating Purchase Order Status by employee {EmployeeId}", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(ex), 500);
|
||||
}
|
||||
}
|
||||
public async Task<ApiResponse<object>> DeletePurchaseOrderStatusAsync(Guid id, bool active, Employee loggedInEmployee, Guid tenantId)
|
||||
{
|
||||
var message = active ? "restoring" : "deleting";
|
||||
try
|
||||
{
|
||||
var hasManagePermission = await _permission.HasPermission(PermissionsMaster.ManageMasters, loggedInEmployee.Id);
|
||||
if (!hasManagePermission)
|
||||
{
|
||||
_logger.LogWarning("Access DENIED for employee {EmployeeId} for managing PURCHASE ORDER STATUS.", loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Access Denied.", "You do not have permission to Manage masters", 403);
|
||||
}
|
||||
|
||||
var existingPurchaseStatus = await _context.PurchaseOrderStatus.FirstOrDefaultAsync(pos => pos.Id == id && pos.TenantId == tenantId);
|
||||
if (existingPurchaseStatus == null)
|
||||
{
|
||||
_logger.LogWarning("Purchase Order Status {PurchaseOrderStatusId} not found in database for tenant {TenantId} while {Message} Purchase Order Status", id, tenantId, message);
|
||||
return ApiResponse<object>.ErrorResponse("Purchase Order Status not found", "Purchase Order Status not found in database for current tenant", 404);
|
||||
}
|
||||
|
||||
var purchaseStatusMappingExists = await _context.PurchaseStatusMappings.AnyAsync(psm => psm.PreviousPurchaseStatusId == id || psm.NextPurchaseStatusId == id);
|
||||
if (purchaseStatusMappingExists)
|
||||
{
|
||||
message = active ? "restore" : "delete";
|
||||
_logger.LogWarning("Employee {EmployeeId} tries to {Message} Purchase Order Status but mapping founded", loggedInEmployee.Id, message);
|
||||
return ApiResponse<object>.ErrorResponse($"purchase order status mapping founded can not be {message}d", $"purchase order status mapping founded can not be {message}d", 400);
|
||||
}
|
||||
|
||||
var existingEntityBson = _updateLogHelper.EntityToBsonDocument(existingPurchaseStatus);
|
||||
|
||||
existingPurchaseStatus.IsActive = active;
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
var response = _mapper.Map<PurchaseOrderStatusVM>(existingPurchaseStatus);
|
||||
message = active ? "restored" : "deleted";
|
||||
|
||||
await _updateLogHelper.PushToUpdateLogsAsync(new UpdateLogsObject
|
||||
{
|
||||
EntityId = existingPurchaseStatus.Id.ToString(),
|
||||
UpdatedById = loggedInEmployee.Id.ToString(),
|
||||
OldObject = existingEntityBson,
|
||||
UpdatedAt = DateTime.UtcNow
|
||||
}, "PurchaseOrderStatusMasterModificationLog");
|
||||
|
||||
return ApiResponse<object>.SuccessResponse(response, $"Successfully {message} Purchase Order Status", 200);
|
||||
}
|
||||
catch (DbUpdateException dbEx)
|
||||
{
|
||||
_logger.LogError(dbEx, "Database Exception occured while {Message} Purchase Order Status by employee {EmployeeId}", message, loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(dbEx), 500);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Exception occured while {Message} Purchase Order Status by employee {EmployeeId}", message, loggedInEmployee.Id);
|
||||
return ApiResponse<object>.ErrorResponse("Internal Error occured", ExceptionMapper(ex), 500);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region =================================================================== Helper Function ===================================================================
|
||||
private static object ExceptionMapper(Exception ex)
|
||||
{
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
using Marco.Pms.Model.Dtos.Activities;
|
||||
using Marco.Pms.Model.Dtos.Collection;
|
||||
using Marco.Pms.Model.Dtos.DocumentManager;
|
||||
using Marco.Pms.Model.Dtos.Inventory;
|
||||
using Marco.Pms.Model.Dtos.Master;
|
||||
using Marco.Pms.Model.Employees;
|
||||
using Marco.Pms.Model.Utilities;
|
||||
@ -107,6 +108,22 @@ namespace Marco.Pms.Services.Service.ServiceInterfaces
|
||||
Task<ApiResponse<object>> DeleteDocumentTypeMasterAsync(Guid id, bool isActive, Employee loggedInEmployee, Guid tenantId);
|
||||
#endregion
|
||||
|
||||
#region =================================================================== Requisition Status APIs ===================================================================
|
||||
Task<ApiResponse<object>> GetRequisitionStatusListAsync(bool isActive, Employee loggedInEmployee, Guid tenantId);
|
||||
Task<ApiResponse<object>> GetRequisitionStatusDetailsAsync(Guid id, Employee loggedInEmployee, Guid tenantId);
|
||||
Task<ApiResponse<object>> CreateRequisitionStatusAsync(RequisitionStatusDto model, Employee loggedInEmployee, Guid tenantId);
|
||||
Task<ApiResponse<object>> UpdateRequisitionStatusAsync(Guid id, RequisitionStatusDto model, Employee loggedInEmployee, Guid tenantId);
|
||||
Task<ApiResponse<object>> DeleteRequisitionStatusAsync(Guid id, bool active, Employee loggedInEmployee, Guid tenantId);
|
||||
#endregion
|
||||
|
||||
#region =================================================================== Purchase Order Status APIs ===================================================================
|
||||
Task<ApiResponse<object>> GetPurchaseOrderStatusListAsync(bool isActive, Employee loggedInEmployee, Guid tenantId);
|
||||
Task<ApiResponse<object>> GetPurchaseOrderStatusDetailsAsync(Guid id, Employee loggedInEmployee, Guid tenantId);
|
||||
Task<ApiResponse<object>> CreatePurchaseOrderStatusAsync(PurchaseOrderStatusDto model, Employee loggedInEmployee, Guid tenantId);
|
||||
Task<ApiResponse<object>> UpdatePurchaseOrderStatusAsync(Guid id, PurchaseOrderStatusDto model, Employee loggedInEmployee, Guid tenantId);
|
||||
Task<ApiResponse<object>> DeletePurchaseOrderStatusAsync(Guid id, bool active, Employee loggedInEmployee, Guid tenantId);
|
||||
#endregion
|
||||
|
||||
#region =================================================================== Payment Adjustment Head APIs ===================================================================
|
||||
Task<ApiResponse<object>> GetPaymentAdjustmentHeadListAsync(bool isActive, Employee loggedInEmployee, Guid tenantId);
|
||||
Task<ApiResponse<object>> CreatePaymentAdjustmentHeadAsync(PaymentAdjustmentHeadDto model, Employee loggedInEmployee, Guid tenantId);
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"Title": "Dev"
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnectionString": "Server=147.93.98.152;User ID=devuser;Password=AppUser@123$;Database=MarcoBMS1"
|
||||
"DefaultConnectionString": "Server=147.93.98.152;User ID=devuser;Password=AppUser@123$;Database=MarcoBMSInventory"
|
||||
},
|
||||
"SmtpSettings": {
|
||||
"SmtpServer": "smtp.gmail.com",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user