make optional some properties in MaterialFOCs for Integration

This commit is contained in:
dibakor 2026-07-27 16:09:14 +06:00
parent edf51b4271
commit e9500278cd
4 changed files with 6 additions and 9 deletions

View File

@ -1,5 +1,4 @@
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
@ -11,11 +10,9 @@ public class IntegrationMaterialFreeGoodsRequest
{ {
Slabs = new List<IntegrationMaterialFreeGoodItemRequest>(); Slabs = new List<IntegrationMaterialFreeGoodItemRequest>();
} }
[Required(ErrorMessage = "SalesOrg is required.")]
[StringLength(10, MinimumLength = 1, ErrorMessage = "SalesOrg must be between 1 and 10 characters.")] [StringLength(10, MinimumLength = 1, ErrorMessage = "SalesOrg must be between 1 and 10 characters.")]
public string SalesOrg { get; set; } public string SalesOrg { get; set; }
[Required(ErrorMessage = "DistributionChannel is required.")]
[StringLength(5, MinimumLength = 1, ErrorMessage = "DistributionChannel must be between 1 and 5 characters.")] [StringLength(5, MinimumLength = 1, ErrorMessage = "DistributionChannel must be between 1 and 5 characters.")]
public string DistributionChannel { get; set; } public string DistributionChannel { get; set; }

View File

@ -12,13 +12,11 @@ public class IntegrationMaterialPriceRequest
Slabs = new List<IntegrationMaterialPriceItemRequest>(); Slabs = new List<IntegrationMaterialPriceItemRequest>();
} }
[Required(ErrorMessage = "Sales Org is required.")]
[StringLength(4, ErrorMessage = "Sales Org cannot exceed 4 characters.")] [StringLength(4, ErrorMessage = "Sales Org cannot exceed 4 characters.")]
public string SalesOrg { get; set; } public string? SalesOrg { get; set; }
[Required(ErrorMessage = "Distribution Channel is required.")]
[StringLength(2, ErrorMessage = "Distribution Channel cannot exceed 2 characters.")] [StringLength(2, ErrorMessage = "Distribution Channel cannot exceed 2 characters.")]
public string DistributionChannel { get; set; } public string? DistributionChannel { get; set; }
[StringLength(13, ErrorMessage = "Customer Number cannot exceed 13 characters.")] [StringLength(13, ErrorMessage = "Customer Number cannot exceed 13 characters.")]
public string? CustomerNumber { get; set; } public string? CustomerNumber { get; set; }

View File

@ -113,7 +113,8 @@ public class GetMaterialPriceResponse
public string CustomerCode { get; set; } public string CustomerCode { get; set; }
public string MaterialCode { get; set; } public string MaterialCode { get; set; }
public decimal BasePrice { get; set; } public decimal BasePrice { get; set; }
public decimal? VatPercentage { get; set; } public decimal? VatValue { get; set; }
public string? VatCalculationType { get; set; }
} }
public class GetCustomerResponse public class GetCustomerResponse

View File

@ -239,7 +239,8 @@ public class MobileMasterDataService : IMobileMasterDataService
CustomerCode = dr.GetString(1), CustomerCode = dr.GetString(1),
MaterialCode = dr.GetString(2), MaterialCode = dr.GetString(2),
BasePrice = dr.GetDecimal(3), BasePrice = dr.GetDecimal(3),
VatPercentage =dr.IsDBNull(4) ? null: dr.GetDecimal(4), VatValue =dr.IsDBNull(4) ? null: dr.GetDecimal(4),
VatCalculationType =dr.IsDBNull(5) ? null: dr.GetString(5),
}); });
} }
dr.Close(); dr.Close();