@opsregistry/contracts 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/finance/create-closing-receipt.d.ts +144 -0
- package/dist/finance/create-closing-receipt.d.ts.map +1 -0
- package/dist/finance/create-closing-receipt.js +31 -0
- package/dist/finance/create-closing-receipt.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a closing fiscal receipt for a payment that was originally fiscalized
|
|
4
|
+
* as a full prepayment, partial prepayment or advance.
|
|
5
|
+
*
|
|
6
|
+
* Use this operation when the first receipt confirmed receiving money, but the
|
|
7
|
+
* actual goods or services are transferred later and the settlement must be
|
|
8
|
+
* closed by a second fiscal receipt. This is intentionally separate from
|
|
9
|
+
* finance.fiscalReceipt.create so operation directories can show the legal
|
|
10
|
+
* difference between an ordinary receipt and a closing receipt.
|
|
11
|
+
*/
|
|
12
|
+
export declare const operationCode: "finance.fiscalReceipt.createClosing";
|
|
13
|
+
export declare const createClosingReceiptInputSchema: z.ZodObject<{
|
|
14
|
+
merchantReceiptId: z.ZodOptional<z.ZodString>;
|
|
15
|
+
merchantOrderId: z.ZodOptional<z.ZodString>;
|
|
16
|
+
merchantInn: z.ZodOptional<z.ZodString>;
|
|
17
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
18
|
+
sell: "sell";
|
|
19
|
+
sellReturn: "sellReturn";
|
|
20
|
+
buy: "buy";
|
|
21
|
+
buyReturn: "buyReturn";
|
|
22
|
+
}>>;
|
|
23
|
+
customer: z.ZodObject<{
|
|
24
|
+
customerId: z.ZodOptional<z.ZodString>;
|
|
25
|
+
name: z.ZodOptional<z.ZodString>;
|
|
26
|
+
email: z.ZodOptional<z.ZodEmail>;
|
|
27
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
taxationSystem: z.ZodEnum<{
|
|
30
|
+
osn: "osn";
|
|
31
|
+
usnIncome: "usnIncome";
|
|
32
|
+
usnIncomeOutcome: "usnIncomeOutcome";
|
|
33
|
+
esn: "esn";
|
|
34
|
+
patent: "patent";
|
|
35
|
+
}>;
|
|
36
|
+
items: z.ZodArray<z.ZodObject<{
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
price: z.ZodObject<{
|
|
39
|
+
amountMinor: z.ZodNumber;
|
|
40
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
quantity: z.ZodNumber;
|
|
43
|
+
amount: z.ZodObject<{
|
|
44
|
+
amountMinor: z.ZodNumber;
|
|
45
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
vat: z.ZodEnum<{
|
|
48
|
+
none: "none";
|
|
49
|
+
vat0: "vat0";
|
|
50
|
+
vat5: "vat5";
|
|
51
|
+
vat7: "vat7";
|
|
52
|
+
vat10: "vat10";
|
|
53
|
+
vat20: "vat20";
|
|
54
|
+
vat22: "vat22";
|
|
55
|
+
vat105: "vat105";
|
|
56
|
+
vat107: "vat107";
|
|
57
|
+
vat110: "vat110";
|
|
58
|
+
vat120: "vat120";
|
|
59
|
+
vat122: "vat122";
|
|
60
|
+
}>;
|
|
61
|
+
paymentMethod: z.ZodDefault<z.ZodEnum<{
|
|
62
|
+
fullPrepayment: "fullPrepayment";
|
|
63
|
+
prepayment: "prepayment";
|
|
64
|
+
advance: "advance";
|
|
65
|
+
fullPayment: "fullPayment";
|
|
66
|
+
partialPayment: "partialPayment";
|
|
67
|
+
credit: "credit";
|
|
68
|
+
creditPayment: "creditPayment";
|
|
69
|
+
}>>;
|
|
70
|
+
paymentObject: z.ZodDefault<z.ZodEnum<{
|
|
71
|
+
commodity: "commodity";
|
|
72
|
+
excise: "excise";
|
|
73
|
+
job: "job";
|
|
74
|
+
service: "service";
|
|
75
|
+
payment: "payment";
|
|
76
|
+
agentCommission: "agentCommission";
|
|
77
|
+
intellectualActivity: "intellectualActivity";
|
|
78
|
+
composite: "composite";
|
|
79
|
+
another: "another";
|
|
80
|
+
}>>;
|
|
81
|
+
unitCode: z.ZodOptional<z.ZodString>;
|
|
82
|
+
supplierInn: z.ZodOptional<z.ZodString>;
|
|
83
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
84
|
+
}, z.core.$strip>>;
|
|
85
|
+
amounts: z.ZodOptional<z.ZodObject<{
|
|
86
|
+
electronic: z.ZodOptional<z.ZodObject<{
|
|
87
|
+
amountMinor: z.ZodNumber;
|
|
88
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
89
|
+
}, z.core.$strip>>;
|
|
90
|
+
cash: z.ZodOptional<z.ZodObject<{
|
|
91
|
+
amountMinor: z.ZodNumber;
|
|
92
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
93
|
+
}, z.core.$strip>>;
|
|
94
|
+
advancePayment: z.ZodOptional<z.ZodObject<{
|
|
95
|
+
amountMinor: z.ZodNumber;
|
|
96
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
97
|
+
}, z.core.$strip>>;
|
|
98
|
+
credit: z.ZodOptional<z.ZodObject<{
|
|
99
|
+
amountMinor: z.ZodNumber;
|
|
100
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
101
|
+
}, z.core.$strip>>;
|
|
102
|
+
provision: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
amountMinor: z.ZodNumber;
|
|
104
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
105
|
+
}, z.core.$strip>>;
|
|
106
|
+
}, z.core.$strip>>;
|
|
107
|
+
calculationPlace: z.ZodOptional<z.ZodString>;
|
|
108
|
+
cashierName: z.ZodOptional<z.ZodString>;
|
|
109
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
110
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
111
|
+
providerPaymentId: z.ZodString;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
export declare const createClosingReceiptResultSchema: z.ZodObject<{
|
|
114
|
+
operationCode: z.ZodLiteral<"finance.fiscalReceipt.createClosing">;
|
|
115
|
+
accessModeUsed: z.ZodEnum<{
|
|
116
|
+
authorized: "authorized";
|
|
117
|
+
}>;
|
|
118
|
+
providerCode: z.ZodString;
|
|
119
|
+
providerReceiptId: z.ZodString;
|
|
120
|
+
providerPaymentId: z.ZodString;
|
|
121
|
+
merchantReceiptId: z.ZodOptional<z.ZodString>;
|
|
122
|
+
merchantOrderId: z.ZodOptional<z.ZodString>;
|
|
123
|
+
status: z.ZodEnum<{
|
|
124
|
+
unknown: "unknown";
|
|
125
|
+
failed: "failed";
|
|
126
|
+
queued: "queued";
|
|
127
|
+
processed: "processed";
|
|
128
|
+
}>;
|
|
129
|
+
fiscalDetails: z.ZodOptional<z.ZodObject<{
|
|
130
|
+
documentNumber: z.ZodOptional<z.ZodString>;
|
|
131
|
+
fiscalSign: z.ZodOptional<z.ZodString>;
|
|
132
|
+
fiscalNumber: z.ZodOptional<z.ZodString>;
|
|
133
|
+
deviceNumber: z.ZodOptional<z.ZodString>;
|
|
134
|
+
regNumber: z.ZodOptional<z.ZodString>;
|
|
135
|
+
receiptUrl: z.ZodOptional<z.ZodURL>;
|
|
136
|
+
qrCodeUrl: z.ZodOptional<z.ZodURL>;
|
|
137
|
+
issuedAt: z.ZodOptional<z.ZodString>;
|
|
138
|
+
}, z.core.$strip>>;
|
|
139
|
+
message: z.ZodOptional<z.ZodString>;
|
|
140
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
141
|
+
}, z.core.$strip>;
|
|
142
|
+
export type CreateClosingReceiptInput = z.infer<typeof createClosingReceiptInputSchema>;
|
|
143
|
+
export type CreateClosingReceiptResult = z.infer<typeof createClosingReceiptResultSchema>;
|
|
144
|
+
//# sourceMappingURL=create-closing-receipt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-closing-receipt.d.ts","sourceRoot":"","sources":["../../src/finance/create-closing-receipt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,EAAG,qCAA8C,CAAC;AAE5E,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAE1C,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAY3C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,+BAA+B,CACtC,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,gCAAgC,CACvC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { metadataSchema, operationAccessModeSchema } from './common.js';
|
|
3
|
+
import { receiptDraftSchema, receiptFiscalDetailsSchema, receiptStatusSchema } from './receipt-common.js';
|
|
4
|
+
/**
|
|
5
|
+
* Creates a closing fiscal receipt for a payment that was originally fiscalized
|
|
6
|
+
* as a full prepayment, partial prepayment or advance.
|
|
7
|
+
*
|
|
8
|
+
* Use this operation when the first receipt confirmed receiving money, but the
|
|
9
|
+
* actual goods or services are transferred later and the settlement must be
|
|
10
|
+
* closed by a second fiscal receipt. This is intentionally separate from
|
|
11
|
+
* finance.fiscalReceipt.create so operation directories can show the legal
|
|
12
|
+
* difference between an ordinary receipt and a closing receipt.
|
|
13
|
+
*/
|
|
14
|
+
export const operationCode = 'finance.fiscalReceipt.createClosing';
|
|
15
|
+
export const createClosingReceiptInputSchema = receiptDraftSchema.extend({
|
|
16
|
+
providerPaymentId: z.string().min(1)
|
|
17
|
+
});
|
|
18
|
+
export const createClosingReceiptResultSchema = z.object({
|
|
19
|
+
operationCode: z.literal(operationCode),
|
|
20
|
+
accessModeUsed: operationAccessModeSchema,
|
|
21
|
+
providerCode: z.string().min(1),
|
|
22
|
+
providerReceiptId: z.string().min(1),
|
|
23
|
+
providerPaymentId: z.string().min(1),
|
|
24
|
+
merchantReceiptId: z.string().min(1).optional(),
|
|
25
|
+
merchantOrderId: z.string().min(1).optional(),
|
|
26
|
+
status: receiptStatusSchema,
|
|
27
|
+
fiscalDetails: receiptFiscalDetailsSchema.optional(),
|
|
28
|
+
message: z.string().min(1).optional(),
|
|
29
|
+
metadata: metadataSchema
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=create-closing-receipt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-closing-receipt.js","sourceRoot":"","sources":["../../src/finance/create-closing-receipt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EACN,kBAAkB,EAClB,0BAA0B,EAC1B,mBAAmB,EACnB,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,qCAA8C,CAAC;AAE5E,MAAM,CAAC,MAAM,+BAA+B,GAAG,kBAAkB,CAAC,MAAM,CAAC;IACxE,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACpC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IACvC,cAAc,EAAE,yBAAyB;IACzC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/B,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC/C,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC7C,MAAM,EAAE,mBAAmB;IAC3B,aAAa,EAAE,0BAA0B,CAAC,QAAQ,EAAE;IACpD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACrC,QAAQ,EAAE,cAAc;CACxB,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,5 +7,6 @@ export * as financeGetPaymentStatus from './finance/get-payment-status.js';
|
|
|
7
7
|
export * as financeCancelPayment from './finance/cancel-payment.js';
|
|
8
8
|
export * as financeReceiptCommon from './finance/receipt-common.js';
|
|
9
9
|
export * as financeCreateReceipt from './finance/create-receipt.js';
|
|
10
|
+
export * as financeCreateClosingReceipt from './finance/create-closing-receipt.js';
|
|
10
11
|
export * as financeGetReceiptStatus from './finance/get-receipt-status.js';
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,sBAAsB,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,sBAAsB,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,uBAAuB,MAAM,iCAAiC,CAAC;AAC3E,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,uBAAuB,MAAM,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,sBAAsB,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,sBAAsB,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,uBAAuB,MAAM,iCAAiC,CAAC;AAC3E,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,2BAA2B,MAAM,qCAAqC,CAAC;AACnF,OAAO,KAAK,uBAAuB,MAAM,iCAAiC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,5 +7,6 @@ export * as financeGetPaymentStatus from './finance/get-payment-status.js';
|
|
|
7
7
|
export * as financeCancelPayment from './finance/cancel-payment.js';
|
|
8
8
|
export * as financeReceiptCommon from './finance/receipt-common.js';
|
|
9
9
|
export * as financeCreateReceipt from './finance/create-receipt.js';
|
|
10
|
+
export * as financeCreateClosingReceipt from './finance/create-closing-receipt.js';
|
|
10
11
|
export * as financeGetReceiptStatus from './finance/get-receipt-status.js';
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,sBAAsB,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,sBAAsB,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,uBAAuB,MAAM,iCAAiC,CAAC;AAC3E,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,uBAAuB,MAAM,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,sBAAsB,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,sBAAsB,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,uBAAuB,MAAM,iCAAiC,CAAC;AAC3E,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,2BAA2B,MAAM,qCAAqC,CAAC;AACnF,OAAO,KAAK,uBAAuB,MAAM,iCAAiC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opsregistry/contracts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Operation specifications and shared schemas for opsregistry.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -52,6 +52,10 @@
|
|
|
52
52
|
"types": "./dist/finance/create-receipt.d.ts",
|
|
53
53
|
"import": "./dist/finance/create-receipt.js"
|
|
54
54
|
},
|
|
55
|
+
"./finance/create-closing-receipt": {
|
|
56
|
+
"types": "./dist/finance/create-closing-receipt.d.ts",
|
|
57
|
+
"import": "./dist/finance/create-closing-receipt.js"
|
|
58
|
+
},
|
|
55
59
|
"./finance/get-receipt-status": {
|
|
56
60
|
"types": "./dist/finance/get-receipt-status.d.ts",
|
|
57
61
|
"import": "./dist/finance/get-receipt-status.js"
|