This commit is contained in:
2021-01-06 23:49:19 +00:00
parent 5e54fc3899
commit f5f0cffde6
5 changed files with 106 additions and 0 deletions

View File

@@ -116,6 +116,8 @@ namespace AyaNova.Biz
return await ct.TaxCode.AnyAsync(z => z.Id == id);
case AyaType.ServiceBank:
return await ct.ServiceBank.AnyAsync(z => z.Id == id);
case AyaType.CustomerServiceRequest:
return await ct.CustomerServiceRequest.AnyAsync(z => z.Id == id);
default:
throw new System.NotSupportedException($"AyaNova.Biz.BizObjectExistsInDatabase::ExistsAsync type {objectType.ToString()} is not supported");
}

View File

@@ -100,6 +100,8 @@ namespace AyaNova.Biz
return new TaxCodeBiz(ct, userId, ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID, roles);
case AyaType.ServiceBank:
return new ServiceBankBiz(ct, userId, ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID, roles);
case AyaType.CustomerServiceRequest:
return new CustomerServiceRequestBiz(ct, userId, ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID, roles);

View File

@@ -0,0 +1,19 @@
namespace AyaNova.Biz
{
public enum CustomerServiceRequestPriority : int
{
/// <summary>
/// Not urgent, service at time of choosing of service company
/// </summary>
NotUrgent = 0,
/// <summary>
/// Not an emergency but quite urgent, service as soon as possible
/// </summary>
ASAP = 1,
/// <summary>
/// Issue is an emergency, client expects service company to make it their first priority
/// </summary>
Emergency = 2
}
}//eons

View File

@@ -0,0 +1,22 @@
namespace AyaNova.Biz
{
public enum CustomerServiceRequestStatus : int
{
/// <summary>
/// No status set
/// (editable)
/// </summary>
Open = 0,
/// <summary>
/// Accepted for service
/// (Not editable / locked and closed)
/// </summary>
Accepted = 1,
/// <summary>
/// Declined for service
/// (editable)
/// </summary>
Declined = 2
}
}//eons

View File

@@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using AyaNova.Biz;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
namespace AyaNova.Models
{
//NOTE: Any non required field (nullable in DB) sb nullable here, i.e. decimal? not decimal,
//otherwise the server will call it an invalid record if the field isn't sent from client
public class CustomerServiceRequest : ICoreBizObjectModel
{
public long Id { get; set; }
public uint Concurrency { get; set; }
[Required]
public string Name { get; set; }
public bool Active { get; set; }
public string Notes { get; set; }
public string Wiki { get; set; }
public string CustomFields { get; set; }
public List<string> Tags { get; set; }
public DateTime? DateRequested { get; set; }
[Required]
public long? CustomerId { get; set; }
public long? UnitId { get; set; }
public long? WorkorderItemId { get; set; }
public CustomerServiceRequest()
{
Tags = new List<string>();
DateRequested = DateTime.UtcNow;
}
[NotMapped, JsonIgnore]
public AyaType AyaType { get => AyaType.CustomerServiceRequest; }
}//eoc
}//eons
/*
CREATE TABLE [dbo].[ACLIENTSERVICEREQUEST](
[AID] [uniqueidentifier] NOT NULL,
[ACREATED] [datetime] NULL,
[AMODIFIED] [datetime] NULL,
[ACREATOR] [uniqueidentifier] NULL,
[AMODIFIER] [uniqueidentifier] NULL,
[ATITLE] [nvarchar](255) NOT NULL,
[ADETAILS] [ntext] NULL,
[ACLIENTID] [uniqueidentifier] NULL,
[AUNITID] [uniqueidentifier] NULL,
[AWORKORDERITEMID] [uniqueidentifier] NULL,
[ASTATUS] [smallint] NOT NULL,
[APRIORITY] [smallint] NOT NULL,
[ACLIENTREF] [nvarchar](255) NOT NULL,
[AREQUESTEDBY] [nvarchar](255) NULL,
*/