Skip to content

Commit

Permalink
vehicle region
Browse files Browse the repository at this point in the history
  • Loading branch information
matt committed Jun 21, 2021
1 parent 65cd5e0 commit 1329339
Show file tree
Hide file tree
Showing 12 changed files with 379 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@
<mat-option *ngFor="let color of vehicleFilters.vehicleColors" [value]="color">{{color}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="fill" style="width: 80%;">
<mat-label>Vehicle Region</mat-label>
<mat-select [disabled]="vehicleFilters.vehicleRegions?.length === 0" [(ngModel)]="filterVehicleRegion">
<mat-option [value]=""></mat-option>
<mat-option *ngFor="let region of vehicleFilters.vehicleRegions" [value]="region">{{region}}</mat-option>
</mat-select>
</mat-form-field>
<mat-error *ngIf="!filterPlateNumberIsValid && regexSearchEnabled">Invalid regex pattern</mat-error>
<mat-error *ngIf="!filterPlateNumberIsValid && !regexSearchEnabled">Invalid search term</mat-error>
<div style="padding-top:10px;">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export class PlatesComponent implements OnInit, OnDestroy, AfterViewInit {
public filterVehicleModel: string;
public filterVehicleType: string;
public filterVehicleColor: string;

public filterVehicleRegion: string;

public vehicleFilters: VehicleFilters = {} as VehicleFilters;

public isDeletingPlate: boolean;
Expand Down Expand Up @@ -224,6 +225,7 @@ export class PlatesComponent implements OnInit, OnDestroy, AfterViewInit {
this.filterVehicleModel = '';
this.filterVehicleType = '';
this.filterVehicleColor = '';
this.filterVehicleRegion = '';

this.searchPlates();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ export interface VehicleFilters {
vehicleYears: string[];

vehicleColors: string[];

vehicleRegions: string[];
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore.Migrations;

namespace OpenAlprWebhookProcessor.Migrations
{
public partial class vehicleregion : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "Region",
table: "PlateGroups",
newName: "VehicleRegion");
}

protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "VehicleRegion",
table: "PlateGroups",
newName: "Region");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<long>("ReceivedOnEpoch")
.HasColumnType("INTEGER");
b.Property<string>("Region")
.HasColumnType("TEXT");
b.Property<string>("VehicleColor")
.HasColumnType("TEXT");
Expand All @@ -243,6 +240,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<string>("VehicleMakeModel")
.HasColumnType("TEXT");
b.Property<string>("VehicleRegion")
.HasColumnType("TEXT");
b.Property<string>("VehicleType")
.HasColumnType("TEXT");
Expand Down
4 changes: 2 additions & 2 deletions OpenAlprWebhookProcessor/Data/Webhook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public class PlateGroup

public string BestNumber { get; set; }

public string Region { get; set; }

public string PossibleNumbers { get; set; }

public string Jpeg { get; set; }
Expand All @@ -38,6 +36,8 @@ public class PlateGroup

public string VehicleYear { get; set; }

public string VehicleRegion { get; set; }

public double Direction { get; set; }

public string PlateCoordinates { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion OpenAlprWebhookProcessor/Hydration/HydrationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private static PlateGroup MapResponseToPlate(Response apiResponse)
fields.PlateY4,
}),
ReceivedOnEpoch = DateTimeOffset.Parse(fields.EpochTimeStart).ToUnixTimeMilliseconds(),
Region = fields.Region,
VehicleRegion = fields.Region,
VehicleColor = fields.VehicleColor,
VehicleMake = fields.VehicleMake,
VehicleMakeModel = fields.VehicleMakeModel,
Expand Down
Loading

0 comments on commit 1329339

Please sign in to comment.