This commit is contained in:
@@ -115,16 +115,19 @@ namespace AyaNova.Biz
|
||||
/// GET
|
||||
|
||||
//Get one
|
||||
internal async Task<User> GetAsync(long fetchId)
|
||||
internal async Task<dtUser> GetAsync(long fetchId)
|
||||
{
|
||||
//This is simple so nothing more here, but often will be copying to a different output object or some other ops
|
||||
var ret = await ct.User.SingleOrDefaultAsync(m => m.Id == fetchId);
|
||||
if (ret != null)
|
||||
var dbFullUser = await ct.User.SingleOrDefaultAsync(m => m.Id == fetchId);
|
||||
if (dbFullUser != null)
|
||||
{
|
||||
//Log
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, fetchId, BizType, AyaEvent.Retrieved), ct);
|
||||
}
|
||||
return ret;
|
||||
|
||||
dtUser retUser = new dtUser();
|
||||
CopyObject.Copy(dbFullUser, retUser);
|
||||
return retUser;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,29 @@ using Newtonsoft.Json;
|
||||
namespace AyaNova.Models
|
||||
{
|
||||
|
||||
public class dtUser//used to return user object without auth related fields in UserGet route
|
||||
{
|
||||
public dtUser()
|
||||
{
|
||||
Tags = new List<string>();
|
||||
}
|
||||
public long Id { get; set; }
|
||||
public uint ConcurrencyToken { get; set; }
|
||||
public bool Active { get; set; }
|
||||
[Required, MaxLength(255)]
|
||||
public string Name { get; set; }
|
||||
public AuthorizationRoles Roles { get; set; }
|
||||
public UserType UserType { get; set; }
|
||||
public string EmployeeNumber { get; set; }
|
||||
public string Notes { get; set; }
|
||||
public long? CustomerId { get; set; }
|
||||
public long? HeadOfficeId { get; set; }
|
||||
public long? SubVendorId { get; set; }
|
||||
public string Wiki { get; set; }
|
||||
public string CustomFields { get; set; }
|
||||
public List<string> Tags { get; set; }
|
||||
}//eoc
|
||||
|
||||
public class User
|
||||
{
|
||||
public long Id { get; set; }
|
||||
@@ -15,18 +38,21 @@ namespace AyaNova.Models
|
||||
public bool Active { get; set; }
|
||||
[Required, MaxLength(255)]
|
||||
public string Name { get; set; }
|
||||
//[Required]
|
||||
|
||||
public string Login { get; set; }
|
||||
//[Required]
|
||||
public string Password { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string Salt { get; set; }
|
||||
[Required]
|
||||
public AuthorizationRoles Roles { get; set; }
|
||||
[JsonIgnore]
|
||||
public string CurrentAuthToken { get; set; }
|
||||
[JsonIgnore]
|
||||
public string DlKey { get; set; }
|
||||
[JsonIgnore]
|
||||
public DateTime? DlKeyExpire { get; set; }
|
||||
|
||||
[Required]
|
||||
public AuthorizationRoles Roles { get; set; }
|
||||
[Required]
|
||||
public UserType UserType { get; set; }
|
||||
[MaxLength(255)]
|
||||
@@ -61,82 +87,5 @@ namespace AyaNova.Models
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/*
|
||||
v7 export record sample
|
||||
{
|
||||
"DefaultLanguage": "Custom English",
|
||||
"DefaultServiceTemplateID": "ca83a7b8-4e5f-4a7b-a02b-9cf78d5f983f",
|
||||
"UserType": 2,
|
||||
"Active": true,
|
||||
"ClientID": "00000000-0000-0000-0000-000000000000",
|
||||
"HeadOfficeID": "00000000-0000-0000-0000-000000000000",
|
||||
"MemberOfGroup": "0f8a80ff-4b03-4114-ae51-2d13b812dd65",
|
||||
"Created": "03/21/2005 07:19 AM",
|
||||
"Modified": "09/15/2015 12:22 PM",
|
||||
"Creator": "2ecc77fc-69e2-4a7e-b88d-bd0ecaf36aed",
|
||||
"Modifier": "1d859264-3f32-462a-9b0c-a67dddfdf4d3",
|
||||
"ID": "1d859264-3f32-462a-9b0c-a67dddfdf4d3",
|
||||
"FirstName": "Hank",
|
||||
"LastName": "Rearden",
|
||||
"Initials": "HR",
|
||||
"EmployeeNumber": "EMP1236",
|
||||
"PageAddress": "",
|
||||
"PageMaxText": 24,
|
||||
"Phone1": "",
|
||||
"Phone2": "",
|
||||
"EmailAddress": "",
|
||||
"UserCertifications": [
|
||||
{
|
||||
"Created": "12/22/2005 02:07 PM",
|
||||
"Creator": "2ecc77fc-69e2-4a7e-b88d-bd0ecaf36aed",
|
||||
"Modified": "12/22/2005 02:08 PM",
|
||||
"Modifier": "2ecc77fc-69e2-4a7e-b88d-bd0ecaf36aed",
|
||||
"ID": "4492360c-43e4-4209-9f33-30691b0808ed",
|
||||
"UserCertificationID": "b2f26359-7c42-4218-923a-e949f3ef1f85",
|
||||
"UserID": "1d859264-3f32-462a-9b0c-a67dddfdf4d3",
|
||||
"ValidStartDate": "2005-10-11T00:00:00-07:00",
|
||||
"ValidStopDate": "2006-10-11T00:00:00-07:00"
|
||||
}
|
||||
],
|
||||
"UserSkills": [
|
||||
{
|
||||
"Created": "12/22/2005 02:06 PM",
|
||||
"Creator": "2ecc77fc-69e2-4a7e-b88d-bd0ecaf36aed",
|
||||
"Modified": "12/22/2005 02:08 PM",
|
||||
"Modifier": "2ecc77fc-69e2-4a7e-b88d-bd0ecaf36aed",
|
||||
"ID": "1dc5ce96-f411-4885-856e-5bdb3ad79728",
|
||||
"UserSkillID": "2e6f8b65-594c-4f6c-9cd6-e14a562daba8",
|
||||
"UserID": "1d859264-3f32-462a-9b0c-a67dddfdf4d3"
|
||||
},
|
||||
{
|
||||
"Created": "12/22/2005 02:06 PM",
|
||||
"Creator": "2ecc77fc-69e2-4a7e-b88d-bd0ecaf36aed",
|
||||
"Modified": "12/22/2005 02:08 PM",
|
||||
"Modifier": "2ecc77fc-69e2-4a7e-b88d-bd0ecaf36aed",
|
||||
"ID": "88e476d3-7526-45f5-a0dd-706c8053a63f",
|
||||
"UserSkillID": "47a4ee94-b0e9-41b5-afe5-4b4f2c981877",
|
||||
"UserID": "1d859264-3f32-462a-9b0c-a67dddfdf4d3"
|
||||
}
|
||||
],
|
||||
"Notes": "",
|
||||
"VendorID": "06e502c2-69ba-4e88-8efb-5b53c1687740",
|
||||
"RegionID": "f856423a-d468-4344-b7b8-121e466738c6",
|
||||
"DispatchZoneID": "00000000-0000-0000-0000-000000000000",
|
||||
"SubContractor": false,
|
||||
"DefaultWarehouseID": "d45eab37-b6e6-4ad2-9163-66d7ba83a98c",
|
||||
"Custom1": "",
|
||||
"Custom2": "",
|
||||
"Custom3": "",
|
||||
"Custom4": "",
|
||||
"Custom5": "",
|
||||
"Custom6": "",
|
||||
"Custom7": "",
|
||||
"Custom8": "",
|
||||
"Custom9": "",
|
||||
"Custom0": "",
|
||||
"ScheduleBackColor": -2097216,
|
||||
"TimeZoneOffset": null
|
||||
}
|
||||
*/
|
||||
}//eoc
|
||||
}
|
||||
Reference in New Issue
Block a user