This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# TODO (J.F.C. - Just fucking code it already)
|
||||
|
||||
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOiIxNTQyNjY5Njc3IiwiZXhwIjoiMTU0NTI2MTY3NyIsImlzcyI6ImF5YW5vdmEuY29tIiwiaWQiOiIxIiwiYXlhbm92YS9yb2xlcyI6IjE2NDI2In0.93IjHRXQA9c8Z0U9qcsS73KcbG3HzYWkRzF3LwCB_rY
|
||||
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOiIxNTQ0NTU5NzAwIiwiZXhwIjoiMTU0NzE1MTcwMCIsImlzcyI6ImF5YW5vdmEuY29tIiwiaWQiOiIxIiwiYXlhbm92YS9yb2xlcyI6IjMyNzY3In0.fMq_8Dvia63rzN_U2zjczPvUNM40OEAeI4VOeV6ulGw
|
||||
|
||||
|
||||
## IMMEDIATE ITEMS
|
||||
@@ -317,6 +317,10 @@ TODO SERVER
|
||||
- Client item actually: it should validate the time zone offset when the client software starts and if it's found to be off what was set offer to change it automatically
|
||||
- This way it works client to client and will handle DST changes almost automatically
|
||||
|
||||
- Trial route needs in xml comments for route to add the timezone info parameter so it shows in the api explorer as well as the current trial size
|
||||
|
||||
|
||||
|
||||
- Stage 2 AFTER POSTED TEST ROUND COMPLETED
|
||||
- Error handling at client (log? display?)
|
||||
- Notification of some kind (bell / toast)
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace AyaNova.Api.Controllers
|
||||
/// <param name="size">Valid values are "Small", "Medium", "Large", "Huge"</param>
|
||||
/// <param name="timeZoneOffset">Value in hours of local time zone offset from UTC / GMT. This ensures that data is generated relative to the desired time zone</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("seed/{size}")]
|
||||
[HttpPost("seed/{size}/{timeZoneOffset}")]
|
||||
public ActionResult SeedTrialDatabase([FromRoute] string size,[FromRoute] decimal timeZoneOffset )
|
||||
{
|
||||
if (!serverState.IsOpen)
|
||||
|
||||
@@ -41,24 +41,16 @@ namespace AyaNova.Biz
|
||||
//public const string GreaterThanZero = "{[>0]}";
|
||||
|
||||
//https://www.klipfolio.com/resources/articles/kpi-timeframe-comparison-metrics
|
||||
//Quarters: https://www.investopedia.com/terms/q/quarter.asp
|
||||
|
||||
//More business time frames
|
||||
public const string LastQuarter = "{[lastquarter]}";
|
||||
|
||||
public const string YearToDate = "{[yeartodate]}";
|
||||
public const string QuarterToDate = "{[quartertodate]}";
|
||||
|
||||
public const string Past90Days = "{[past90days]}";
|
||||
public const string Past30Days = "{[past30days]}";
|
||||
public const string Past24Hours = "{[past24hours]}";
|
||||
|
||||
//The standard calendar quarters that make up the year are: January, February, and March (Q1); April, May, and June (Q2); July, August, and September (Q3); and October, November, and December (Q4). A quarter is often shown with its relevant year, as in Q1 2018 or Q1/18 which represents the first quarter of the year 2018.
|
||||
public const string Q1ThisYear = "{[q1thisyear]}";
|
||||
public const string Q2ThisYear = "{[q2thisyear]}";
|
||||
public const string Q3ThisYear = "{[q3thisyear]}";
|
||||
public const string Q4ThisYear = "{[q4thisyear]}";
|
||||
public const string Q1LastYear = "{[q1lastyear]}";
|
||||
public const string Q2LastYear = "{[q2lastyear]}";
|
||||
public const string Q3LastYear = "{[q3lastyear]}";
|
||||
public const string Q4LastYear = "{[q4lastyear]}";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -308,7 +308,7 @@ namespace AyaNova.Biz
|
||||
// ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("FilterSqlCriteriaBuilder::DataFilterToColumnCriteria");
|
||||
log.LogInformation("RelativeToday (adjusted):");
|
||||
log.LogInformation(RelativeToday.ToString());
|
||||
log.LogInformation("RelativeNow (adjusted):");
|
||||
log.LogInformation("RelativeNow (adjusted):");
|
||||
log.LogInformation(RelativeNow.ToString());
|
||||
log.LogInformation("Offset used:");
|
||||
log.LogInformation(u.tz.ToString());
|
||||
@@ -531,52 +531,7 @@ namespace AyaNova.Biz
|
||||
//=======================
|
||||
//NEW ONES FOR RAVEN
|
||||
|
||||
case FilterSpecialToken.LastQuarter:
|
||||
//First determine what quarter we are in now, then get the date range for the quarter before that
|
||||
switch (RelativeNow.Month)
|
||||
{
|
||||
//are we in the first quarter?
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
//Then we need the dates of the last quarter of last year
|
||||
//From zero hour October 1st last year
|
||||
dtAfter = new DateTime(RelativeNow.AddYears(-1).Year, 10, 1, 00, 00, 00).AddSeconds(-1).AddHours(TimeZoneAdjustment); ;
|
||||
//To zero hour January 1 this year
|
||||
dtBefore = new DateTime(RelativeNow.Year, 1, 1, 00, 00, 00).AddHours(TimeZoneAdjustment);
|
||||
break;
|
||||
//are we in the second quarter?
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
//Then we need this year first quarter JAN-FEB-MAR
|
||||
//From zero hour january 1 this year
|
||||
dtAfter = new DateTime(RelativeNow.Year, 1, 1, 00, 00, 00).AddSeconds(-1).AddHours(TimeZoneAdjustment); ;
|
||||
//To zero hour April 1 this year
|
||||
dtBefore = new DateTime(RelativeNow.Year, 4, 1, 00, 00, 00).AddHours(TimeZoneAdjustment);
|
||||
break;
|
||||
//Are we in the third quarter?
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
//Then we need this year Second quarter APR-MAY-JUN
|
||||
//From zero hour April 1 this year
|
||||
dtAfter = new DateTime(RelativeNow.Year, 4, 1, 00, 00, 00).AddSeconds(-1).AddHours(TimeZoneAdjustment); ;
|
||||
//To zero hour July 1 this year
|
||||
dtBefore = new DateTime(RelativeNow.Year, 7, 1, 00, 00, 00).AddHours(TimeZoneAdjustment);
|
||||
break;
|
||||
default:
|
||||
//We're in the fourth quarter
|
||||
//Then we need this year Third quarter JUL-AUG-SEP
|
||||
//From zero hour July 1 this year
|
||||
dtAfter = new DateTime(RelativeNow.Year, 7, 1, 00, 00, 00).AddSeconds(-1).AddHours(TimeZoneAdjustment); ;
|
||||
//To zero hour Oct 1 this year
|
||||
dtBefore = new DateTime(RelativeNow.Year, 10, 1, 00, 00, 00).AddHours(TimeZoneAdjustment);
|
||||
break;
|
||||
|
||||
}
|
||||
BuildBetweenTwoDatesFragment(sColumn, sb, dtAfter, dtBefore);
|
||||
break;
|
||||
case FilterSpecialToken.YearToDate:
|
||||
//From zero hour january 1 this year
|
||||
dtAfter = new DateTime(RelativeNow.Year, 1, 1, 00, 00, 00).AddSeconds(-1).AddHours(TimeZoneAdjustment); ;
|
||||
@@ -584,42 +539,7 @@ namespace AyaNova.Biz
|
||||
dtBefore = RelativeNow;
|
||||
BuildBetweenTwoDatesFragment(sColumn, sb, dtAfter, dtBefore);
|
||||
break;
|
||||
case FilterSpecialToken.QuarterToDate:
|
||||
switch (RelativeNow.Month)
|
||||
{
|
||||
//FirstQuarter to date
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
//Jan 1st to now
|
||||
dtAfter = new DateTime(RelativeNow.Year, 1, 1, 00, 00, 00).AddSeconds(-1).AddHours(TimeZoneAdjustment); ;
|
||||
dtBefore = RelativeNow;
|
||||
break;
|
||||
//Second Quarter to date
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
//April 1st to now
|
||||
dtAfter = new DateTime(RelativeNow.Year, 4, 1, 00, 00, 00).AddSeconds(-1).AddHours(TimeZoneAdjustment); ;
|
||||
dtBefore = RelativeNow;
|
||||
break;
|
||||
//Third quarter to date
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
//From July 1
|
||||
dtAfter = new DateTime(RelativeNow.Year, 7, 1, 00, 00, 00).AddSeconds(-1).AddHours(TimeZoneAdjustment); ;
|
||||
dtBefore = RelativeNow;
|
||||
break;
|
||||
default:
|
||||
//Fourth quarter to date
|
||||
//From Oct 1 this year
|
||||
dtAfter = new DateTime(RelativeNow.Year, 10, 1, 00, 00, 00).AddSeconds(-1).AddHours(TimeZoneAdjustment); ;
|
||||
dtBefore = RelativeNow;
|
||||
break;
|
||||
}
|
||||
BuildBetweenTwoDatesFragment(sColumn, sb, dtAfter, dtBefore);
|
||||
break;
|
||||
|
||||
case FilterSpecialToken.Past90Days:
|
||||
//From Now minus 90 days
|
||||
dtAfter = DateTime.UtcNow.AddDays(-90);
|
||||
@@ -641,46 +561,9 @@ namespace AyaNova.Biz
|
||||
dtBefore = DateTime.UtcNow;
|
||||
BuildBetweenTwoDatesFragment(sColumn, sb, dtAfter, dtBefore);
|
||||
break;
|
||||
case FilterSpecialToken.Q1ThisYear:
|
||||
dtAfter = new DateTime(RelativeNow.Year, 1, 1, 00, 00, 00).AddSeconds(-1).AddHours(TimeZoneAdjustment); ;
|
||||
dtBefore = new DateTime(RelativeNow.Year, 4, 1, 00, 00, 00).AddHours(TimeZoneAdjustment);
|
||||
BuildBetweenTwoDatesFragment(sColumn, sb, dtAfter, dtBefore);
|
||||
break;
|
||||
case FilterSpecialToken.Q2ThisYear:
|
||||
dtAfter = new DateTime(RelativeNow.Year, 4, 1, 00, 00, 00).AddSeconds(-1).AddHours(TimeZoneAdjustment); ;
|
||||
dtBefore = new DateTime(RelativeNow.Year, 7, 1, 00, 00, 00).AddHours(TimeZoneAdjustment);
|
||||
BuildBetweenTwoDatesFragment(sColumn, sb, dtAfter, dtBefore);
|
||||
break;
|
||||
case FilterSpecialToken.Q3ThisYear:
|
||||
dtAfter = new DateTime(RelativeNow.Year, 7, 1, 00, 00, 00).AddSeconds(-1).AddHours(TimeZoneAdjustment); ;
|
||||
dtBefore = new DateTime(RelativeNow.Year, 10, 1, 00, 00, 00).AddHours(TimeZoneAdjustment);
|
||||
BuildBetweenTwoDatesFragment(sColumn, sb, dtAfter, dtBefore);
|
||||
break;
|
||||
case FilterSpecialToken.Q4ThisYear:
|
||||
dtAfter = new DateTime(RelativeNow.Year, 10, 1, 00, 00, 00).AddSeconds(-1).AddHours(TimeZoneAdjustment); ;
|
||||
dtBefore = new DateTime(RelativeNow.AddYears(1).Year, 1, 1, 00, 00, 00).AddHours(TimeZoneAdjustment);
|
||||
BuildBetweenTwoDatesFragment(sColumn, sb, dtAfter, dtBefore);
|
||||
break;
|
||||
case FilterSpecialToken.Q1LastYear:
|
||||
dtAfter = new DateTime(RelativeNow.AddYears(-1).Year, 1, 1, 00, 00, 00).AddSeconds(-1).AddHours(TimeZoneAdjustment); ;
|
||||
dtBefore = new DateTime(RelativeNow.AddYears(-1).Year, 4, 1, 00, 00, 00).AddHours(TimeZoneAdjustment);
|
||||
BuildBetweenTwoDatesFragment(sColumn, sb, dtAfter, dtBefore);
|
||||
break;
|
||||
case FilterSpecialToken.Q2LastYear:
|
||||
dtAfter = new DateTime(RelativeNow.AddYears(-1).Year, 4, 1, 00, 00, 00).AddSeconds(-1).AddHours(TimeZoneAdjustment); ;
|
||||
dtBefore = new DateTime(RelativeNow.AddYears(-1).Year, 7, 1, 00, 00, 00).AddHours(TimeZoneAdjustment);
|
||||
BuildBetweenTwoDatesFragment(sColumn, sb, dtAfter, dtBefore);
|
||||
break;
|
||||
case FilterSpecialToken.Q3LastYear:
|
||||
dtAfter = new DateTime(RelativeNow.AddYears(-1).Year, 7, 1, 00, 00, 00).AddSeconds(-1).AddHours(TimeZoneAdjustment); ;
|
||||
dtBefore = new DateTime(RelativeNow.AddYears(-1).Year, 10, 1, 00, 00, 00).AddHours(TimeZoneAdjustment);
|
||||
BuildBetweenTwoDatesFragment(sColumn, sb, dtAfter, dtBefore);
|
||||
break;
|
||||
case FilterSpecialToken.Q4LastYear:
|
||||
dtAfter = new DateTime(RelativeNow.AddYears(-1).Year, 10, 1, 00, 00, 00).AddSeconds(-1).AddHours(TimeZoneAdjustment); ;
|
||||
dtBefore = new DateTime(RelativeNow.Year, 1, 1, 00, 00, 00).AddHours(TimeZoneAdjustment);
|
||||
BuildBetweenTwoDatesFragment(sColumn, sb, dtAfter, dtBefore);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new System.ArgumentOutOfRangeException("TOKEN", sOperator, "GridToSqlCriteria invalid filter TOKEN type [" + sValue + "] IN DATE_TIME");
|
||||
|
||||
//-----
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,8 +12,8 @@ namespace raven_integration
|
||||
{
|
||||
private static HttpClient client { get; } = new HttpClient();
|
||||
|
||||
private static string API_BASE_URL = "http://localhost:7575/api/v8.0/";
|
||||
//private static string API_BASE_URL = "https://test.helloayanova.com/api/v8.0/";
|
||||
// private static string API_BASE_URL = "http://localhost:7575/api/v8.0/";
|
||||
private static string API_BASE_URL = "https://test.helloayanova.com/api/v8.0/";
|
||||
|
||||
public static string TEST_DATA_FOLDER = @"..\..\..\testdata\";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user