-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathitem.model.js
More file actions
81 lines (81 loc) · 3.33 KB
/
Copy pathitem.model.js
File metadata and controls
81 lines (81 loc) · 3.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Item = void 0;
const class_validator_1 = require("class-validator");
require("reflect-metadata");
/**
* Class Item
*
* This class defines payment item details.
*
* @see https://paytrail.github.io/api-documentation/#/?id=item
*/
class Item {
}
exports.Item = Item;
__decorate([
(0, class_validator_1.IsNotEmpty)(),
(0, class_validator_1.IsNumber)(),
__metadata("design:type", Number)
], Item.prototype, "unitPrice", void 0);
__decorate([
(0, class_validator_1.IsNotEmpty)(),
(0, class_validator_1.IsNumber)(),
(0, class_validator_1.Min)(0),
__metadata("design:type", Number)
], Item.prototype, "units", void 0);
__decorate([
(0, class_validator_1.IsNumber)({ maxDecimalPlaces: 1 }, { message: 'VAT percentage values between 0 and 100 are allowed with one number in decimal part' }),
(0, class_validator_1.Min)(0, { message: 'VAT percentage values between 0 and 100 are allowed with one number in decimal part' }),
(0, class_validator_1.Max)(100, { message: 'VAT percentage values between 0 and 100 are allowed with one number in decimal part' }),
__metadata("design:type", Number)
], Item.prototype, "vatPercentage", void 0);
__decorate([
(0, class_validator_1.IsNotEmpty)(),
(0, class_validator_1.Length)(1, 100),
__metadata("design:type", String)
], Item.prototype, "productCode", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], Item.prototype, "deliveryDate", void 0);
__decorate([
(0, class_validator_1.Length)(0, 1000),
(0, class_validator_1.IsOptional)(),
__metadata("design:type", String)
], Item.prototype, "description", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.Length)(0, 100),
__metadata("design:type", String)
], Item.prototype, "category", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], Item.prototype, "orderId", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.Length)(0, 50),
__metadata("design:type", String)
], Item.prototype, "stamp", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.Length)(0, 50),
__metadata("design:type", String)
], Item.prototype, "reference", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.Length)(0, 50),
__metadata("design:type", String)
], Item.prototype, "merchant", void 0);