Restructure TAble
This commit is contained in:
parent
717b0f0a8e
commit
1ba2f2eec1
37 changed files with 1107 additions and 527 deletions
13
BMA.EHR.Domain/Common/BaseDataEntity.cs
Normal file
13
BMA.EHR.Domain/Common/BaseDataEntity.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using BMA.EHR.Domain.Common.Interfaces;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace BMA.EHR.Domain.Common
|
||||
{
|
||||
public abstract class BaseDataEntity<T> : BaseEntity<T>, IActivableEntity
|
||||
{
|
||||
[Required, Column(Order = 990), Comment("สถานะการใช้งาน")]
|
||||
public bool IsActive { get; set; } = true;
|
||||
}
|
||||
}
|
||||
13
BMA.EHR.Domain/Common/BaseDraftEntity.cs
Normal file
13
BMA.EHR.Domain/Common/BaseDraftEntity.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using BMA.EHR.Domain.Common.Interfaces;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace BMA.EHR.Domain.Common
|
||||
{
|
||||
public class BaseDraftEntity<T> : BaseDataEntity<T>, IPublishableEntity
|
||||
{
|
||||
[Required, Column(Order = 899), Comment("สถานะการเผยแพร่ข้อมูล")]
|
||||
public bool IsPublished { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,34 +1,36 @@
|
|||
using BMA.EHR.Domain.Common.Interfaces;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BMA.EHR.Domain.Common
|
||||
{
|
||||
public abstract class BaseEntity<T> : IActivableEntity, IAuditableEntity
|
||||
{
|
||||
[Key, Column(Order = 0), Comment("คีย์หลัก")]
|
||||
public virtual T Id { get; set; }
|
||||
public class BaseEntity<T> : IAuditableEntity
|
||||
{
|
||||
[Key, Column(Order = 0), Comment("คีย์หลัก")]
|
||||
public virtual T Id { get; set; }
|
||||
|
||||
[Required, Column(Order = 990), Comment("สถานะการใช้งาน")]
|
||||
public bool IsActive { get; set; } = true;
|
||||
[Required, Column(Order = 991), Comment("User Id ที่สร้างข้อมูล")]
|
||||
public Guid CreatedUserId { get; set; } = Guid.Empty;
|
||||
|
||||
[Required, Column(Order = 991), Comment("User Id ที่สร้างข้อมูล")]
|
||||
public Guid CreatedUserId { get; set; } = Guid.Empty;
|
||||
[Required, Column(Order = 992), Comment("ชื่อ User ที่สร้างข้อมูล")]
|
||||
public string CreatedUserFullName { get; set; } = string.Empty;
|
||||
|
||||
[Required, Column(Order = 992), Comment("ชื่อ User ที่สร้างข้อมูล")]
|
||||
public string CreatedUserFullName { get; set; } = string.Empty;
|
||||
[Required, Column(Order = 993), Comment("สร้างข้อมูลเมื่อ")]
|
||||
public DateTime CreatedDate { get; set; } = DateTime.Now;
|
||||
|
||||
[Required, Column(Order = 993), Comment("สร้างข้อมูลเมื่อ")]
|
||||
public DateTime CreatedDate { get; set; } = DateTime.Now;
|
||||
[Column(Order = 994), Comment("User Id ที่แก้ไขข้อมูล")]
|
||||
public Guid? ModifiedUserId { get; set; }
|
||||
|
||||
[Column(Order = 994), Comment("User Id ที่แก้ไขข้อมูล")]
|
||||
public Guid? ModifiedUserId { get; set; }
|
||||
[Column(Order = 995), Comment("ชื่อ User ที่แก้ไขข้อมูล")]
|
||||
public string? ModifiedUserFullName { get; set; }
|
||||
|
||||
[Column(Order = 995), Comment("ชื่อ User ที่แก้ไจข้อมูล")]
|
||||
public string? ModifiedUserFullName { get; set; }
|
||||
|
||||
[Column(Order = 996), Comment("แก้ไขข้อมูลเมื่อ")]
|
||||
public DateTime? ModifiedDate { get; set; }
|
||||
}
|
||||
[Column(Order = 996), Comment("แก้ไขข้อมูลเมื่อ")]
|
||||
public DateTime? ModifiedDate { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
13
BMA.EHR.Domain/Common/Interfaces/IPublishableEntity.cs
Normal file
13
BMA.EHR.Domain/Common/Interfaces/IPublishableEntity.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BMA.EHR.Domain.Common.Interfaces
|
||||
{
|
||||
public interface IPublishableEntity
|
||||
{
|
||||
bool IsPublished { get; set; }
|
||||
}
|
||||
}
|
||||
11
BMA.EHR.Domain/Common/ResponseObject.cs
Normal file
11
BMA.EHR.Domain/Common/ResponseObject.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
namespace BMA.EHR.Domain.Common
|
||||
{
|
||||
public class ResponseObject
|
||||
{
|
||||
public int Status { get; set; }
|
||||
|
||||
public string? Message { get; set; }
|
||||
|
||||
public object? Result { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue