@aptly-as/types 2.9.1 → 3.0.0

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
@@ -5,6 +5,7 @@ export declare enum AptlyModules {
5
5
  Default = "default",
6
6
  Departments = "departments",
7
7
  Emails = "emails",
8
+ Offers = "offers",
8
9
  Options = "options",
9
10
  OptionLabels = "optionLabels",
10
11
  Pages = "pages",
@@ -63,6 +64,7 @@ export declare enum AptlyScopes {
63
64
  ProjectEmails = "projectEmails",
64
65
  ProjectInquiry = "projectInquiry",
65
66
  ProjectInquiryComplaint = "projectInquiryComplaint",
67
+ ProjectOffers = "projectOffers",
66
68
  ProjectOrders = "projectOrders",
67
69
  ProjectOptions = "projectOptions",
68
70
  ProjectPayment = "projectPayment",
package/core/scope.js CHANGED
@@ -6,6 +6,7 @@ export var AptlyModules;
6
6
  AptlyModules["Default"] = "default";
7
7
  AptlyModules["Departments"] = "departments";
8
8
  AptlyModules["Emails"] = "emails";
9
+ AptlyModules["Offers"] = "offers";
9
10
  AptlyModules["Options"] = "options";
10
11
  AptlyModules["OptionLabels"] = "optionLabels";
11
12
  AptlyModules["Pages"] = "pages";
@@ -65,6 +66,7 @@ export var AptlyScopes;
65
66
  AptlyScopes["ProjectEmails"] = "projectEmails";
66
67
  AptlyScopes["ProjectInquiry"] = "projectInquiry";
67
68
  AptlyScopes["ProjectInquiryComplaint"] = "projectInquiryComplaint";
69
+ AptlyScopes["ProjectOffers"] = "projectOffers";
68
70
  AptlyScopes["ProjectOrders"] = "projectOrders";
69
71
  AptlyScopes["ProjectOptions"] = "projectOptions";
70
72
  AptlyScopes["ProjectPayment"] = "projectPayment";
@@ -1,4 +1,4 @@
1
- import { AptlyDocumentSchema, AptlyOrderSchema, AptlyPaymentSchema, AptlyPaymentSettlement, AptlyUnitSchema } from '../models/index.js';
1
+ import { AptlyDocumentSchema, AptlyOrderSchema, AptlyPaymentSchema, AptlyPaymentSettlement, AptlyProjectSchema, AptlyUnitSchema } from '../models/index.js';
2
2
  export declare namespace AptlyWebhookEventData {
3
3
  interface UnitWebhookSchema<ID, DATE> {
4
4
  unit: Pick<AptlyUnitSchema<ID, DATE>, '_id' | 'name'>;
@@ -7,9 +7,14 @@ export declare namespace AptlyWebhookEventData {
7
7
  document: AptlyDocumentSchema<ID, DATE>;
8
8
  documentUrl: string;
9
9
  }
10
- interface Payment<ID, DATE> {
10
+ type Payment = PaymentSchema<string, string>;
11
+ interface PaymentSchema<ID, DATE> {
12
+ unit: Pick<AptlyUnitSchema<ID, DATE>, '_id' | 'name'>;
13
+ project: Pick<AptlyProjectSchema<ID, DATE>, '_id' | 'name'>;
11
14
  payment: AptlyPaymentSchema<ID, DATE>;
12
15
  order: Pick<AptlyOrderSchema<ID, DATE>, '_id' | 'orderNumber'>;
16
+ documentUrl?: string;
17
+ reportDocumentUrl?: string;
13
18
  }
14
19
  type NewUnitDocument = NewUnitDocumentSchema<string, string>;
15
20
  type NewUnitDocumentSchema<ID, DATE> = UnitWebhookSchema<ID, DATE> & UnitDocumentWebhookSchema<ID, DATE>;
@@ -19,6 +24,7 @@ export declare namespace AptlyWebhookEventData {
19
24
  }
20
25
  type Order = OrderSchema<string, string>;
21
26
  interface OrderSchema<ID, DATE> {
27
+ project: Pick<AptlyProjectSchema<ID, DATE>, '_id' | 'name'>;
22
28
  unit: Pick<AptlyUnitSchema<ID, DATE>, '_id' | 'name' | 'shipping' | 'users'>;
23
29
  order: AptlyOrderSchema<ID, DATE>;
24
30
  receiptUrl?: string;
package/enums/fields.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export declare enum AptlyFieldType {
2
+ Amount = "amount",
2
3
  Autocomplete = "autocomplete",
3
4
  AutocompleteSearch = "autocomplete-search",
4
5
  AutocompleteQuery = "autocomplete-query",
package/enums/fields.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export var AptlyFieldType;
2
2
  (function (AptlyFieldType) {
3
+ AptlyFieldType["Amount"] = "amount";
3
4
  AptlyFieldType["Autocomplete"] = "autocomplete";
4
5
  AptlyFieldType["AutocompleteSearch"] = "autocomplete-search";
5
6
  AptlyFieldType["AutocompleteQuery"] = "autocomplete-query";
package/enums/index.d.ts CHANGED
@@ -113,7 +113,8 @@ export declare enum AptlyOrganizationType {
113
113
  Contractor = "contractor",
114
114
  Electrician = "electrician",
115
115
  Plumber = "plumber",
116
- Producer = "producer"
116
+ Producer = "producer",
117
+ Integration = "integration"
117
118
  }
118
119
  export declare enum AptlyOrganizationStatus {
119
120
  NewBusiness = 0,
@@ -131,6 +132,7 @@ export declare enum AptlyEmailType {
131
132
  InviteAccepted = "invite-accepted",
132
133
  NewOwner = "new-owner",
133
134
  NoteReminder = "note-reminder",
135
+ Offer = "offer",
134
136
  OrderCreated = "order-created",
135
137
  OrderSign = "order-sign",
136
138
  OrderSignNotify = "order-sign-notify",
package/enums/index.js CHANGED
@@ -131,6 +131,7 @@ export var AptlyOrganizationType;
131
131
  AptlyOrganizationType["Electrician"] = "electrician";
132
132
  AptlyOrganizationType["Plumber"] = "plumber";
133
133
  AptlyOrganizationType["Producer"] = "producer";
134
+ AptlyOrganizationType["Integration"] = "integration";
134
135
  })(AptlyOrganizationType || (AptlyOrganizationType = {}));
135
136
  export var AptlyOrganizationStatus;
136
137
  (function (AptlyOrganizationStatus) {
@@ -150,6 +151,7 @@ export var AptlyEmailType;
150
151
  AptlyEmailType["InviteAccepted"] = "invite-accepted";
151
152
  AptlyEmailType["NewOwner"] = "new-owner";
152
153
  AptlyEmailType["NoteReminder"] = "note-reminder";
154
+ AptlyEmailType["Offer"] = "offer";
153
155
  AptlyEmailType["OrderCreated"] = "order-created";
154
156
  AptlyEmailType["OrderSign"] = "order-sign";
155
157
  AptlyEmailType["OrderSignNotify"] = "order-sign-notify";
@@ -2,6 +2,7 @@ export declare enum AptlyQuantityUnitCode {
2
2
  One = "C62",
3
3
  Piece = "H87",
4
4
  Meter = "MTR",
5
+ Kilometre = "KMT",
5
6
  SquareMeter = "MTK",
6
7
  Hour = "HUR",
7
8
  Day = "DAY"
@@ -17,6 +18,13 @@ export declare enum AptlyVatCategoryCode {
17
18
  StandardRate = "S",
18
19
  ExemptFromTax = "E"
19
20
  }
21
+ export declare enum AptlyChargeReasonCode {
22
+ ShippingAndHandling = "SSA",
23
+ Labour = "LLA"
24
+ }
25
+ export declare enum AptlyAllowanceReasonCode {
26
+ Discount = 95
27
+ }
20
28
  export declare enum AptlyCountryCode {
21
29
  Norway = "NO"
22
30
  }
@@ -3,6 +3,7 @@ export var AptlyQuantityUnitCode;
3
3
  AptlyQuantityUnitCode["One"] = "C62";
4
4
  AptlyQuantityUnitCode["Piece"] = "H87";
5
5
  AptlyQuantityUnitCode["Meter"] = "MTR";
6
+ AptlyQuantityUnitCode["Kilometre"] = "KMT";
6
7
  AptlyQuantityUnitCode["SquareMeter"] = "MTK";
7
8
  AptlyQuantityUnitCode["Hour"] = "HUR";
8
9
  AptlyQuantityUnitCode["Day"] = "DAY";
@@ -21,6 +22,15 @@ export var AptlyVatCategoryCode;
21
22
  AptlyVatCategoryCode["StandardRate"] = "S";
22
23
  AptlyVatCategoryCode["ExemptFromTax"] = "E";
23
24
  })(AptlyVatCategoryCode || (AptlyVatCategoryCode = {}));
25
+ export var AptlyChargeReasonCode;
26
+ (function (AptlyChargeReasonCode) {
27
+ AptlyChargeReasonCode["ShippingAndHandling"] = "SSA";
28
+ AptlyChargeReasonCode["Labour"] = "LLA";
29
+ })(AptlyChargeReasonCode || (AptlyChargeReasonCode = {}));
30
+ export var AptlyAllowanceReasonCode;
31
+ (function (AptlyAllowanceReasonCode) {
32
+ AptlyAllowanceReasonCode[AptlyAllowanceReasonCode["Discount"] = 95] = "Discount";
33
+ })(AptlyAllowanceReasonCode || (AptlyAllowanceReasonCode = {}));
24
34
  export var AptlyCountryCode;
25
35
  (function (AptlyCountryCode) {
26
36
  AptlyCountryCode["Norway"] = "NO";
package/error/error.js CHANGED
@@ -21,7 +21,7 @@ export class AptlyError extends Error {
21
21
  id: 'unknown',
22
22
  status: response.status,
23
23
  message: response.statusText,
24
- detail: body,
24
+ detail: typeof body === 'object' ? JSON.stringify(body) : body,
25
25
  link: response.url,
26
26
  });
27
27
  }
package/locales/en.json CHANGED
@@ -4,7 +4,8 @@
4
4
  "C62": "",
5
5
  "H87": "PCS",
6
6
  "MTR": "Meter",
7
- "MTK": "m2",
7
+ "KMT": "Kilometre",
8
+ "MTK": "m²",
8
9
  "HUR_one": "Hour",
9
10
  "HUR_other": "Hours",
10
11
  "DAY_one": "Day",
package/locales/nb.json CHANGED
@@ -4,7 +4,8 @@
4
4
  "C62": "",
5
5
  "H87": "STK",
6
6
  "MTR": "Meter",
7
- "MTK": "m2",
7
+ "KMT": "Kilometer",
8
+ "MTK": "m²",
8
9
  "HUR_one": "Time",
9
10
  "HUR_other": "Timer",
10
11
  "DAY_one": "Dag",
@@ -0,0 +1,26 @@
1
+ import { AptlyUnitSchema } from './unit.js';
2
+ export interface AptlyAddress {
3
+ line1?: string;
4
+ line2?: string;
5
+ street?: string;
6
+ zip?: string;
7
+ city?: string;
8
+ county?: string;
9
+ country?: string;
10
+ location?: AptlyAddressLocation | null;
11
+ }
12
+ export interface AptlyAddressLocation {
13
+ type: 'Point';
14
+ coordinates: [lng: number, lat: number];
15
+ }
16
+ export interface AptlyAddressSearchQuery {
17
+ q?: string;
18
+ lat?: number;
19
+ lng?: number;
20
+ }
21
+ export type AptlySearchAddress = AptlySearchAddressSchema<string, string>;
22
+ export interface AptlySearchAddressSchema<ID, DATE> extends Pick<AptlyUnitSchema<ID, DATE>, 'shipping' | 'houseNumber' | 'entrance' | 'countyNumber' | 'holdingNumber' | 'subHoldingNumber' | 'leaseNumber' | 'sectionNumber' | 'unitNumber'> {
23
+ _id: string;
24
+ name: string;
25
+ unitNumbers?: string[];
26
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,14 +1,16 @@
1
+ import { AptlyAllowanceReasonCode, AptlyChargeReasonCode, AptlyCurrency, AptlyQuantityUnitCode, AptlyTaxCategoryScheme, AptlyVatCategoryCode } from '../enums/index.js';
1
2
  export declare enum AptlyAlgorithmPipelineOperation {
2
3
  Base = "base",
3
4
  Add = "add",
4
5
  Subtract = "subtract",
5
6
  Multiply = "multiply",
6
- Vat = "vat",
7
- Fee = "fee"
7
+ Percent = "percent",
8
+ Fee = "fee",
9
+ Vat = "vat"
8
10
  }
9
11
  export declare enum AptlyAlgorithmPipelineApplyTo {
10
- Base = "base",
11
12
  Root = "root",
13
+ Base = "base",
12
14
  PreviousStep = "previousStep"
13
15
  }
14
16
  export type AptlyAlgorithm = AptlyAlgorithmSchema<string>;
@@ -19,6 +21,8 @@ export interface AptlyAlgorithmSchema<ID> {
19
21
  reversed?: boolean;
20
22
  vat?: number;
21
23
  fee?: number;
24
+ feePercent?: number;
25
+ feeBasePercent?: number;
22
26
  organization?: ID;
23
27
  project?: ID;
24
28
  }
@@ -28,11 +32,63 @@ export interface AptlyAlgorithmPipelineSchema<ID> {
28
32
  label: string;
29
33
  operation: AptlyAlgorithmPipelineOperation;
30
34
  value: number;
35
+ valuePercent?: number;
31
36
  applyTo: AptlyAlgorithmPipelineApplyTo;
32
37
  }
38
+ export interface AptlyAlgorithmPipelineDataItemSchema<ID> extends AptlyAlgorithmPipelineData {
39
+ _id: ID;
40
+ }
33
41
  export interface AptlyAlgorithmPipelineData {
34
- operation: AptlyAlgorithmPipelineOperation;
35
42
  label: string;
36
- value: number;
43
+ operation: AptlyAlgorithmPipelineOperation;
44
+ value?: number;
45
+ baseAmount: number;
46
+ amount: number;
37
47
  diff: number;
38
48
  }
49
+ export interface AptlyVatCategory {
50
+ id: AptlyVatCategoryCode;
51
+ percent: number;
52
+ taxScheme: AptlyTaxCategoryScheme;
53
+ }
54
+ export interface AptlyQuantity {
55
+ quantity?: number;
56
+ quantityUnitCode: AptlyQuantityUnitCode;
57
+ }
58
+ export interface AptlyExtensionQuantity extends AptlyQuantity {
59
+ invoicedQuantity?: number;
60
+ quantityUnitCode: AptlyQuantityUnitCode;
61
+ }
62
+ export interface AptlyExtensionAmount {
63
+ extensionAmount: number;
64
+ extensionVatAmount: number;
65
+ currency: AptlyCurrency;
66
+ }
67
+ export interface AptlyPrice {
68
+ amount: number;
69
+ allowance?: AptlyPriceAllowance;
70
+ baseQuantity: number;
71
+ }
72
+ export interface AptlyPriceAllowance {
73
+ amount: number;
74
+ baseAmount: number;
75
+ }
76
+ export interface AptlyExtensionPrice extends AptlyExtensionAmount {
77
+ invoicedQuantity?: number;
78
+ quantityUnitCode?: AptlyQuantityUnitCode;
79
+ price?: AptlyPrice;
80
+ currency: AptlyCurrency;
81
+ }
82
+ export interface AptlyAllowance {
83
+ amount?: number;
84
+ multiplier?: number;
85
+ incVAT?: boolean;
86
+ }
87
+ export type AptlyAllowanceCharge<CHARGE extends boolean> = AptlyAllowanceChargeSchema<string, CHARGE>;
88
+ export interface AptlyAllowanceChargeSchema<ID, CHARGE extends boolean> extends AptlyAllowance {
89
+ _id: ID;
90
+ chargeIndicator: CHARGE;
91
+ code: CHARGE extends true ? AptlyChargeReasonCode : AptlyAllowanceReasonCode;
92
+ reason: string;
93
+ baseAmount?: number;
94
+ }
@@ -4,12 +4,13 @@ export var AptlyAlgorithmPipelineOperation;
4
4
  AptlyAlgorithmPipelineOperation["Add"] = "add";
5
5
  AptlyAlgorithmPipelineOperation["Subtract"] = "subtract";
6
6
  AptlyAlgorithmPipelineOperation["Multiply"] = "multiply";
7
- AptlyAlgorithmPipelineOperation["Vat"] = "vat";
7
+ AptlyAlgorithmPipelineOperation["Percent"] = "percent";
8
8
  AptlyAlgorithmPipelineOperation["Fee"] = "fee";
9
+ AptlyAlgorithmPipelineOperation["Vat"] = "vat";
9
10
  })(AptlyAlgorithmPipelineOperation || (AptlyAlgorithmPipelineOperation = {}));
10
11
  export var AptlyAlgorithmPipelineApplyTo;
11
12
  (function (AptlyAlgorithmPipelineApplyTo) {
12
- AptlyAlgorithmPipelineApplyTo["Base"] = "base";
13
13
  AptlyAlgorithmPipelineApplyTo["Root"] = "root";
14
+ AptlyAlgorithmPipelineApplyTo["Base"] = "base";
14
15
  AptlyAlgorithmPipelineApplyTo["PreviousStep"] = "previousStep";
15
16
  })(AptlyAlgorithmPipelineApplyTo || (AptlyAlgorithmPipelineApplyTo = {}));
package/models/app.d.ts CHANGED
@@ -67,6 +67,7 @@ export declare enum AptlyOrganizationInjection {
67
67
  Base = "",
68
68
  Project = "project",
69
69
  Options = "options",
70
+ Service = "service",
70
71
  Products = "products",
71
72
  Content = "content",
72
73
  Admin = "admin"
@@ -74,6 +75,7 @@ export declare enum AptlyOrganizationInjection {
74
75
  export declare enum AptlyProjectInjection {
75
76
  Base = "",
76
77
  Options = "options",
78
+ Service = "service",
77
79
  Products = "products",
78
80
  Content = "content",
79
81
  Project = "project",
@@ -83,6 +85,7 @@ export declare enum AptlyProjectInjection {
83
85
  export declare enum AptlyUnitInjection {
84
86
  Base = "",
85
87
  Options = "options",
88
+ Service = "service",
86
89
  Reports = "reports",
87
90
  Support = "support",
88
91
  Admin = "admin"
package/models/app.js CHANGED
@@ -26,6 +26,7 @@ export var AptlyOrganizationInjection;
26
26
  AptlyOrganizationInjection["Base"] = "";
27
27
  AptlyOrganizationInjection["Project"] = "project";
28
28
  AptlyOrganizationInjection["Options"] = "options";
29
+ AptlyOrganizationInjection["Service"] = "service";
29
30
  AptlyOrganizationInjection["Products"] = "products";
30
31
  AptlyOrganizationInjection["Content"] = "content";
31
32
  AptlyOrganizationInjection["Admin"] = "admin";
@@ -34,6 +35,7 @@ export var AptlyProjectInjection;
34
35
  (function (AptlyProjectInjection) {
35
36
  AptlyProjectInjection["Base"] = "";
36
37
  AptlyProjectInjection["Options"] = "options";
38
+ AptlyProjectInjection["Service"] = "service";
37
39
  AptlyProjectInjection["Products"] = "products";
38
40
  AptlyProjectInjection["Content"] = "content";
39
41
  AptlyProjectInjection["Project"] = "project";
@@ -44,6 +46,7 @@ export var AptlyUnitInjection;
44
46
  (function (AptlyUnitInjection) {
45
47
  AptlyUnitInjection["Base"] = "";
46
48
  AptlyUnitInjection["Options"] = "options";
49
+ AptlyUnitInjection["Service"] = "service";
47
50
  AptlyUnitInjection["Reports"] = "reports";
48
51
  AptlyUnitInjection["Support"] = "support";
49
52
  AptlyUnitInjection["Admin"] = "admin";
@@ -0,0 +1,9 @@
1
+ import { AptlyUserSchema } from './user.js';
2
+ export type AptlyCustomer = AptlyCustomerSchema<string, string>;
3
+ export interface AptlyCustomerSchema<ID, DATE> {
4
+ user?: ID | AptlyUserSchema<ID, DATE> | null;
5
+ firstName: string;
6
+ lastName: string;
7
+ email: string;
8
+ phone?: string;
9
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
- import { AptlyUserSchema } from './user.js';
2
1
  import { AptlyHistoryType } from '../enums/index.js';
2
+ import { AptlyUserSchema } from './user.js';
3
3
  export interface AptlyBaseSchema<ID, DATE> {
4
4
  _id: ID;
5
5
  name: string;
@@ -27,11 +27,3 @@ export interface AptlyDBCrawlerCleaner {
27
27
  dontClean?: boolean;
28
28
  lastClean?: boolean;
29
29
  }
30
- export interface AptlyAddress {
31
- line1?: string;
32
- line2?: string;
33
- street?: string;
34
- zip?: string;
35
- city?: string;
36
- country?: string;
37
- }
package/models/index.d.ts CHANGED
@@ -1,16 +1,21 @@
1
+ export * from './address.js';
1
2
  export * from './algorithm.js';
2
3
  export * from './app.js';
3
4
  export * from './booking.js';
4
5
  export * from './client.js';
6
+ export * from './customer.js';
5
7
  export * from './department.js';
6
8
  export * from './document.js';
7
9
  export * from './email.js';
8
10
  export * from './extends.js';
9
11
  export * from './inquiry.js';
12
+ export * from './invite.js';
13
+ export * from './item.js';
10
14
  export * from './media.js';
11
15
  export * from './module.js';
12
16
  export * from './note.js';
13
17
  export * from './notification-trigger.js';
18
+ export * from './offer.js';
14
19
  export * from './option.js';
15
20
  export * from './option-label.js';
16
21
  export * from './order.js';
package/models/index.js CHANGED
@@ -1,16 +1,21 @@
1
+ export * from './address.js';
1
2
  export * from './algorithm.js';
2
3
  export * from './app.js';
3
4
  export * from './booking.js';
4
5
  export * from './client.js';
6
+ export * from './customer.js';
5
7
  export * from './department.js';
6
8
  export * from './document.js';
7
9
  export * from './email.js';
8
10
  export * from './extends.js';
9
11
  export * from './inquiry.js';
12
+ export * from './invite.js';
13
+ export * from './item.js';
10
14
  export * from './media.js';
11
15
  export * from './module.js';
12
16
  export * from './note.js';
13
17
  export * from './notification-trigger.js';
18
+ export * from './offer.js';
14
19
  export * from './option.js';
15
20
  export * from './option-label.js';
16
21
  export * from './order.js';
@@ -0,0 +1,18 @@
1
+ export type AptlyInvite = AptlyInviteSchema<string, string>;
2
+ export interface AptlyInviteSchema<ID, DATE> {
3
+ _id: ID;
4
+ code: string;
5
+ created: DATE;
6
+ createdBy: ID;
7
+ sendCount: number;
8
+ claim: AptlyInviteClaimSchema<ID, DATE>;
9
+ }
10
+ export type AptlyInviteClaim = AptlyInviteClaimSchema<string, string>;
11
+ export interface AptlyInviteClaimSchema<ID, DATE> {
12
+ email: string;
13
+ fullName?: string;
14
+ phone?: string;
15
+ claimed?: boolean;
16
+ claimedBy?: ID | null;
17
+ claimTime?: DATE | null;
18
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,28 @@
1
+ import { AptlyInternationalCodeDesignator } from '../enums/index.js';
2
+ import { AptlyVatCategory } from './algorithm.js';
3
+ import { AptlyMediaSrc } from './media.js';
4
+ export interface AptlyItem {
5
+ name: string;
6
+ type: AptlyItemType;
7
+ description: string;
8
+ buyersIdentification: string;
9
+ sellersIdentification: string;
10
+ standardIdentification: AptlyItemStandardIdentification | null;
11
+ vatCategory: AptlyVatCategory;
12
+ thumbnail: AptlyMediaSrc | null;
13
+ producer?: string;
14
+ properties: AptlyItemProperty[];
15
+ }
16
+ export declare enum AptlyItemType {
17
+ Physical = "physical",
18
+ Digital = "digital",
19
+ Service = "service"
20
+ }
21
+ export interface AptlyItemStandardIdentification {
22
+ scheme: AptlyInternationalCodeDesignator;
23
+ value: string;
24
+ }
25
+ export interface AptlyItemProperty {
26
+ name: string;
27
+ value: string;
28
+ }
package/models/item.js ADDED
@@ -0,0 +1,6 @@
1
+ export var AptlyItemType;
2
+ (function (AptlyItemType) {
3
+ AptlyItemType["Physical"] = "physical";
4
+ AptlyItemType["Digital"] = "digital";
5
+ AptlyItemType["Service"] = "service";
6
+ })(AptlyItemType || (AptlyItemType = {}));
package/models/note.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { AptlyCategorySchema } from './category.js';
1
2
  import { AptlyBaseSchema } from './extends.js';
2
3
  import { AptlyOrganizationSchema } from './organization.js';
3
4
  import { AptlyProjectSchema } from './project.js';
@@ -9,6 +10,7 @@ export interface AptlyNoteSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
9
10
  organization: ID | AptlyOrganizationSchema<ID, DATE>;
10
11
  project: ID | AptlyProjectSchema<ID, DATE>;
11
12
  unit: ID | AptlyUnitSchema<ID, DATE>;
13
+ category: ID | AptlyCategorySchema<ID, DATE> | null;
12
14
  users: (ID | AptlyUserSchema<ID, DATE>)[];
13
15
  addToReceipt: boolean;
14
16
  unitTemplateCategory: ID | null;
@@ -0,0 +1,64 @@
1
+ import { AptlyCurrency, AptlyVatCategoryCode } from '../enums/index.js';
2
+ import { AptlyAddress, AptlySearchAddress } from './address.js';
3
+ import { AptlyExtensionAmount } from './algorithm.js';
4
+ import { AptlyCustomer, AptlyCustomerSchema } from './customer.js';
5
+ import { AptlyDocumentSchema } from './document.js';
6
+ import { AptlyBaseSchema } from './extends.js';
7
+ import { AptlyOptionPopulatedSchema, AptlyOptionSchema } from './option.js';
8
+ import { AptlyOrderPaymentStatus, AptlyOrderSchema } from './order.js';
9
+ import { AptlyOrganizationSchema } from './organization.js';
10
+ import { AptlyPickSchema } from './pick.js';
11
+ import { AptlyProjectSchema } from './project.js';
12
+ import { AptlyUnitSchema } from './unit.js';
13
+ import { AptlyUserSchema } from './user.js';
14
+ export type AptlyOffer = AptlyOfferSchema<string, string>;
15
+ export interface AptlyOfferSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>, AptlyExtensionAmount {
16
+ organization: ID | AptlyOrganizationSchema<ID, DATE>;
17
+ project: ID | AptlyProjectSchema<ID, DATE>;
18
+ unit: ID | AptlyUnitSchema<ID, DATE> | null;
19
+ order: ID | AptlyOrderSchema<ID, DATE> | null;
20
+ document: ID | AptlyDocumentSchema<ID, DATE> | null;
21
+ expiresAt: DATE | null;
22
+ sentAt: DATE | null;
23
+ number?: number;
24
+ description: string;
25
+ identification?: string;
26
+ amount?: number;
27
+ algorithm: ID | null;
28
+ currency: AptlyCurrency;
29
+ vatCategory: AptlyVatCategoryCode;
30
+ items: AptlyOfferItemSchema<ID, DATE>[];
31
+ customer: AptlyCustomerSchema<ID, DATE> | null;
32
+ shipping: AptlyAddress | null;
33
+ acceptedAt: DATE | null;
34
+ acceptedBy: ID | AptlyUserSchema<ID, DATE> | null;
35
+ locked: boolean;
36
+ }
37
+ export type AptlyOfferItem = AptlyOfferItemSchema<string, string>;
38
+ export interface AptlyOfferItemSchema<ID, DATE> {
39
+ _id: ID;
40
+ option: ID | AptlyOptionSchema<ID, DATE>;
41
+ quantity: number;
42
+ amount: number;
43
+ algorithm: ID | null;
44
+ createdAt?: DATE;
45
+ }
46
+ export type AptlyUserOffer = AptlyUserOfferSchema<string, string>;
47
+ export interface AptlyUserOfferSchema<ID, DATE> extends Omit<AptlyOfferSchema<ID, DATE>, 'amount' | 'items'> {
48
+ options: AptlyOptionPopulatedSchema<ID, DATE>[];
49
+ picks?: AptlyPickSchema<ID, DATE>[];
50
+ }
51
+ export interface AptlyOfferSendBody extends Omit<AptlyCustomer, 'user'> {
52
+ unit: string | null;
53
+ copy?: boolean;
54
+ address?: AptlySearchAddress | null;
55
+ }
56
+ export type AptlyPublicOfferCheckout = AptlyPublicOfferCheckoutSchema<string, string>;
57
+ export interface AptlyPublicOfferCheckoutSchema<ID, DATE> extends AptlyExtensionAmount {
58
+ status: AptlyOrderPaymentStatus;
59
+ offer: Omit<AptlyUserOfferSchema<ID, DATE>, 'options'>;
60
+ options: AptlyOptionPopulatedSchema<ID, DATE>[];
61
+ organization: Pick<AptlyOrganizationSchema<ID, DATE>, 'name'>;
62
+ project: Pick<AptlyProjectSchema<ID, DATE>, 'name' | 'paymentApp' | 'signApp'>;
63
+ order?: Pick<AptlyOrderSchema<ID, DATE>, '_id' | 'status' | 'paymentSession'>;
64
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,8 +1,12 @@
1
1
  import { AptlyCurrency, AptlyVatCategoryCode, AptlyQuantityUnitCode } from '../enums/index.js';
2
- import { AptlyAlgorithmPipelineData } from './algorithm.js';
2
+ import { AptlyAllowanceChargeSchema, AptlyAllowance, AptlyExtensionAmount, AptlyPrice } from './algorithm.js';
3
3
  import { AptlyBaseSchema } from './extends.js';
4
+ import { AptlyItem, AptlyItemType } from './item.js';
5
+ import { AptlyMediaSrcSchema } from './media.js';
6
+ import { AptlyOfferSchema } from './offer.js';
4
7
  import { AptlyOrganizationSchema } from './organization.js';
5
8
  import { AptlyPeriodSchema } from './period.js';
9
+ import { AptlyProducerSchema } from './producer.js';
6
10
  import { AptlyProductSchema } from './product.js';
7
11
  import { AptlyProjectSchema } from './project.js';
8
12
  import { AptlyCategorySchema } from './category.js';
@@ -12,32 +16,36 @@ export interface AptlyOptionSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
12
16
  organization: ID | AptlyOrganizationSchema<ID, DATE>;
13
17
  project: ID | AptlyProjectSchema<ID, DATE>;
14
18
  unit: ID | AptlyUnitSchema<ID, DATE> | null;
15
- product?: ID | AptlyProductSchema<ID, DATE> | null;
16
- period?: ID | AptlyPeriodSchema<ID, DATE> | null;
17
- algorithm?: ID | null;
19
+ product: ID | AptlyProductSchema<ID, DATE> | null;
20
+ producer: ID | AptlyProducerSchema<ID, DATE> | null;
21
+ offer: ID | AptlyOfferSchema<ID, DATE> | null;
22
+ offerItem: ID | null;
23
+ period: ID | AptlyPeriodSchema<ID, DATE> | null;
24
+ algorithm: ID | null;
25
+ thumbnail: AptlyMediaSrcSchema<ID, DATE> | null;
26
+ title: string;
18
27
  description: string;
19
28
  identification: string;
20
- quantity: number;
29
+ type: AptlyItemType;
30
+ quantity?: number;
21
31
  quantityUnitCode: AptlyQuantityUnitCode;
22
32
  quantityCategory: ID | AptlyCategorySchema<ID, DATE> | null;
23
33
  quantityCategoryKey?: string;
24
34
  amount: number;
25
- amountCategory: ID | AptlyCategorySchema<ID, DATE> | null;
26
- amountCategoryKey?: string;
27
35
  currency: AptlyCurrency;
28
36
  vatCategory: AptlyVatCategoryCode;
37
+ amountCategory: ID | AptlyCategorySchema<ID, DATE> | null;
38
+ amountCategoryKey?: string;
39
+ allowance?: AptlyAllowance;
40
+ allowanceCharge: AptlyAllowanceChargeSchema<ID, boolean>[];
29
41
  }
30
42
  export type AptlyOptionPopulated = AptlyOptionPopulatedSchema<string, string>;
31
- export interface AptlyOptionPopulatedSchema<ID, DATE> extends Omit<AptlyOptionSchema<ID, DATE>, 'product'> {
32
- price: AptlyOptionPopulatedPrice;
43
+ export interface AptlyOptionPopulatedSchema<ID, DATE> extends Omit<AptlyOptionSchema<ID, DATE>, 'product'>, AptlyExtensionAmount {
44
+ invoicedQuantity: number;
45
+ item: AptlyItem;
46
+ price: AptlyPrice;
33
47
  quantityCategory: AptlyCategorySchema<ID, DATE> | null;
34
48
  amountCategory: AptlyCategorySchema<ID, DATE> | null;
35
- period?: AptlyPeriodSchema<ID, DATE> | null;
36
- product?: AptlyProductSchema<ID, DATE> | null;
37
- }
38
- export interface AptlyOptionPopulatedPrice {
39
- amount: number;
40
- vat: number;
41
- vatAmount: number;
42
- pipeline: AptlyAlgorithmPipelineData[];
49
+ period: AptlyPeriodSchema<ID, DATE> | null;
50
+ product: AptlyProductSchema<ID, DATE> | null;
43
51
  }
package/models/order.d.ts CHANGED
@@ -1,18 +1,22 @@
1
1
  import { AptlyOrderStatus } from '../enums/index.js';
2
+ import { AptlyAddress } from './address.js';
2
3
  import { AptlyAppImplementationSetting, AptlyAppSchema } from './app.js';
4
+ import { AptlyCustomerSchema } from './customer.js';
3
5
  import { AptlyDocumentSchema } from './document.js';
4
6
  import { AptlyEmailSchema } from './email.js';
7
+ import { AptlyOfferSchema } from './offer.js';
5
8
  import { AptlyOrganizationAppConfigSchema, AptlyOrganizationSchema } from './organization.js';
6
9
  import { AptlyPaymentSchema } from './payment.js';
10
+ import { AptlyPickConfirmedSchema } from './pick.js';
7
11
  import { AptlyProductSchema } from './product.js';
8
12
  import { AptlyProject, AptlyProjectPeriodSchema, AptlyProjectSchema } from './project.js';
9
13
  import { AptlyUnit, AptlyUnitItemParamSchema, AptlyUnitSchema } from './unit.js';
10
- import { AptlyAddress, AptlyBaseSchema } from './extends.js';
14
+ import { AptlyBaseSchema } from './extends.js';
11
15
  import { AptlyUser, AptlyUserSchema } from './user.js';
12
16
  export declare enum AptlyOrderPaymentStatus {
13
17
  Pending = "PENDING",
14
- OnHold = "ON_HOLD",
15
18
  Authorized = "AUTHORIZED",
19
+ OnHold = "ON_HOLD",
16
20
  Captured = "CAPTURED"
17
21
  }
18
22
  export type AptlyOrder = AptlyOrderSchema<string, string>;
@@ -22,6 +26,7 @@ export interface AptlyOrderSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DAT
22
26
  project: ID | AptlyProjectSchema<ID, DATE>;
23
27
  period?: ID | AptlyProjectPeriodSchema<ID, DATE>;
24
28
  unit: ID | AptlyUnitSchema<ID, DATE>;
29
+ offer: ID | AptlyOfferSchema<ID, DATE> | null;
25
30
  signers: (ID | AptlyUserSchema<ID, DATE>)[];
26
31
  status: AptlyOrderStatus;
27
32
  receipt: ID | AptlyDocumentSchema<ID, DATE>;
@@ -29,12 +34,12 @@ export interface AptlyOrderSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DAT
29
34
  attachments: ID[];
30
35
  signage: AptlyOrderSignageSchema<ID, DATE>;
31
36
  items: AptlyOrderItemSchema<ID, DATE>[];
32
- picks: ID[];
37
+ picks: (ID | AptlyPickConfirmedSchema<ID, DATE>)[];
33
38
  amount?: number;
34
39
  vatAmount?: number;
35
40
  totalVat?: number;
36
41
  totalCost: number;
37
- customer?: AptlyOrderCustomerSchema<ID, DATE>;
42
+ customer?: AptlyCustomerSchema<ID, DATE>;
38
43
  shipping?: AptlyAddress;
39
44
  billing?: AptlyAddress;
40
45
  pricePipeline: AptlyOrderPricePipelineItemSchema<ID>[];
@@ -56,14 +61,14 @@ export type AptlyOrderPaymentSession = AptlyOrderPaymentSessionSchema<string, st
56
61
  export interface AptlyOrderPaymentSessionSchema<ID, DATE> {
57
62
  app?: ID | AptlyAppSchema<ID, DATE>;
58
63
  status?: AptlyOrderPaymentStatus;
59
- url?: string;
64
+ user?: ID | null;
60
65
  id?: string;
61
66
  at?: DATE | null;
62
- user?: ID | null;
67
+ url?: string;
68
+ notifiedAt?: DATE | null;
63
69
  expiresAt?: DATE | null;
64
70
  paidAt?: DATE | null;
65
71
  capturedAt?: DATE | null;
66
- notifiedAt?: DATE | null;
67
72
  }
68
73
  export type AptlyOrderSignee = AptlyOrderSigneeSchema<string, string>;
69
74
  export interface AptlyOrderSigneeSchema<ID, DATE> {
@@ -171,11 +176,3 @@ export interface AptlyOrderActionSignDataSignee {
171
176
  signMethod?: string;
172
177
  isAdmin?: boolean;
173
178
  }
174
- export type AptlyOrderCustomer = AptlyOrderCustomerSchema<string, string>;
175
- export interface AptlyOrderCustomerSchema<ID, DATE> {
176
- user: ID | AptlyUserSchema<ID, DATE>;
177
- firstName: string;
178
- lastName: string;
179
- email: string;
180
- phone?: string;
181
- }
package/models/order.js CHANGED
@@ -2,8 +2,8 @@ import { AptlyAppImplementationSetting } from './app.js';
2
2
  export var AptlyOrderPaymentStatus;
3
3
  (function (AptlyOrderPaymentStatus) {
4
4
  AptlyOrderPaymentStatus["Pending"] = "PENDING";
5
- AptlyOrderPaymentStatus["OnHold"] = "ON_HOLD";
6
5
  AptlyOrderPaymentStatus["Authorized"] = "AUTHORIZED";
6
+ AptlyOrderPaymentStatus["OnHold"] = "ON_HOLD";
7
7
  AptlyOrderPaymentStatus["Captured"] = "CAPTURED";
8
8
  })(AptlyOrderPaymentStatus || (AptlyOrderPaymentStatus = {}));
9
9
  export var AptlyOrderSigneeType;
@@ -1,10 +1,12 @@
1
1
  import { AptlyModules } from '../core/index.js';
2
2
  import { AptlyOrganizationRoles, AptlyAppScope, AptlySignageSchema } from '../core/index.js';
3
3
  import { AptlyOrganizationStatus, AptlyOrganizationType } from '../enums/index.js';
4
+ import { AptlyAddress } from './address.js';
5
+ import { AptlyInviteSchema } from './invite.js';
4
6
  import { AptlyModuleItemSchema } from './module.js';
5
7
  import { AptlyUserSchema } from './user.js';
6
8
  import { AptlyMediaSrc } from './media.js';
7
- import { AptlyAddress, AptlyBaseSchema, AptlyHistorySchema } from './extends.js';
9
+ import { AptlyBaseSchema, AptlyHistorySchema } from './extends.js';
8
10
  import { AptlyDepartmentGeneric } from './department.js';
9
11
  import { AptlyProducerSchema } from './producer.js';
10
12
  import { AptlyAppSchema } from './app.js';
@@ -72,21 +74,12 @@ export declare enum AptlyOrganizationMemberPosition {
72
74
  User = 10
73
75
  }
74
76
  export type AptlyOrganizationInvite = AptlyOrganizationInviteSchema<string, string>;
75
- export interface AptlyOrganizationInviteSchema<ID, DATE> {
76
- _id: ID;
77
- code: string;
78
- created: DATE;
77
+ export interface AptlyOrganizationInviteSchema<ID, DATE> extends AptlyInviteSchema<ID, DATE> {
79
78
  permissions?: AptlyOrganizationRoles[];
80
79
  projects?: ID[] | null;
81
80
  departments?: ID[] | null;
82
81
  position?: AptlyOrganizationMemberPosition;
83
- clickCount?: number;
84
- claim: {
85
- email?: string;
86
- claimed: boolean;
87
- claimedBy: ID;
88
- claimTime?: DATE;
89
- };
82
+ clickCount: number;
90
83
  }
91
84
  export type AptlyOrganizationAppConfig<S extends object = object> = AptlyOrganizationAppConfigSchema<string, string, S>;
92
85
  export interface AptlyOrganizationAppConfigSchema<ID, DATE, S extends object = object> extends Omit<AptlyBaseSchema<ID, DATE>, 'name' | 'archived'> {
@@ -1,8 +1,11 @@
1
+ import { AptlyAddress } from './address.js';
1
2
  import { AptlyAppSchema } from './app.js';
3
+ import { AptlyCustomerSchema } from './customer.js';
2
4
  import { AptlyDocumentSchema } from './document.js';
3
- import { AptlyAddress, AptlyBaseSchema } from './extends.js';
5
+ import { AptlyBaseSchema } from './extends.js';
4
6
  import { AptlyOrderPaymentStatus, AptlyOrderSchema } from './order.js';
5
7
  import { AptlyOrganizationSchema } from './organization.js';
8
+ import { AptlyPickConfirmedSchema } from './pick.js';
6
9
  import { AptlyProjectSchema } from './project.js';
7
10
  import { AptlyUnitSchema } from './unit.js';
8
11
  import { AptlyUserSchema } from './user.js';
@@ -17,15 +20,18 @@ export interface AptlyPaymentSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, D
17
20
  reportDocument?: ID | AptlyDocumentSchema<ID, DATE>;
18
21
  status: AptlyPaymentStatus;
19
22
  number: number;
23
+ amount: number;
24
+ vatAmount: number;
20
25
  totalCost: number;
21
26
  totalVat: number;
22
27
  items: AptlyPaymentItemSchema<ID>[];
28
+ picks: (ID | AptlyPickConfirmedSchema<ID, DATE>)[];
23
29
  transaction: {
24
30
  ref: string;
25
31
  at: DATE;
26
32
  };
27
33
  company: AptlyPaymentCompany;
28
- customer: AptlyPaymentCustomerSchema<ID, DATE>;
34
+ customer: AptlyCustomerSchema<ID, DATE>;
29
35
  shipping: AptlyAddress;
30
36
  shippingDate?: DATE;
31
37
  shippingDescription?: string;
@@ -70,14 +76,6 @@ export interface AptlyPaymentCompany {
70
76
  address: AptlyAddress;
71
77
  phone?: string;
72
78
  }
73
- export type AptlyPaymentCustomer = AptlyPaymentCustomerSchema<string, string>;
74
- export interface AptlyPaymentCustomerSchema<ID, DATE> {
75
- user: ID | AptlyUserSchema<ID, DATE>;
76
- firstName: string;
77
- lastName: string;
78
- email: string;
79
- phone?: string;
80
- }
81
79
  export interface AptlyPaymentItemSchema<ID> {
82
80
  _id: ID;
83
81
  name: string;
@@ -102,7 +100,7 @@ export interface AptlyPaymentTransactionBody {
102
100
  id: string;
103
101
  at: string;
104
102
  customer: {
105
- user: string;
103
+ user?: string;
106
104
  firstName: string;
107
105
  lastName: string;
108
106
  email: string;
package/models/pick.d.ts CHANGED
@@ -1,52 +1,53 @@
1
- import { AptlyCurrency, AptlyInternationalCodeDesignator, AptlyQuantityUnitCode, AptlyTaxCategoryScheme, AptlyVatCategoryCode } from '../enums/index.js';
1
+ import { AptlyCurrency, AptlyQuantityUnitCode } from '../enums/index.js';
2
+ import { AptlyAlgorithmPipelineDataItemSchema, AptlyPrice } from './algorithm.js';
2
3
  import { AptlyBaseSchema } from './extends.js';
3
- import { AptlyOptionSchema } from './option.js';
4
+ import { AptlyOfferSchema } from './offer.js';
5
+ import { AptlyOptionPopulatedSchema, AptlyOptionSchema } from './option.js';
6
+ import { AptlyOrderSchema } from './order.js';
4
7
  import { AptlyOrganizationSchema } from './organization.js';
8
+ import { AptlyItem } from './item.js';
9
+ import { AptlyProducerSchema } from './producer.js';
5
10
  import { AptlyProjectSchema } from './project.js';
6
11
  import { AptlyCategorySchema } from './category.js';
7
12
  import { AptlyUnitSchema } from './unit.js';
8
- export interface AptlyPickSchema<ID, DATE> extends Pick<AptlyBaseSchema<ID, DATE>, '_id' | 'createdAt' | 'updatedAt'> {
13
+ export type AptlyPick = AptlyPickSchema<string, string>;
14
+ export interface AptlyPickSchema<ID, DATE> extends Pick<AptlyBaseSchema<ID, DATE>, '_id' | 'archived' | 'createdAt' | 'updatedAt'> {
9
15
  organization: ID | AptlyOrganizationSchema<ID, DATE>;
10
16
  project: ID | AptlyProjectSchema<ID, DATE>;
11
17
  unit: ID | AptlyUnitSchema<ID, DATE>;
12
18
  option: ID | AptlyOptionSchema<ID, DATE>;
13
19
  category: ID | AptlyCategorySchema<ID, DATE> | null;
14
- period?: ID | null;
15
- quantity: number;
20
+ producer: ID | AptlyProducerSchema<ID, DATE> | null;
21
+ offer: ID | AptlyOfferSchema<ID, DATE> | null;
22
+ offerItem: ID | null;
23
+ order: ID | AptlyOrderSchema<ID, DATE> | null;
24
+ period: ID | null;
25
+ quantity?: number;
16
26
  note: string;
17
- item: AptlyPickItem | null;
18
- price: AptlyPickPrice | null;
27
+ invoicedQuantity?: number | null;
28
+ quantityUnitCode?: AptlyQuantityUnitCode | null;
29
+ extensionAmount?: number | null;
30
+ extensionVatAmount?: number | null;
31
+ currency?: AptlyCurrency | null;
32
+ item: AptlyItem | null;
33
+ price: AptlyPrice | null;
34
+ algorithm: ID | null;
35
+ pipeline: AptlyAlgorithmPipelineDataItemSchema<ID>[];
19
36
  confirmedAt: DATE | null;
20
37
  }
21
- export interface AptlyPickConfirmedSchema<ID, DATE> extends AptlyPickSchema<ID, DATE> {
22
- item: AptlyPickItem;
23
- price: AptlyPickPrice;
38
+ export type AptlyPickConfirmed = AptlyPickConfirmedSchema<string, string>;
39
+ export type AptlyPickConfirmedSchema<ID, DATE> = Omit<AptlyPickSchema<ID, DATE>, 'option'> & AptlyPickConfirmedFieldsSchema<ID, DATE> & {
40
+ option: AptlyOptionPopulatedSchema<ID, DATE>;
41
+ };
42
+ export interface AptlyPickConfirmedFieldsSchema<ID, DATE> {
43
+ item: AptlyItem;
24
44
  confirmedAt: DATE;
25
- }
26
- export interface AptlyPickItem {
27
- name: string;
28
- description: string;
29
- sellersIdentification?: string;
30
- standardIdentification?: {
31
- scheme: AptlyInternationalCodeDesignator;
32
- value: string;
33
- };
34
- vatCategory: {
35
- id: AptlyVatCategoryCode;
36
- percent: number;
37
- taxScheme: AptlyTaxCategoryScheme;
38
- };
39
- properties: AptlyPickItemProperty[];
40
- }
41
- interface AptlyPickItemProperty {
42
- name: string;
43
- value: string;
44
- }
45
- interface AptlyPickPrice {
46
- quantity: number;
45
+ order: ID | AptlyOrderSchema<ID, DATE>;
46
+ invoicedQuantity: number;
47
47
  quantityUnitCode: AptlyQuantityUnitCode;
48
- amount: number;
49
- vatAmount: number;
48
+ price: AptlyPrice;
49
+ extensionAmount: number;
50
+ extensionVatAmount: number;
50
51
  currency: AptlyCurrency;
52
+ pipeline: AptlyAlgorithmPipelineDataItemSchema<ID>[];
51
53
  }
52
- export {};
@@ -1,11 +1,12 @@
1
1
  import { AptlyEmailType, AptlyProjectStatus } from '../enums/index.js';
2
+ import { AptlyAddress } from './address.js';
2
3
  import { AptlyAlgorithm, AptlyAlgorithmPipeline, AptlyAlgorithmPipelineSchema, AptlyAlgorithmSchema } from './algorithm.js';
3
4
  import { AptlyAppSchema } from './app.js';
4
5
  import { AptlyOrganizationSchema } from './organization.js';
5
6
  import { AptlyModules } from '../core/index.js';
6
7
  import { AptlyPeriod, AptlyPeriodSchema } from './period.js';
7
8
  import { AptlyUserSchema } from './user.js';
8
- import { AptlyAddress, AptlyBaseSchema, AptlyHistorySchema } from './extends.js';
9
+ import { AptlyBaseSchema, AptlyHistorySchema } from './extends.js';
9
10
  import { AptlyDocumentSchema } from './document.js';
10
11
  import { AptlyUnitOptionExtraItemSchema } from './unit.js';
11
12
  import { AptlyMediaSrc } from './media.js';
package/models/unit.d.ts CHANGED
@@ -1,11 +1,13 @@
1
+ import { AptlyAddress } from './address.js';
1
2
  import { AptlyCategorySchema } from './category.js';
2
3
  import { AptlyDocumentSchema } from './document.js';
4
+ import { AptlyInviteSchema } from './invite.js';
3
5
  import { AptlyOrderSchema } from './order.js';
4
6
  import { AptlyPeriodSchema } from './period.js';
5
7
  import { AptlyProducerSchema } from './producer.js';
6
8
  import { AptlyProductSchema } from './product.js';
7
9
  import { AptlyProjectSchema } from './project.js';
8
- import { AptlyAddress, AptlyHistorySchema } from './extends.js';
10
+ import { AptlyHistorySchema } from './extends.js';
9
11
  import { AptlyUnitTemplateBaseSchema, AptlyUnitTemplateCategorySchema, AptlyUnitTemplateCategorySectionSchema, AptlyUnitTemplateSchema } from './unit-template';
10
12
  import { AptlyIntegration, AptlyUnitItemParamKey, AptlyUnitStatus } from '../enums/index.js';
11
13
  import { AptlyUserSchema } from './user.js';
@@ -14,6 +16,7 @@ export type AptlyUnit = AptlyUnitSchema<string, string>;
14
16
  export interface AptlyUnitSchema<ID, DATE> extends AptlyUnitTemplateBaseSchema<ID, DATE>, AptlyUnitEditData<DATE>, AptlyHistorySchema<ID, DATE> {
15
17
  status: AptlyUnitStatus;
16
18
  vat?: string;
19
+ addressHash?: string;
17
20
  shipping?: AptlyAddress;
18
21
  billing?: AptlyAddress;
19
22
  rooms: AptlyUnitRoomSchema<ID, DATE>[];
@@ -26,7 +29,7 @@ export interface AptlyUnitSchema<ID, DATE> extends AptlyUnitTemplateBaseSchema<I
26
29
  productOverrides: AptlyUnitProductOverrideSchema<ID>[];
27
30
  ordersToSign: ID[];
28
31
  categoriesRead: ID[];
29
- spec: AptlyUnitSpec;
32
+ spec: AptlyUnitSpec<ID>;
30
33
  buildStep: number;
31
34
  documents: (AptlyDocumentSchema<ID, DATE> | ID)[];
32
35
  unitPlans: {
@@ -169,8 +172,9 @@ export interface AptlyUnitProductOverrideVariantPriceSchema<ID> {
169
172
  variant: ID;
170
173
  price: number;
171
174
  }
172
- export interface AptlyUnitSpec {
175
+ export interface AptlyUnitSpec<ID> {
173
176
  categories: {
177
+ _id: ID;
174
178
  name: string;
175
179
  isRoom: boolean;
176
180
  size: number;
@@ -209,7 +213,8 @@ interface AptlyUnitEditData<DATE> {
209
213
  garagePortNumber?: string;
210
214
  garagePowerID?: string;
211
215
  electricCar?: string;
212
- unitNumber?: number;
216
+ unitNumber?: string;
217
+ countyNumber?: string;
213
218
  holdingNumber?: number;
214
219
  subHoldingNumber?: number;
215
220
  leaseNumber?: number;
@@ -234,22 +239,9 @@ export interface AptlyUnitInviteQueueSchema {
234
239
  fullName?: string;
235
240
  phone?: string;
236
241
  }
237
- export interface AptlyUnitInviteSchema<ID, DATE> {
238
- _id: ID;
239
- code: string;
240
- created: DATE;
241
- createdBy?: ID | AptlyUserSchema<ID, DATE>;
242
+ export interface AptlyUnitInviteSchema<ID, DATE> extends AptlyInviteSchema<ID, DATE> {
242
243
  newOwner: boolean;
243
244
  allowAsGuest?: boolean;
244
- sendCount?: number;
245
- claim: {
246
- email: string;
247
- fullName?: string;
248
- phone?: string;
249
- claimed: boolean;
250
- claimedBy?: ID;
251
- claimTime?: DATE;
252
- };
253
245
  }
254
246
  export type AptlyUnitPeriod = AptlyUnitPeriodSchema<string, string>;
255
247
  export type AptlyUnitPeriodSchema<ID, DATE> = AptlyPeriodSchema<ID, DATE> & Pick<AptlyUnitConfirmedPeriodSchema<ID, DATE>, 'confirmed' | 'order'>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptly-as/types",
3
- "version": "2.9.1",
3
+ "version": "3.0.0",
4
4
  "description": "Aptly types and enums",
5
5
  "type": "module",
6
6
  "main": "./index.js",