Added supply record backend.
This commit is contained in:
37
Models/Supply/SupplyRecord.cs
Normal file
37
Models/Supply/SupplyRecord.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
namespace CarCareTracker.Models
|
||||
{
|
||||
public class SupplyRecord
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int VehicleId { get; set; }
|
||||
/// <summary>
|
||||
/// When the part or supplies were purchased.
|
||||
/// </summary>
|
||||
public DateTime Date { get; set; }
|
||||
/// <summary>
|
||||
/// Part number can be alphanumeric.
|
||||
/// </summary>
|
||||
public string PartNumber { get; set; }
|
||||
/// <summary>
|
||||
/// Where the part/supplies were purchased from.
|
||||
/// </summary>
|
||||
public string PartSupplier { get; set; }
|
||||
/// <summary>
|
||||
/// Amount purchased, can be partial quantities such as fluids.
|
||||
/// </summary>
|
||||
public decimal Quantity { get; set; }
|
||||
/// <summary>
|
||||
/// Description of the part/supplies purchased.
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
/// <summary>
|
||||
/// How much it costs
|
||||
/// </summary>
|
||||
public decimal Cost { get; set; }
|
||||
/// <summary>
|
||||
/// Additional notes.
|
||||
/// </summary>
|
||||
public string Notes { get; set; }
|
||||
public List<UploadedFiles> Files { get; set; } = new List<UploadedFiles>();
|
||||
}
|
||||
}
|
||||
27
Models/Supply/SupplyRecordInput.cs
Normal file
27
Models/Supply/SupplyRecordInput.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace CarCareTracker.Models
|
||||
{
|
||||
public class SupplyRecordInput
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int VehicleId { get; set; }
|
||||
public string Date { get; set; } = DateTime.Now.ToShortDateString();
|
||||
public string PartNumber { get; set; }
|
||||
public string PartSupplier { get; set; }
|
||||
public decimal Quantity { get; set; }
|
||||
public string Description { get; set; }
|
||||
public decimal Cost { get; set; }
|
||||
public string Notes { get; set; }
|
||||
public List<UploadedFiles> Files { get; set; } = new List<UploadedFiles>();
|
||||
public SupplyRecord ToSupplyRecord() { return new SupplyRecord {
|
||||
Id = Id,
|
||||
VehicleId = VehicleId,
|
||||
Date = DateTime.Parse(Date),
|
||||
Cost = Cost,
|
||||
PartNumber = PartNumber,
|
||||
PartSupplier = PartSupplier,
|
||||
Quantity = Quantity,
|
||||
Description = Description,
|
||||
Notes = Notes,
|
||||
Files = Files }; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user