@intelact/gnosa 0.1.0 → 0.1.1

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.
Files changed (71) hide show
  1. package/lib/book/book.dto.d.ts +199 -0
  2. package/lib/book/book.dto.js +461 -0
  3. package/lib/book/book.dto.js.map +1 -0
  4. package/lib/book/book.model.d.ts +90 -0
  5. package/lib/book/book.model.js +262 -0
  6. package/lib/book/book.model.js.map +1 -0
  7. package/lib/discover/discover.dto.d.ts +38 -0
  8. package/lib/discover/discover.dto.js +99 -0
  9. package/lib/discover/discover.dto.js.map +1 -0
  10. package/lib/discover/discover.model.d.ts +30 -0
  11. package/lib/discover/discover.model.js +81 -0
  12. package/lib/discover/discover.model.js.map +1 -0
  13. package/lib/event/event.dto.d.ts +128 -0
  14. package/lib/event/event.dto.js +328 -0
  15. package/lib/event/event.dto.js.map +1 -0
  16. package/lib/event/event.enum.d.ts +16 -0
  17. package/lib/event/event.enum.js +22 -0
  18. package/lib/event/event.enum.js.map +1 -0
  19. package/lib/event/event.model.d.ts +78 -0
  20. package/lib/event/event.model.js +216 -0
  21. package/lib/event/event.model.js.map +1 -0
  22. package/lib/foundation/history.dto.d.ts +27 -0
  23. package/lib/foundation/history.dto.js +102 -0
  24. package/lib/foundation/history.dto.js.map +1 -0
  25. package/lib/foundation/history.model.d.ts +30 -0
  26. package/lib/foundation/history.model.js +82 -0
  27. package/lib/foundation/history.model.js.map +1 -0
  28. package/lib/foundation/partner.dto.d.ts +22 -0
  29. package/lib/foundation/partner.dto.js +92 -0
  30. package/lib/foundation/partner.dto.js.map +1 -0
  31. package/lib/foundation/partner.model.d.ts +30 -0
  32. package/lib/foundation/partner.model.js +82 -0
  33. package/lib/foundation/partner.model.js.map +1 -0
  34. package/lib/foundation/person.dto.d.ts +31 -0
  35. package/lib/foundation/person.dto.js +106 -0
  36. package/lib/foundation/person.dto.js.map +1 -0
  37. package/lib/foundation/person.model.d.ts +28 -0
  38. package/lib/foundation/person.model.js +80 -0
  39. package/lib/foundation/person.model.js.map +1 -0
  40. package/lib/general/language.dto.d.ts +7 -0
  41. package/lib/general/language.dto.js +26 -0
  42. package/lib/general/language.dto.js.map +1 -0
  43. package/lib/general/sort.dto.d.ts +7 -0
  44. package/lib/general/sort.dto.js +30 -0
  45. package/lib/general/sort.dto.js.map +1 -0
  46. package/lib/general/translations.d.ts +6 -0
  47. package/lib/general/translations.js +3 -0
  48. package/lib/general/translations.js.map +1 -0
  49. package/lib/index.d.ts +20 -0
  50. package/lib/index.js +20 -0
  51. package/lib/index.js.map +1 -1
  52. package/lib/magazine/magazine.dto.d.ts +132 -0
  53. package/lib/magazine/magazine.dto.js +313 -0
  54. package/lib/magazine/magazine.dto.js.map +1 -0
  55. package/lib/magazine/magazine.model.d.ts +88 -0
  56. package/lib/magazine/magazine.model.js +232 -0
  57. package/lib/magazine/magazine.model.js.map +1 -0
  58. package/lib/order/order.dto.d.ts +96 -0
  59. package/lib/order/order.dto.js +297 -0
  60. package/lib/order/order.dto.js.map +1 -0
  61. package/lib/order/order.enum.d.ts +10 -2
  62. package/lib/order/order.enum.js +12 -3
  63. package/lib/order/order.enum.js.map +1 -1
  64. package/lib/order/order.model.d.ts +168 -0
  65. package/lib/order/order.model.js +427 -0
  66. package/lib/order/order.model.js.map +1 -0
  67. package/lib/tsconfig.tsbuildinfo +1 -1
  68. package/lib/utils/transformers.helper.d.ts +7 -0
  69. package/lib/utils/transformers.helper.js +24 -0
  70. package/lib/utils/transformers.helper.js.map +1 -1
  71. package/package.json +1 -1
