This commit is contained in:
14
server/AyaNova/biz/LoanUnitRateUnit.cs
Normal file
14
server/AyaNova/biz/LoanUnitRateUnit.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
namespace AyaNova.Biz
|
||||||
|
{
|
||||||
|
|
||||||
|
public enum LoanUnitRateUnit : int
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
Hours = 1,
|
||||||
|
HalfDays = 2,
|
||||||
|
Days = 3,
|
||||||
|
Weeks = 4,
|
||||||
|
Months = 5,
|
||||||
|
Years = 6
|
||||||
|
}
|
||||||
|
}//eons
|
||||||
@@ -23,10 +23,31 @@ namespace AyaNova.Models
|
|||||||
public string CustomFields { get; set; }
|
public string CustomFields { get; set; }
|
||||||
public List<string> Tags { get; set; }
|
public List<string> Tags { get; set; }
|
||||||
|
|
||||||
|
public string Serial { get; set; }
|
||||||
|
public long? WorkOrderItemLoanId { get; set; }//deliberately named for efcore relationship magic
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
public decimal RateHour { get; set; }
|
||||||
|
[Required]
|
||||||
|
public decimal RateHalfDay { get; set; }
|
||||||
|
[Required]
|
||||||
|
public decimal RateDay { get; set; }
|
||||||
|
[Required]
|
||||||
|
public decimal RateWeek { get; set; }
|
||||||
|
[Required]
|
||||||
|
public decimal RateMonth { get; set; }
|
||||||
|
[Required]
|
||||||
|
public decimal RateYear { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
public LoanUnitRateUnit DefaultRate { get; set; }
|
||||||
|
public long? UnitId { get; set; }//deliberately named for efcore relationship magic Shadow unit
|
||||||
|
|
||||||
|
|
||||||
public LoanUnit()
|
public LoanUnit()
|
||||||
{
|
{
|
||||||
Tags = new List<string>();
|
Tags = new List<string>();
|
||||||
|
DefaultRate = LoanUnitRateUnit.Days;
|
||||||
}
|
}
|
||||||
|
|
||||||
[NotMapped, JsonIgnore]
|
[NotMapped, JsonIgnore]
|
||||||
|
|||||||
@@ -680,10 +680,37 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
|||||||
|
|
||||||
//LOANUNIT
|
//LOANUNIT
|
||||||
await ExecQueryAsync("CREATE TABLE aloanunit (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null unique, active bool, " +
|
await ExecQueryAsync("CREATE TABLE aloanunit (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null unique, active bool, " +
|
||||||
"notes text, wiki text, customfields text, tags varchar(255) ARRAY )");
|
"notes text, wiki text, customfields text, tags varchar(255) ARRAY " +
|
||||||
|
"serial text, workorderitemloanid null references aworkorderitemloan(id), ratehour decimal(19,4) not null, " +
|
||||||
|
"ratehour decimal(19,4) not null, ratehour decimal(19,4) not null, ratehour decimal(19,4) not null, ratehour decimal(19,4) not null, ratehour decimal(19,4) not null,"
|
||||||
|
|
||||||
|
")");
|
||||||
await ExecQueryAsync("CREATE UNIQUE INDEX aloanunit_name_id_idx ON aloanunit (id, name);");
|
await ExecQueryAsync("CREATE UNIQUE INDEX aloanunit_name_id_idx ON aloanunit (id, name);");
|
||||||
await ExecQueryAsync("CREATE INDEX aloanunit_tags ON aloanunit using GIN(tags)");
|
await ExecQueryAsync("CREATE INDEX aloanunit_tags ON aloanunit using GIN(tags)");
|
||||||
|
|
||||||
|
|
||||||
|
// public string Serial { get; set; }
|
||||||
|
// public long? WorkOrderItemLoanId { get; set; }//deliberately named for efcore relationship magic
|
||||||
|
|
||||||
|
// [Required]
|
||||||
|
// public decimal RateHour { get; set; }
|
||||||
|
// [Required]
|
||||||
|
// public decimal RateHalfDay { get; set; }
|
||||||
|
// [Required]
|
||||||
|
// public decimal RateDay { get; set; }
|
||||||
|
// [Required]
|
||||||
|
// public decimal RateWeek { get; set; }
|
||||||
|
// [Required]
|
||||||
|
// public decimal RateMonth { get; set; }
|
||||||
|
// [Required]
|
||||||
|
// public decimal RateYear { get; set; }
|
||||||
|
|
||||||
|
// [Required]
|
||||||
|
// public LoanUnitRateUnit DefaultRate { get; set; }
|
||||||
|
// public long? UnitId { get; set; }//deliberately named for efcore relationship magic Shadow unit
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//PART
|
//PART
|
||||||
await ExecQueryAsync("CREATE TABLE apart (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null unique, active bool, " +
|
await ExecQueryAsync("CREATE TABLE apart (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null unique, active bool, " +
|
||||||
"notes text, wiki text, customfields text, tags varchar(255) ARRAY )");
|
"notes text, wiki text, customfields text, tags varchar(255) ARRAY )");
|
||||||
|
|||||||
Reference in New Issue
Block a user