@aptly-as/types 2.4.0 → 2.4.2

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/core/scope.d.ts CHANGED
@@ -11,7 +11,7 @@ export declare enum AptlyModules {
11
11
  ProductsExtended = "productsExtended",
12
12
  Recommendations = "recommendations",
13
13
  Subcontractor = "subcontractor",
14
- Sign = "sign",
14
+ Signing = "signing",
15
15
  Support = "support",
16
16
  SupportComplaint = "supportComplaint",
17
17
  Testing = "testing",
package/core/scope.js CHANGED
@@ -12,7 +12,7 @@ export var AptlyModules;
12
12
  AptlyModules["ProductsExtended"] = "productsExtended";
13
13
  AptlyModules["Recommendations"] = "recommendations";
14
14
  AptlyModules["Subcontractor"] = "subcontractor";
15
- AptlyModules["Sign"] = "sign";
15
+ AptlyModules["Signing"] = "signing";
16
16
  AptlyModules["Support"] = "support";
17
17
  AptlyModules["SupportComplaint"] = "supportComplaint";
18
18
  AptlyModules["Testing"] = "testing";
@@ -9,6 +9,7 @@ export declare enum AptlyDocumentType {
9
9
  Manual = "manual",
10
10
  KitchenDrawing = "kitchenDrawing",
11
11
  Receipt = "receipt",
12
+ PaymentReceipt = "payment-receipt",
12
13
  ProductAttachment = "productAttachment",
13
14
  SignedReceipt = "signedReceipt",
14
15
  OrderAttachment = "orderAttachment",
package/enums/document.js CHANGED
@@ -10,6 +10,7 @@ export var AptlyDocumentType;
10
10
  AptlyDocumentType["Manual"] = "manual";
11
11
  AptlyDocumentType["KitchenDrawing"] = "kitchenDrawing";
12
12
  AptlyDocumentType["Receipt"] = "receipt";
13
+ AptlyDocumentType["PaymentReceipt"] = "payment-receipt";
13
14
  AptlyDocumentType["ProductAttachment"] = "productAttachment";
14
15
  AptlyDocumentType["SignedReceipt"] = "signedReceipt";
15
16
  AptlyDocumentType["OrderAttachment"] = "orderAttachment";
package/models/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export * from './option-label.js';
15
15
  export * from './order.js';
16
16
  export * from './organization.js';
17
17
  export * from './page.js';
18
+ export * from './payment.js';
18
19
  export * from './period.js';
19
20
  export * from './producer.js';
20
21
  export * from './product.js';
package/models/index.js CHANGED
@@ -15,6 +15,7 @@ export * from './option-label.js';
15
15
  export * from './order.js';
16
16
  export * from './organization.js';
17
17
  export * from './page.js';
18
+ export * from './payment.js';
18
19
  export * from './period.js';
19
20
  export * from './producer.js';
20
21
  export * from './product.js';
package/models/order.d.ts CHANGED
@@ -3,6 +3,7 @@ import { AptlyAppImplementationSetting, AptlyAppSchema } from './app.js';
3
3
  import { AptlyDocumentSchema } from './document.js';
4
4
  import { AptlyEmailSchema } from './email.js';
5
5
  import { AptlyOrganizationAppConfigSchema, AptlyOrganizationSchema } from './organization.js';
6
+ import { AptlyPaymentSchema } from './payment.js';
6
7
  import { AptlyProductSchema } from './product.js';
7
8
  import { AptlyProject, AptlyProjectPeriodSchema, AptlyProjectSchema } from './project.js';
8
9
  import { AptlyUnit, AptlyUnitItemParamSchema, AptlyUnitSchema } from './unit.js';
@@ -38,23 +39,18 @@ export interface AptlyOrderSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DAT
38
39
  user?: ID | AptlyUserSchema<ID, DATE>;
39
40
  at?: DATE;
40
41
  };
41
- payment?: AptlyOrderPaymentSchema<DATE> | null;
42
+ paymentSession?: AptlyOrderPaymentSessionSchema<DATE> | null;
43
+ payment?: ID | AptlyPaymentSchema<ID, DATE>;
42
44
  created: DATE;
43
45
  }