@@ -0,0 +1,96 @@
1
+ import { Currency, OrderItemType, OrderStatus } from './order.enum';
2
+ /**
3
+ * A publication in the cart: which one, how many, and the unit price the cart shows for it.
4
+ */
5
+ export declare class CartItemDto {
6
+ type: OrderItemType;
7
+ slug: string;
8
+ /**
9
+ * A whole number from 1 to 999.
10
+ */
11
+ quantity: number;
12
+ /**
13
+ * The VAT-inclusive unit price the cart shows, in the cart currency. When the current price
14
+ * differs, the line is flagged and an order isn't placed.
15
+ */
16
+ unitPrice: number;
17
+ constructor(props?: Partial<CartItemDto>);
18
+ }
19
+ /**
20
+ * The website's cart, to price: its currency, its items, and optionally the delivery country, to add
21
+ * the shipping and the total.
22
+ */
23
+ export declare class CartDto {
24
+ currency: Currency;
25
+ items: CartItemDto[];
26
+ /**
27
+ * The delivery country's ISO code (`DE`), one of the shipping countries.
28
+ */
29
+ country?: string;
30
+ constructor(props?: Partial<CartDto>);
31
+ }
32
+ /**
33
+ * A postal address entered at checkout.
34
+ */
35
+ export declare class AddressDto {
36
+ line1: string;
37
+ line2?: string;
38
+ postcode: string;
39
+ city: string;
40
+ /**
41
+ * State or province, required for the shipping countries which need one.
42
+ */
43
+ state?: string;
44
+ /**
45
+ * ISO 3166-1 alpha-2 country code (`DE`).
46
+ */
47
+ country: string;
48
+ constructor(props?: Partial<AddressDto>);
49
+ }
50
+ /**
51
+ * The Checkout form: the cart, the customer, the addresses and the two acknowledgements. The order is
52
+ * shipped to `shippingAddress.country`, which has to be one of the shipping countries.
53
+ */
54
+ export declare class CheckoutDto {
55
+ currency: Currency;
56
+ items: CartItemDto[];
57
+ firstName: string;
58
+ lastName: string;
59
+ email: string;
60
+ phone: string;
61
+ shippingAddress: AddressDto;
62
+ /**
63
+ * Always complete. When the customer chooses the shipping address for billing, the website sends
64
+ * the shipping address here too.
65
+ */
66
+ billingAddress: AddressDto;
67
+ acceptsPrivacyPolicy: boolean;
68
+ acceptsTerms: boolean;
69
+ constructor(props?: Partial<CheckoutDto>);
70
+ }
71
+ /**
72
+ * Marks an order as shipped, with an optional tracking URL for the shipment email.
73
+ */
74
+ export declare class ShipOrderDto {
75
+ trackingUrl?: string;
76
+ constructor(props?: Partial<ShipOrderDto>);
77
+ }
78
+ /**
79
+ * The search and filters of the admin Orders List.
80
+ */
81
+ export declare class OrderFilterDto {
82
+ /**
83
+ * Matches the order reference, the customer's name or the customer's email.
84
+ */
85
+ phrase?: string;
86
+ status?: OrderStatus;
87
+ /**
88
+ * Orders placed at or after this time, in UTC.
89
+ */
90
+ from?: Date;
91
+ /**
92
+ * Orders placed at or before this time, in UTC.
93
+ */
94
+ to?: Date;
95
+ constructor(props?: Partial<OrderFilterDto>);
96
+ }
@@ -0,0 +1,297 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.OrderFilterDto = exports.ShipOrderDto = exports.CheckoutDto = exports.AddressDto = exports.CartDto = exports.CartItemDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const common_1 = require("@intelact/common");
15
+ const class_transformer_1 = require("class-transformer");
16
+ const transformers_helper_1 = require("../utils/transformers.helper");
17
+ const order_enum_1 = require("./order.enum");
18
+ /**
19
+ * A publication in the cart: which one, how many, and the unit price the cart shows for it.
20
+ */
21
+ class CartItemDto {
22
+ type;
23
+ slug;
24
+ /**
25
+ * A whole number from 1 to 999.
26
+ */
27
+ quantity;
28
+ /**
29
+ * The VAT-inclusive unit price the cart shows, in the cart currency. When the current price
30
+ * differs, the line is flagged and an order isn't placed.
31
+ */
32
+ unitPrice;
33
+ constructor(props) {
34
+ Object.assign(this, props);
35
+ }
36
+ }
37
+ exports.CartItemDto = CartItemDto;
38
+ __decorate([
39
+ (0, class_validator_1.IsEnum)(order_enum_1.OrderItemType, { message: 'gnosa.validation.order.items' }),
40
+ __metadata("design:type", String)
41
+ ], CartItemDto.prototype, "type", void 0);
42
+ __decorate([
43
+ (0, class_validator_1.IsNotEmpty)({ message: 'gnosa.validation.order.items' }),
44
+ (0, class_validator_1.IsString)({ message: 'gnosa.validation.order.items' }),
45
+ __metadata("design:type", String)
46
+ ], CartItemDto.prototype, "slug", void 0);
47
+ __decorate([
48
+ (0, class_validator_1.IsInt)({ message: 'gnosa.validation.order.quantity' }),
49
+ (0, class_validator_1.Min)(1, { message: 'gnosa.validation.order.quantity' }),
50
+ (0, class_validator_1.Max)(999, { message: 'gnosa.validation.order.quantity' }),
51
+ __metadata("design:type", Number)
52
+ ], CartItemDto.prototype, "quantity", void 0);
53
+ __decorate([
54
+ (0, class_validator_1.IsNumber)({ maxDecimalPlaces: 2 }, { message: 'gnosa.validation.order.items' }),
55
+ __metadata("design:type", Number)
56
+ ], CartItemDto.prototype, "unitPrice", void 0);
57
+ /**
58
+ * The website's cart, to price: its currency, its items, and optionally the delivery country, to add
59
+ * the shipping and the total.
60
+ */
61
+ class CartDto {
62
+ currency;
63
+ items;
64
+ /**
65
+ * The delivery country's ISO code (`DE`), one of the shipping countries.
66
+ */
67
+ country;
68
+ constructor(props) {
69
+ Object.assign(this, props);
70
+ }
71
+ }
72
+ exports.CartDto = CartDto;
73
+ __decorate([
74
+ (0, class_validator_1.IsEnum)(order_enum_1.Currency, { message: 'gnosa.validation.order.currency' }),
75
+ __metadata("design:type", String)
76
+ ], CartDto.prototype, "currency", void 0);
77
+ __decorate([
78
+ (0, class_validator_1.IsArray)({ message: 'gnosa.validation.order.items' }),
79
+ (0, class_validator_1.ArrayMaxSize)(100, { message: 'gnosa.validation.order.items' }),
80
+ (0, class_validator_1.ValidateNested)({ each: true }),
81
+ (0, class_transformer_1.Type)(() => CartItemDto),
82
+ __metadata("design:type", Array)
83
+ ], CartDto.prototype, "items", void 0);
84
+ __decorate([
85
+ (0, class_validator_1.IsOptional)(),
86
+ (0, class_validator_1.IsISO31661Alpha2)({ message: 'gnosa.validation.order.country' }),
87
+ __metadata("design:type", String)
88
+ ], CartDto.prototype, "country", void 0);
89
+ /**
90
+ * A postal address entered at checkout.
91
+ */
92
+ class AddressDto {
93
+ line1;
94
+ line2;
95
+ postcode;
96
+ city;
97
+ /**
98
+ * State or province, required for the shipping countries which need one.
99
+ */
100
+ state;
101
+ /**
102
+ * ISO 3166-1 alpha-2 country code (`DE`).
103
+ */
104
+ country;
105
+ constructor(props) {
106
+ Object.assign(this, props);
107
+ }
108
+ }
109
+ exports.AddressDto = AddressDto;
110
+ __decorate([
111
+ (0, class_validator_1.IsNotEmpty)({ message: 'gnosa.validation.address.line1' }),
112
+ (0, class_validator_1.IsString)({ message: 'gnosa.validation.address.line1' }),
113
+ (0, class_validator_1.MaxLength)(255, { message: 'gnosa.validation.address.line1' }),
114
+ (0, common_1.Trim)(),
115
+ __metadata("design:type", String)
116
+ ], AddressDto.prototype, "line1", void 0);
117
+ __decorate([
118
+ (0, class_validator_1.IsOptional)(),
119
+ (0, class_validator_1.IsString)({ message: 'gnosa.validation.address.line2' }),
120
+ (0, class_validator_1.MaxLength)(255, { message: 'gnosa.validation.address.line2' }),
121
+ (0, common_1.Trim)(),
122
+ __metadata("design:type", String)
123
+ ], AddressDto.prototype, "line2", void 0);
124
+ __decorate([
125
+ (0, class_validator_1.IsNotEmpty)({ message: 'gnosa.validation.address.postcode' }),
126
+ (0, class_validator_1.IsString)({ message: 'gnosa.validation.address.postcode' }),
127
+ (0, class_validator_1.MaxLength)(32, { message: 'gnosa.validation.address.postcode' }),
128
+ (0, common_1.Trim)(),
129
+ __metadata("design:type", String)
130
+ ], AddressDto.prototype, "postcode", void 0);
131
+ __decorate([
132
+ (0, class_validator_1.IsNotEmpty)({ message: 'gnosa.validation.address.city' }),
133
+ (0, class_validator_1.IsString)({ message: 'gnosa.validation.address.city' }),
134
+ (0, class_validator_1.MaxLength)(255, { message: 'gnosa.validation.address.city' }),
135
+ (0, common_1.Trim)(),
136
+ __metadata("design:type", String)
137
+ ], AddressDto.prototype, "city", void 0);
138
+ __decorate([
139
+ (0, class_validator_1.IsOptional)(),
140
+ (0, class_validator_1.IsString)({ message: 'gnosa.validation.address.state' }),
141
+ (0, class_validator_1.MaxLength)(255, { message: 'gnosa.validation.address.state' }),
142
+ (0, common_1.Trim)(),
143
+ __metadata("design:type", String)
144
+ ], AddressDto.prototype, "state", void 0);
145
+ __decorate([
146
+ (0, class_validator_1.IsNotEmpty)({ message: 'gnosa.validation.address.country' }),
147
+ (0, class_validator_1.IsISO31661Alpha2)({ message: 'gnosa.validation.address.country' }),
148
+ __metadata("design:type", String)
149
+ ], AddressDto.prototype, "country", void 0);
150
+ /**
151
+ * The Checkout form: the cart, the customer, the addresses and the two acknowledgements. The order is
152
+ * shipped to `shippingAddress.country`, which has to be one of the shipping countries.
153
+ */
154
+ class CheckoutDto {
155
+ currency;
156
+ items;
157
+ firstName;
158
+ lastName;
159
+ email;
160
+ phone;
161
+ shippingAddress;
162
+ /**
163
+ * Always complete. When the customer chooses the shipping address for billing, the website sends
164
+ * the shipping address here too.
165
+ */
166
+ billingAddress;
167
+ acceptsPrivacyPolicy;
168
+ acceptsTerms;
169
+ constructor(props) {
170
+ Object.assign(this, props);
171
+ }
172
+ }
173
+ exports.CheckoutDto = CheckoutDto;
174
+ __decorate([
175
+ (0, class_validator_1.IsEnum)(order_enum_1.Currency, { message: 'gnosa.validation.order.currency' }),
176
+ __metadata("design:type", String)
177
+ ], CheckoutDto.prototype, "currency", void 0);
178
+ __decorate([
179
+ (0, class_validator_1.IsArray)({ message: 'gnosa.validation.order.items' }),
180
+ (0, class_validator_1.ArrayMinSize)(1, { message: 'gnosa.validation.order.items' }),
181
+ (0, class_validator_1.ArrayMaxSize)(100, { message: 'gnosa.validation.order.items' }),
182
+ (0, class_validator_1.ValidateNested)({ each: true }),
183
+ (0, class_transformer_1.Type)(() => CartItemDto),
184
+ __metadata("design:type", Array)
185
+ ], CheckoutDto.prototype, "items", void 0);
186
+ __decorate([
187
+ (0, class_validator_1.IsNotEmpty)({ message: 'gnosa.validation.order.firstName' }),
188
+ (0, class_validator_1.IsString)({ message: 'gnosa.validation.order.firstName' }),
189
+ (0, class_validator_1.MaxLength)(255, { message: 'gnosa.validation.order.firstName' }),
190
+ (0, common_1.Trim)(),
191
+ __metadata("design:type", String)
192
+ ], CheckoutDto.prototype, "firstName", void 0);
193
+ __decorate([
194
+ (0, class_validator_1.IsNotEmpty)({ message: 'gnosa.validation.order.lastName' }),
195
+ (0, class_validator_1.IsString)({ message: 'gnosa.validation.order.lastName' }),
196
+ (0, class_validator_1.MaxLength)(255, { message: 'gnosa.validation.order.lastName' }),
197
+ (0, common_1.Trim)(),
198
+ __metadata("design:type", String)
199
+ ], CheckoutDto.prototype, "lastName", void 0);
200
+ __decorate([
201
+ (0, class_validator_1.IsNotEmpty)({ message: 'gnosa.validation.email.required' }),
202
+ (0, class_validator_1.IsEmail)({}, { message: 'gnosa.validation.email.invalid' }),
203
+ (0, class_validator_1.MaxLength)(255, { message: 'gnosa.validation.email.invalid' }),
204
+ (0, transformers_helper_1.ToLowerCase)(),
205
+ (0, common_1.Trim)(),
206
+ __metadata("design:type", String)
207
+ ], CheckoutDto.prototype, "email", void 0);
208
+ __decorate([
209
+ (0, class_validator_1.IsNotEmpty)({ message: 'gnosa.validation.order.phone' }),
210
+ (0, class_validator_1.IsString)({ message: 'gnosa.validation.order.phone' }),
211
+ (0, class_validator_1.MaxLength)(32, { message: 'gnosa.validation.order.phone' }),
212
+ (0, common_1.Trim)(),
213
+ __metadata("design:type", String)
214
+ ], CheckoutDto.prototype, "phone", void 0);
215
+ __decorate([
216
+ (0, class_validator_1.IsNotEmpty)({ message: 'gnosa.validation.address.required' }),
217
+ (0, class_validator_1.ValidateNested)(),
218
+ (0, class_transformer_1.Type)(() => AddressDto),
219
+ __metadata("design:type", AddressDto)
220
+ ], CheckoutDto.prototype, "shippingAddress", void 0);
221
+ __decorate([
222
+ (0, class_validator_1.IsNotEmpty)({ message: 'gnosa.validation.address.required' }),
223
+ (0, class_validator_1.ValidateNested)(),
224
+ (0, class_transformer_1.Type)(() => AddressDto),
225
+ __metadata("design:type", AddressDto)
226
+ ], CheckoutDto.prototype, "billingAddress", void 0);
227
+ __decorate([
228
+ (0, class_validator_1.Equals)(true, { message: 'gnosa.validation.order.privacyPolicy' }),
229
+ __metadata("design:type", Boolean)
230
+ ], CheckoutDto.prototype, "acceptsPrivacyPolicy", void 0);
231
+ __decorate([
232
+ (0, class_validator_1.Equals)(true, { message: 'gnosa.validation.order.terms' }),
233
+ __metadata("design:type", Boolean)
234
+ ], CheckoutDto.prototype, "acceptsTerms", void 0);
235
+ /**
236
+ * Marks an order as shipped, with an optional tracking URL for the shipment email.
237
+ */
238
+ class ShipOrderDto {
239
+ trackingUrl;
240
+ constructor(props) {
241
+ Object.assign(this, props);
242
+ }
243
+ }
244
+ exports.ShipOrderDto = ShipOrderDto;
245
+ __decorate([
246
+ (0, class_validator_1.IsOptional)(),
247
+ (0, class_validator_1.IsUrl)({ protocols: ['http', 'https'], require_protocol: true }, { message: 'gnosa.validation.url.invalid' }),
248
+ (0, class_validator_1.MaxLength)(1024, { message: 'gnosa.validation.url.invalid' }),
249
+ (0, common_1.Trim)(),
250
+ __metadata("design:type", String)
251
+ ], ShipOrderDto.prototype, "trackingUrl", void 0);
252
+ /**
253
+ * The search and filters of the admin Orders List.
254
+ */
255
+ class OrderFilterDto {
256
+ /**
257
+ * Matches the order reference, the customer's name or the customer's email.
258
+ */
259
+ phrase;
260
+ status;
261
+ /**
262
+ * Orders placed at or after this time, in UTC.
263
+ */
264
+ from;
265
+ /**
266
+ * Orders placed at or before this time, in UTC.
267
+ */
268
+ to;
269
+ constructor(props) {
270
+ Object.assign(this, props);
271
+ }
272
+ }
273
+ exports.OrderFilterDto = OrderFilterDto;
274
+ __decorate([
275
+ (0, class_validator_1.IsOptional)(),
276
+ (0, class_validator_1.IsString)({ message: 'gnosa.validation.filter' }),
277
+ (0, common_1.Trim)(),
278
+ __metadata("design:type", String)
279
+ ], OrderFilterDto.prototype, "phrase", void 0);
280
+ __decorate([
281
+ (0, class_validator_1.IsOptional)(),
282
+ (0, class_validator_1.IsEnum)(order_enum_1.OrderStatus, { message: 'gnosa.validation.filter' }),
283
+ __metadata("design:type", String)
284
+ ], OrderFilterDto.prototype, "status", void 0);
285
+ __decorate([
286
+ (0, class_validator_1.IsOptional)(),
287
+ (0, class_validator_1.IsDate)({ message: 'gnosa.validation.filter' }),
288
+ (0, transformers_helper_1.ToUtcDate)(),
289
+ __metadata("design:type", Date)
290
+ ], OrderFilterDto.prototype, "from", void 0);
291
+ __decorate([
292
+ (0, class_validator_1.IsOptional)(),
293
+ (0, class_validator_1.IsDate)({ message: 'gnosa.validation.filter' }),
294
+ (0, transformers_helper_1.ToUtcDate)(),
295
+ __metadata("design:type", Date)
296
+ ], OrderFilterDto.prototype, "to", void 0);
297
+ //# sourceMappingURL=order.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order.dto.js","sourceRoot":"","sources":["../../src/order/order.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAmByB;AACzB,6CAAwC;AACxC,yDAAyC;AAEzC,sEAAsE;AACtE,6CAAoE;AAEpE;;GAEG;AACH,MAAa,WAAW;IAEvB,IAAI,CAAgB;IAIpB,IAAI,CAAS;IAEb;;OAEG;IAIH,QAAQ,CAAS;IAEjB;;;OAGG;IAEH,SAAS,CAAS;IAElB,YAAY,KAA4B;QACvC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;CACD;AA1BD,kCA0BC;AAxBA;IADC,IAAA,wBAAM,EAAC,0BAAa,EAAE,EAAE,OAAO,EAAE,8BAA8B,EAAE,CAAC;;yCAC/C;AAIpB;IAFC,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,8BAA8B,EAAE,CAAC;IACvD,IAAA,0BAAQ,EAAC,EAAE,OAAO,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AAE,yBAAyB,EAAE,CAAC;IAC9C,IAAA,+BAAS,GAAE;8BACP,IAAI;0CAAC"}
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Where an order stands. It only ever moves forward:
3
- * Awaiting Payment → Paid (awaiting shipment) → Shipped.
3
+ * Awaiting Payment → Awaiting Shipment → Shipped.
4
4
  */
