diff --git a/Api/OnlineSalesAutoCrop.CoreAPI.Models/Global/AppSettings.cs b/Api/OnlineSalesAutoCrop.CoreAPI.Models/Global/AppSettings.cs index c58dd84..4a2a508 100644 --- a/Api/OnlineSalesAutoCrop.CoreAPI.Models/Global/AppSettings.cs +++ b/Api/OnlineSalesAutoCrop.CoreAPI.Models/Global/AppSettings.cs @@ -54,6 +54,7 @@ namespace OnlineSalesAutoCrop.CoreAPI.Models.Global public bool JwtValidateIssuer { get; set; } public bool JwtValidateAudience { get; set; } public int RefreshTokenDuration { get; set; } + public int AccessTokenDuration { get; set; } /// /// Folder management diff --git a/Api/OnlineSalesAutoCrop.CoreAPI.Models/Responses/MobileApp/MobileMasterDataResponse.cs b/Api/OnlineSalesAutoCrop.CoreAPI.Models/Responses/MobileApp/MobileMasterDataResponse.cs index 0d4bd16..6efb113 100644 --- a/Api/OnlineSalesAutoCrop.CoreAPI.Models/Responses/MobileApp/MobileMasterDataResponse.cs +++ b/Api/OnlineSalesAutoCrop.CoreAPI.Models/Responses/MobileApp/MobileMasterDataResponse.cs @@ -131,6 +131,11 @@ public class GetCustomerResponse public string SalesOrgCode { get; set; } public string TeritoryCode { get; set; } public string PlantCode { get; set; } + public bool IsCreditCustomer { get; set; } + public decimal CreditLimit { get; set; } + public decimal CreditBalance { get; set; } + public decimal CreditAvailable => CreditLimit - CreditBalance; + public decimal CreditOverdue { get; set; } } diff --git a/Api/OnlineSalesAutoCrop.CoreAPI.Services/Services/MobileApp/MobileMasterDataService.cs b/Api/OnlineSalesAutoCrop.CoreAPI.Services/Services/MobileApp/MobileMasterDataService.cs index 1f78450..9915e20 100644 --- a/Api/OnlineSalesAutoCrop.CoreAPI.Services/Services/MobileApp/MobileMasterDataService.cs +++ b/Api/OnlineSalesAutoCrop.CoreAPI.Services/Services/MobileApp/MobileMasterDataService.cs @@ -225,7 +225,11 @@ public class MobileMasterDataService : IMobileMasterDataService PaymentTermCode = dr.GetString(17), TeritoryCode = dr.GetString(18), SalesOrgCode = dr.GetString(19), - PlantCode = dr.GetString(20) + PlantCode = dr.GetString(20), + IsCreditCustomer = dr.GetInt32(21) > 0 , + CreditLimit = dr.GetDecimal(22), + CreditBalance = dr.GetDecimal(23), + CreditOverdue = dr.GetDecimal(24), }); } dr.Close(); diff --git a/Api/OnlineSalesAutoCrop.CoreAPI/Controllers/Mobile/MobileAuthController.cs b/Api/OnlineSalesAutoCrop.CoreAPI/Controllers/Mobile/MobileAuthController.cs index d658498..3f121f9 100644 --- a/Api/OnlineSalesAutoCrop.CoreAPI/Controllers/Mobile/MobileAuthController.cs +++ b/Api/OnlineSalesAutoCrop.CoreAPI/Controllers/Mobile/MobileAuthController.cs @@ -138,7 +138,7 @@ namespace OnlineSalesAutoCrop.CoreAPI.Controllers Helper.CreateClaim("Mobile", $"{loginReponse.MobileNumber}"), Helper.CreateClaim("HashKey", Guid.NewGuid().ToString()) ]), - Expires = DateTime.UtcNow.AddHours(12), + Expires = DateTime.UtcNow.AddMinutes(_appSettings.AccessTokenDuration), SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha512Signature) }; diff --git a/Api/OnlineSalesAutoCrop.CoreAPI/appsettings.json b/Api/OnlineSalesAutoCrop.CoreAPI/appsettings.json index 7e1ccc6..3b3c47c 100644 --- a/Api/OnlineSalesAutoCrop.CoreAPI/appsettings.json +++ b/Api/OnlineSalesAutoCrop.CoreAPI/appsettings.json @@ -84,7 +84,8 @@ "WaAuthToken": "024a6897584671d9f9fa588d7c94aa96", "WaMsgSvcSid": "MG8401d33a9a3b2aea95619bda3e5757b5", "WaSenderId": "+8801326755660", - "RefreshTokenDuration": "15" + "RefreshTokenDuration": "15", + "AccessTokenDuration": "60" }, "MenuSettings": {