@reservation-studio/electron-types
Version:
TypeScript типове за ReservationStudioElectron
171 lines (170 loc) • 3.92 kB
TypeScript
import { BarcodeData, OperatorInfo } from './shared.types';
/**
* Common payload fields shared by fiscal and non-fiscal receipts.
*/
export interface BaseReceipt {
/**
* Operator information
*/
operator: OperatorInfo;
/**
* The items in the receipt
*/
items: FiscalReceiptItem[];
/**
* The client information (for invoice receipts)
*/
client?: FiscalClient;
/**
* Optional text lines to be printed immediately after the receipt header.
*/
headerText?: string[];
/**
* Optional text lines to be printed at the end of the receipt (before payments).
*/
footerText?: string[];
/**
* Optional barcode to be printed at the end of the receipt (footer).
* Useful for loyalty programs, order tracking, or return vouchers.
*/
footerBarcode?: BarcodeData;
}
/**
* Interface for fiscal receipt
*/
export interface FiscalReceipt extends BaseReceipt {
/**
* Numeric string up to 7 digits, used as part of the UNP.
*/
uniqueSaleNumber: string;
/**
* The payments in the receipt. The total must cover the receipt amount to close.
*/
payments: FiscalPayment[];
}
/**
* Interface for non-fiscal (service) receipt
*/
export interface NonFiscalReceipt extends BaseReceipt {
/**
* Optional informational payments printed on the receipt.
*/
payments?: FiscalPayment[];
}
/**
* Interface for fiscal receipt item
*/
export interface FiscalReceiptItem {
/**
* The name of the item
*/
name: string;
/**
* Optional description providing additional information or context.
* This can be used to supply user-friendly details or explanations
* associated with a particular resource, item, or operation.
*/
description?: string;
/**
* The price of the item including tax (VAT inclusive).
* This price will be sent directly to the fiscal device and must include all applicable taxes.
*/
unitPrice: number;
/**
* The quantity of the item
*/
quantity: number;
/**
* The VAT group of the item
*/
vatGroup: FiscalVATGroup;
/**
* Discount percentage (optional). Use 0-100, no surcharges.
*/
discount?: number;
}
/**
* Interface for fiscal payment
*/
export interface FiscalPayment {
/**
* The payment type
*/
type: FiscalPaymentType;
/**
* The amount of the payment
*/
amount: number;
}
/**
* Enum for fiscal payment types
*/
export declare enum FiscalPaymentType {
CASH = "cash",
CARD = "card",
CHECK = "check",
TRANSFER = "transfer"
}
/**
* Interface for fiscal client information
*/
export interface FiscalClient {
/**
* The name of the client
*/
name: string;
/**
* The address of the client
*/
address?: string;
/**
* The tax number of the client
*/
taxNumber?: string;
/**
* The VAT number of the client
*/
vatNumber?: string;
}
/**
* Interface for reversal receipt
*/
export interface ReversalReceipt extends FiscalReceipt {
/**
* The reason for the reversal
*/
reason: ReversalReason;
/**
* The original receipt number
*/
originalReceiptNumber: string;
/**
* The original receipt date and time
*/
originalReceiptDateTime: Date;
/**
* The original fiscal memory serial number
*/
originalFiscalMemorySerialNumber: string;
}
/**
* Enum for reversal reasons
*/
export declare enum ReversalReason {
VOID = "void",
REFUND = "refund",
TAX_BASE_REDUCTION = "tax-base-reduction"
}
/**
* Enum for fiscal VAT groups
*/
export declare enum FiscalVATGroup {
A = "1",// 20%
B = "2",// 9%
C = "3",// 0%
D = "4",// Exempt
E = "5",// Special rate 1
F = "6",// Special rate 2
G = "7",// Special rate 3
H = "8"
}