5
5
  export declare enum OrderStatus {
6
6
  AwaitingPayment = "awaiting_payment",
7
- Paid = "paid",
7
+ AwaitingShipment = "awaiting_shipment",
8
8
  Shipped = "shipped"
9
9
  }
10
10
  /**
@@ -21,3 +21,11 @@ export declare enum OrderItemType {
21
21
  Book = "book",
22
22
  Magazine = "magazine"
23
23
  }
24
+ /**
25
+ * The currency a cart is priced in and an order is placed in. Every publication and shipping rate has
26
+ * a price in both.
27
+ */
28
+ export declare enum Currency {
29
+ Eur = "EUR",
30
+ Mkd = "MKD"
31
+ }
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OrderItemType = exports.PaymentMethod = exports.OrderStatus = void 0;
3
+ exports.Currency = exports.OrderItemType = exports.PaymentMethod = exports.OrderStatus = void 0;
4
4
  /**
5
5
  * Where an order stands. It only ever moves forward:
6
- * Awaiting Payment → Paid (awaiting shipment) → Shipped.
6
+ * Awaiting Payment → Awaiting Shipment → Shipped.
7
7
  */
8
8
  var OrderStatus;
9
9
  (function (OrderStatus) {
10
10
  OrderStatus["AwaitingPayment"] = "awaiting_payment";
11
- OrderStatus["Paid"] = "paid";
11
+ OrderStatus["AwaitingShipment"] = "awaiting_shipment";
12
12
  OrderStatus["Shipped"] = "shipped";
13
13
  })(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
14
14
  /**
@@ -27,4 +27,13 @@ var OrderItemType;
27
27
  OrderItemType["Book"] = "book";
28
28
  OrderItemType["Magazine"] = "magazine";
29
29
  })(OrderItemType || (exports.OrderItemType = OrderItemType = {}));
30
+ /**
31
+ * The currency a cart is priced in and an order is placed in. Every publication and shipping rate has
32
+ * a price in both.
33
+ */
34
+ var Currency;
35
+ (function (Currency) {
36
+ Currency["Eur"] = "EUR";
37
+ Currency["Mkd"] = "MKD";
38
+ })(Currency || (exports.Currency = Currency = {}));
30
39
  //# sourceMappingURL=order.enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"order.enum.js","sourceRoot":"","sources":["../../src/order/order.enum.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,IAAY,WAIX;AAJD,WAAY,WAAW;IACtB,mDAAoC,CAAA;IACpC,4BAAa,CAAA;IACb,kCAAmB,CAAA;AACpB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAED;;GAEG;AACH,IAAY,aAGX;AAHD,WAAY,aAAa;IACxB,uCAAsB,CAAA;IACtB,kCAAiB,CAAA;AAClB,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAED;;GAEG;AACH,IAAY,aAGX;AAHD,WAAY,aAAa;IACxB,8BAAa,CAAA;IACb,sCAAqB,CAAA;AACtB,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB"}
1
+ {"version":3,"file":"order.enum.js","sourceRoot":"","sources":["../../src/order/order.enum.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,IAAY,WAIX;AAJD,WAAY,WAAW;IACtB,mDAAoC,CAAA;IACpC,qDAAsC,CAAA;IACtC,kCAAmB,CAAA;AACpB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAED;;GAEG;AACH,IAAY,aAGX;AAHD,WAAY,aAAa;IACxB,uCAAsB,CAAA;IACtB,kCAAiB,CAAA;AAClB,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAED;;GAEG;AACH,IAAY,aAGX;AAHD,WAAY,aAAa;IACxB,8BAAa,CAAA;IACb,sCAAqB,CAAA;AACtB,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAED;;;GAGG;AACH,IAAY,QAGX;AAHD,WAAY,QAAQ;IACnB,uBAAW,CAAA;IACX,uBAAW,CAAA;AACZ,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB"}
@@ -0,0 +1,168 @@
1
+ import { Currency, OrderItemType, OrderStatus } from './order.enum';
2
+ /**
3
+ * A country Gnosa ships to, with its flat shipping rate in each currency, whatever the quantity.
4
+ */
5
+ export declare class ShippingCountry {
6
+ /**
7
+ * ISO 3166-1 alpha-2 code (`DE`).
8
+ */
9
+ code: string;
10
+ /**
11
+ * The country's name in the app language.
12
+ */
13
+ name: string;
14
+ rateEur: number;
15
+ rateMkd: number;
16
+ /**
17
+ * Whether the shipping address needs a state or province.
18
+ */
19
+ requiresState: boolean;
20
+ constructor(props?: Partial<ShippingCountry>);
21
+ }
22
+ /**
23
+ * One publication of a priced cart, at its current price in the cart currency.
24
+ */
25
+ export declare class CartItem {
26
+ type: OrderItemType;
27
+ slug: string;
28
+ /**
29
+ * In the app language; `null` for a publication that no longer exists.
30
+ */
31
+ title: string;
32
+ coverUrl: string;
33
+ /**
34
+ * The current VAT-inclusive unit price; `null` when the publication can't be ordered.
35
+ */
36
+ unitPrice: number;
37
+ quantity: number;
38
+ /**
39
+ * `unitPrice` × `quantity`; 0 when the publication can't be ordered.
40
+ */
41
+ lineTotal: number;
42
+ /**
43
+ * Whether the physical publication can still be ordered.
44
+ */
45
+ isAvailable: boolean;
46
+ /**
47
+ * Whether the current price differs from the one the cart showed.
48
+ */
49
+ isPriceChanged: boolean;
50
+ constructor(props?: Partial<CartItem>);
51
+ }
52
+ /**
53
+ * The website's cart, priced: the items at their current prices, and, once a delivery country is
54
+ * chosen, the shipping and the total. Every amount is in `currency` and includes VAT.
55
+ */
56
+ export declare class Cart {
57
+ currency: Currency;
58
+ items: CartItem[];
59
+ /**
60
+ * Sum of the line totals of the available items.
61
+ */
62
+ subtotal: number;
63
+ /**
64
+ * The delivery country's code, when one was given.
65
+ */
66
+ country: string;
67
+ /**
68
+ * The country's flat rate; `null` until a country is given.
69
+ */
70
+ shippingCost: number;
71
+ /**
72
+ * `subtotal` + `shippingCost`.
73
+ */
74
+ total: number;
75
+ /**
76
+ * The VAT rate included in every price, as a percentage.
77
+ */
78
+ vatRate: number;
79
+ /**
80
+ * The VAT included in `total`.
81
+ */
82
+ vatAmount: number;
83
+ /**
84
+ * Whether the cart can be checked out as it is: no unavailable item and no changed price.
85
+ */
86
+ isValid: boolean;
87
+ constructor(props?: Partial<Cart>);
88
+ }
89
+ /**
90
+ * A postal address of an order.
91
+ */
92
+ export declare class Address {
93
+ line1: string;
94
+ line2: string;
95
+ postcode: string;
96
+ city: string;
97
+ state: string;
98
+ /**
99
+ * ISO 3166-1 alpha-2 code (`DE`).
100
+ */
101
+ country: string;
102
+ /**
103
+ * The country's name in the app language.
104
+ */
105
+ countryName: string;
106
+ constructor(props?: Partial<Address>);
107
+ }
108
+ /**
109
+ * One publication line of an order, as it was at checkout.
110
+ */
111
+ export declare class OrderItem {
112
+ type: OrderItemType;
113
+ title: string;
114
+ unitPrice: number;
115
+ quantity: number;
116
+ lineTotal: number;
117
+ constructor(props?: Partial<OrderItem>);
118
+ }
119
+ /**
120
+ * A customer's order, a snapshot of the checkout. Every amount is in `currency` and includes VAT. The
121
+ * list carries the fields of a row; the detail adds the contact details, addresses, items, amounts
122
+ * and the workflow times.
123
+ */
124
+ export declare class Order {
125
+ /**
126
+ * The order reference (`GN-00042`), which identifies the order and is the E-Banking payment
127
+ * reference.
128
+ */
129
+ reference: string;
130
+ /**
131
+ * When the order was placed, in UTC.
132
+ */
133
+ createdOn: Date;
134
+ status: OrderStatus;
135
+ currency: Currency;
136
+ firstName: string;
137
+ lastName: string;
138
+ email: string;
139
+ total: number;
140
+ /**
141
+ * Whether an Orders List page has already displayed the order; until then it shows a New badge.
142
+ */
143
+ isSeen: boolean;
144
+ phone?: string;
145
+ shippingAddress?: Address;
146
+ billingAddress?: Address;
147
+ items?: OrderItem[];
148
+ subtotal?: number;
149
+ shippingCost?: number;
150
+ /**
151
+ * The VAT rate at checkout, as a percentage.
152
+ */
153
+ vatRate?: number;
154
+ /**
155
+ * The VAT included in `total`.
156
+ */
157
+ vatAmount?: number;
158
+ /**
159
+ * When the payment was confirmed, in UTC.
160
+ */
161
+ paidOn?: Date;
162
+ /**
163
+ * When the order was marked as shipped, in UTC.
164
+ */
165
+ shippedOn?: Date;
166
+ trackingUrl?: string;
167
+ constructor(props?: Partial<Order>);
168
+ }