Created
October 2, 2020 15:41
-
-
Save carneirocorp/4d63e6e20b29dacad6c11082c641fc74 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Google.Apis.Auth.OAuth2.Responses; | |
using Newtonsoft.Json; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace Oba.Services.API.Models.Request | |
{ | |
public class Header | |
{ | |
[JsonProperty("AccountingDate")] | |
public DateTime AccountingDate { get; set; } | |
[JsonProperty("DateTimeIssue")] | |
public DateTime DateTimeIssue { get; set; } | |
[JsonProperty("IdDocument")] | |
public int IdDocument { get; set; } | |
[JsonProperty("IdStore")] | |
public int IdStore { get; set; } | |
[JsonProperty("IdTerminal")] | |
public int IdTerminal { get; set; } | |
[JsonProperty("IdUser")] | |
public int IdUser { get; set; } | |
[JsonProperty("Identification")] | |
public List<object> Identification { get; set; } | |
[JsonProperty("Status")] | |
public string Status { get; set; } | |
} | |
public class Item | |
{ | |
[JsonProperty("BarCode")] | |
public string BarCode { get; set; } | |
[JsonProperty("CaptionPacking")] | |
public string CaptionPacking { get; set; } | |
[JsonProperty("Description")] | |
public string Description { get; set; } | |
[JsonProperty("DiscountPrice")] | |
public double DiscountPrice { get; set; } | |
[JsonProperty("IncreasePrice")] | |
public double IncreasePrice { get; set; } | |
[JsonProperty("InternalCode")] | |
public string InternalCode { get; set; } | |
[JsonProperty("ItemNumber")] | |
public int ItemNumber { get; set; } | |
[JsonProperty("PackingQuantity")] | |
public double PackingQuantity { get; set; } | |
[JsonProperty("PartitionDiscount")] | |
public List<object> PartitionDiscount { get; set; } | |
[JsonProperty("PartitionIncrease")] | |
public List<object> PartitionIncrease { get; set; } | |
[JsonProperty("Quantity")] | |
public double Quantity { get; set; } | |
[JsonProperty("Status")] | |
public string Status { get; set; } | |
[JsonProperty("TotalPrice")] | |
public double TotalPrice { get; set; } | |
[JsonProperty("UnitPrice")] | |
public double UnitPrice { get; set; } | |
public static Response.Item ToResponse(Request.Item item) | |
{ | |
return new Response.Item | |
{ | |
DiscountAmount = item.DiscountPrice, | |
IncreasePrice = item.IncreasePrice, | |
ItemNumber = item.ItemNumber, | |
PackingQuantity = item.PackingQuantity, | |
Quantity = item.Quantity, | |
Status = item.Status, | |
TotalPrice = item.TotalPrice, | |
UnitPrice = item.UnitPrice, | |
}; | |
} | |
} | |
public class Messages | |
{ | |
[JsonProperty("Customer")] | |
public List<object> Customer { get; set; } | |
[JsonProperty("User")] | |
public List<object> User { get; set; } | |
} | |
public class Payment | |
{ | |
[JsonProperty("AuthorizationCode")] | |
public string AuthorizationCode { get; set; } | |
[JsonProperty("Discount")] | |
public double Discount { get; set; } | |
[JsonProperty("Increase")] | |
public double Increase { get; set; } | |
[JsonProperty("ItemNumber")] | |
public int ItemNumber { get; set; } | |
[JsonProperty("PartitionDiscount")] | |
public List<object> PartitionDiscount { get; set; } | |
[JsonProperty("PartitionIncrease")] | |
public List<object> PartitionIncrease { get; set; } | |
[JsonProperty("PaymentNumber")] | |
public int PaymentNumber { get; set; } = 1; | |
[JsonProperty("PaymentType")] | |
public string PaymentType { get; set; } | |
[JsonProperty("Total")] | |
public double Total { get; set; } | |
} | |
public class Sale | |
{ | |
[JsonProperty("Discount")] | |
public double Discount { get; set; } | |
[JsonProperty("DiscountCodes")] | |
public List<object> DiscountCodes { get; set; } | |
[JsonProperty("Header")] | |
public Header Header { get; set; } | |
[JsonProperty("ID")] | |
public string ID { get; set; } | |
[JsonProperty("Increase")] | |
public double Increase { get; set; } | |
[JsonProperty("Items")] | |
public List<Item> Items { get; set; } | |
[JsonProperty("Messages")] | |
public Messages Messages { get; set; } | |
[JsonProperty("PartitionDiscount")] | |
public List<object> PartitionDiscount { get; set; } | |
[JsonProperty("PartitionIncrease")] | |
public List<object> PartitionIncrease { get; set; } | |
[JsonProperty("PaymentChange")] | |
public object PaymentChange { get; set; } | |
[JsonProperty("Payments")] | |
public List<Payment> Payments { get; set; } | |
[JsonProperty("SolidaryChange")] | |
public object SolidaryChange { get; set; } | |
[JsonProperty("Total")] | |
public double Total { get; set; } | |
[JsonProperty("VouchersPrint")] | |
public List<object> VouchersPrint { get; set; } | |
} | |
public class PdvRequestPay | |
{ | |
public string AuthorizationCode { get; set; } | |
public double Discount { get; set; } | |
public object Identification { get; set; } | |
public double Increase { get; set; } | |
public double PaymentNumber { get; set; } | |
public double Total { get; set; } | |
public string[] VouchersPrint { get; set; } | |
} | |
public class PdvRequest | |
{ | |
[JsonProperty("Event")] | |
public string Event { get; set; } | |
[JsonProperty("Execution")] | |
public string Execution { get; set; } | |
[JsonProperty("ID")] | |
public string ID { get; set; } | |
[JsonProperty("Operation")] | |
public string Operation { get; set; } | |
[JsonProperty("ParkingTicket")] | |
public object ParkingTicket { get; set; } | |
[JsonProperty("Pay")] | |
public PdvRequestPay Pay { get; set; } | |
[JsonProperty("Response")] | |
public string Response { get; set; } | |
[JsonProperty("Sale")] | |
public Sale Sale { get; set; } | |
[JsonProperty("Version")] | |
public int Version { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment