use crate::wire::OperationCode;
use serde::{Deserialize, Serialize};
use super::{EmptyResponse, Operation};
#[derive(Debug, Clone, Serialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
pub struct DateTimeRequest {}
impl Operation for DateTimeRequest {
const CODE: OperationCode = OperationCode::DateTime;
type Response = DateTimeResponse;
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub struct DateTimeResponse {
pub dt: String,
}
#[derive(Debug, Clone, Serialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
pub struct ReceiptSampleRequest {}
impl Operation for ReceiptSampleRequest {
const CODE: OperationCode = OperationCode::ReceiptSample;
type Response = EmptyResponse;
}
#[derive(Debug, Clone, Serialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
pub struct HdmTimeSyncRequest {}
impl Operation for HdmTimeSyncRequest {
const CODE: OperationCode = OperationCode::HdmTimeSync;
type Response = EmptyResponse;
}
#[derive(Debug, Clone, Serialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
pub struct PaymentSystemsListRequest {}
impl Operation for PaymentSystemsListRequest {
const CODE: OperationCode = OperationCode::PaymentSystemsList;
type Response = PaymentSystemsListResponse;
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub struct PaymentSystemsListResponse {
#[serde(rename = "PaymentSystems", default)]
pub payment_systems: Vec<PaymentSystemEntry>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub struct PaymentSystemEntry {
pub code: u32,
#[serde(default)]
pub name: String,
}
#[derive(Debug, Clone, Serialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
pub struct SingleEmarkRequest {
#[serde(rename = "eMark")]
pub e_mark: String,
}
impl Operation for SingleEmarkRequest {
const CODE: OperationCode = OperationCode::SingleEmark;
type Response = EmptyResponse;
}