44
- export type AptlyOrderPayment = AptlyOrderPaymentSchema<string>;
45
- export interface AptlyOrderPaymentSchema<DATE> {
46
+ export type AptlyOrderPaymentSession = AptlyOrderPaymentSessionSchema<string>;
47
+ export interface AptlyOrderPaymentSessionSchema<DATE> {
46
48
  status: AptlyOrderPaymentStatus;
47
- sessionId: string;
48
- sessionAt: DATE | null;
49
49
  url: string;
50
- transactionId?: string;
51
- transactionAt?: DATE;
52
- captures: {
53
- amount: number;
54
- description?: string;
55
- }[];
56
- capturedAmount: number;
57
- capturedAt?: DATE;
50
+ id: string;
51
+ at: DATE | null;
52
+ paidAt?: DATE | null;
53
+ capturedAt?: DATE | null;
58
54
  }
59
55
  export type AptlyOrderSignee = AptlyOrderSigneeSchema<string, string>;
60
56
  export interface AptlyOrderSigneeSchema<ID, DATE> {
@@ -147,10 +143,10 @@ export interface AptlyOrderActionSignData {
147
143
  unit: Pick<AptlyUnit, '_id' | 'name'>;
148
144
  order: Pick<AptlyOrder, '_id' | 'orderNumber' | 'receipt' | 'period'>;
149
145
  user: AptlyUser;
150
- signees: AptlyorderActionSignDataSignee[];
146
+ signees: AptlyOrderActionSignDataSignee[];
151
147
  deadlineInDays?: number;
152
148
  }
153
- export interface AptlyorderActionSignDataSignee {
149
+ export interface AptlyOrderActionSignDataSignee {
154
150
  user: AptlyUser;
155
151
  signMethod?: string;
156
152
  isAdmin?: boolean;
@@ -1,6 +1,6 @@
1
1
  import { AptlyModules } from '../core/index.js';
2
2
  import { AptlyOrganizationRoles, AptlyAppScope, AptlySignageSchema } from '../core/index.js';
3
- import { AptlyOrganizationStatus, AptlyOrganizationType } from "../enums/index.js";
3
+ import { AptlyOrganizationStatus, AptlyOrganizationType } from '../enums/index.js';
4
4
  import { AptlyModuleItemSchema } from './module.js';
5
5
  import { AptlyUserSchema } from './user.js';
6
6
  import { AptlyMediaSrc } from './media.js';
@@ -19,6 +19,7 @@ export interface AptlyOrganizationSchema<ID, DATE> extends AptlyBaseSchema<ID, D
19
19
  negativeLogoMedia?: AptlyMediaSrc | null;
20
20
  projectLogoMedia?: AptlyMediaSrc | null;
21
21
  address: {
22
+ billing: AptlyAddress;
22
23
  visit: AptlyAddress;
23
24
  post: AptlyAddress;
24
25
  };
@@ -0,0 +1,96 @@
1
+ import { AptlyAppSchema } from './app.js';
2
+ import { AptlyDocumentSchema } from './document.js';
3
+ import { AptlyAddress, AptlyBaseSchema } from './extends.js';
4
+ import { AptlyOrderPaymentStatus, AptlyOrderSchema } from './order.js';
5
+ import { AptlyOrganizationSchema } from './organization.js';
6
+ import { AptlyProjectSchema } from './project.js';
7
+ import { AptlyUnitCompany, AptlyUnitSchema } from './unit.js';
8
+ import { AptlyUserSchema } from './user.js';
9
+ export type AptlyPayment = AptlyPaymentSchema<string, string>;
10
+ export interface AptlyPaymentSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>, 'name' | 'archived'> {
11
+ organization: ID | AptlyOrganizationSchema<ID, DATE>;
12
+ project: ID | AptlyProjectSchema<ID, DATE>;
13
+ unit: ID | AptlyUnitSchema<ID, DATE>;
14
+ order: ID | AptlyOrderSchema<ID, DATE>;
15
+ app: ID | AptlyAppSchema<ID, DATE>;
16
+ document?: ID | AptlyDocumentSchema<ID, DATE>;
17
+ number: number;
18
+ totalCost: number;
19
+ totalVat: number;
20
+ items: AptlyPaymentItemSchema<ID>[];
21
+ transaction: {
22
+ ref: string;
23
+ at: DATE;
24
+ };
25
+ company: AptlyPaymentCompany;
26
+ customer: AptlyPaymentCustomerSchema<ID, DATE>;
27
+ shipping: AptlyAddress;
28
+ shippingDate?: DATE;
29
+ billing?: AptlyAddress;
30
+ card?: {
31
+ brand: string;
32
+ last4: string;
33
+ };
34
+ captures: AptlyPaymentCaptureSchema<ID, DATE>[];
35
+ captured: {
36
+ amount: number;
37
+ at: DATE;
38
+ };
39
+ }
40
+ export type AptlyPaymentCapture = AptlyPaymentCaptureSchema<string, string>;
41
+ export interface AptlyPaymentCaptureSchema<ID, DATE> {
42
+ _id: ID;
43
+ amount: number;
44
+ description: string;
45
+ ref: string;
46
+ user: ID | AptlyUserSchema<ID, DATE>;
47
+ at: DATE;
48
+ }
49
+ export interface AptlyPaymentCompany {
50
+ vat: string;
51
+ name: string;
52
+ email: string;
53
+ address: AptlyAddress;
54
+ phone?: string;
55
+ }
56
+ export type AptlyPaymentCustomer = AptlyPaymentCustomerSchema<string, string>;
57
+ export interface AptlyPaymentCustomerSchema<ID, DATE> {
58
+ user: ID | AptlyUserSchema<ID, DATE>;
59
+ firstName: string;
60
+ lastName: string;
61
+ email: string;
62
+ phone?: string;
63
+ company?: AptlyUnitCompany;
64
+ }
65
+ export interface AptlyPaymentItemSchema<ID> {
66
+ _id: ID;
67
+ name: string;
68
+ sku: string;
69
+ quantity: number;
70
+ unitCost: number;
71
+ totalCost: number;
72
+ totalVat: number;
73
+ }
74
+ export interface AptlyPaymentCaptureBody {
75
+ id: string;
76
+ status: AptlyOrderPaymentStatus;
77
+ capturedAmount: number;
78
+ totalCost: number;
79
+ at: string;
80
+ }
81
+ export interface AptlyPaymentTransactionBody {
82
+ app: string;
83
+ id: string;
84
+ at: string;
85
+ customer: {
86
+ user: string;
87
+ firstName: string;
88
+ lastName: string;
89
+ email: string;
90
+ phone?: string;
91
+ company?: AptlyUnitCompany;
92
+ };
93
+ card: AptlyPayment['card'];
94
+ shipping: AptlyAddress;
95
+ billing?: AptlyAddress;
96
+ }
@@ -0,0 +1 @@
1
+ export {};
package/models/unit.d.ts CHANGED
@@ -2,7 +2,7 @@ import { AptlyOrderSchema } from './order.js';
2
2
  import { AptlyProducerSchema } from './producer.js';
3
3
  import { AptlyProductSchema } from './product.js';
4
4
  import { AptlyProjectSchema } from './project.js';
5
- import { AptlyHistorySchema } from './extends.js';
5
+ import { AptlyAddress, AptlyHistorySchema } from './extends.js';
6
6
  import { AptlyUnitTemplateBaseSchema, AptlyUnitTemplateCategorySchema, AptlyUnitTemplateCategorySectionSchema, AptlyUnitTemplateSchema } from './unit-template';
7
7
  import { AptlyIntegration, AptlyUnitItemParamKey, AptlyUnitStatus } from '../enums/index.js';
8
8
  import { AptlyUserSchema } from './user.js';
@@ -10,6 +10,10 @@ import { AptlyOrganizationSchema } from './organization.js';
10
10
  export type AptlyUnit = AptlyUnitSchema<string, string>;
11
11
  export interface AptlyUnitSchema<ID, DATE> extends AptlyUnitTemplateBaseSchema<ID, DATE>, AptlyUnitEditData<DATE>, AptlyHistorySchema<ID, DATE> {
12
12
  status: AptlyUnitStatus;
13
+ vat?: string;
14
+ shipping?: AptlyAddress;
15
+ billing?: AptlyAddress;
16
+ company?: AptlyUnitCompany;
13
17
  rooms: AptlyUnitRoomSchema<ID>[];
14
18
  selectedOptions: AptlyUnitSelectedOptionSchema<ID, DATE>[];
15
19
  items: AptlyUnitOptionItemSchema<ID, DATE>[];
@@ -232,4 +236,8 @@ export interface AptlyUnitInviteSchema<ID, DATE> {
232
236
  claimTime: DATE;
233
237
  };
234
238
  }
239
+ export interface AptlyUnitCompany {
240
+ name?: string;
241
+ vat?: string;
242
+ }
235
243
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptly-as/types",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
4
4
  "description": "Aptly types and enums",
5
5
  "type": "module",
6
6
  "main": "./index.js",