@aptly-as/types 3.1.5 → 3.2.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.
@@ -32,7 +32,7 @@ export declare namespace AptlyWebhookEventData {
32
32
  project: Project<ID, DATE>;
33
33
  unit: Pick<AptlyUnitSchema<ID, DATE>, '_id' | 'name' | 'shipping' | 'users'>;
34
34
  order: AptlyOrderSchema<ID, DATE>;
35
- offer?: Pick<AptlyOfferSchema<ID, DATE>, '_id' | 'name' | 'number'>;
35
+ offer?: Pick<AptlyOfferSchema<ID, DATE>, '_id' | 'name' | 'number' | 'description'>;
36
36
  receiptUrl?: string;
37
37
  signedReceiptUrl?: string;
38
38
  }
@@ -83,16 +83,26 @@ export interface AptlyExtensionPrice extends AptlyExtensionAmount {
83
83
  price?: AptlyPrice;
84
84
  currency: AptlyCurrency;
85
85
  }
86
+ export interface AptlyLegalMonetaryTotal {
87
+ lineExtensionAmount: number;
88
+ taxExclusiveAmount: number;
89
+ taxInclusiveAmount: number;
90
+ allowanceTotalAmount: number;
91
+ chargeTotalAmount: number;
92
+ }
86
93
  export interface AptlyAllowance {
87
94
  amount?: number;
88
95
  multiplier?: number;
89
96
  incVAT?: boolean;
90
97
  }
91
98
  export type AptlyAllowanceCharge<CHARGE extends boolean> = AptlyAllowanceChargeSchema<string, CHARGE>;
99
+ export type AptlyAllowanceChargeItem<CHARGE extends boolean> = AptlyAllowanceChargeItemSchema<string, CHARGE>;
100
+ export type AptlyAllowanceChargeItemSchema<ID, CHARGE extends boolean> = Omit<AptlyAllowanceChargeSchema<ID, CHARGE>, 'vatCategory'>;
92
101
  export interface AptlyAllowanceChargeSchema<ID, CHARGE extends boolean> extends AptlyAllowance {
93
102
  _id: ID;
94
103
  chargeIndicator: CHARGE;
95
104
  code: CHARGE extends true ? AptlyChargeReasonCode : AptlyAllowanceReasonCode;
96
105
  reason: string;
97
106
  baseAmount?: number;
107
+ vatCategory?: AptlyVatCategory;
98
108
  }
package/models/offer.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Populated } from '../core/mongoose.js';
2
2
  import { AptlyAddress, AptlySearchAddress } from './address.js';
3
- import { AptlyAllowance, AptlyExtensionAmount } from './algorithm.js';
3
+ import { AptlyAllowance, AptlyAllowanceChargeSchema, AptlyExtensionAmount, AptlyLegalMonetaryTotal } from './algorithm.js';
4
4
  import { AptlyCustomer, AptlyCustomerSchema } from './customer.js';
5
5
  import { AptlyDocumentSchema } from './document.js';
6
6
  import { AptlyBaseSchema } from './extends.js';
@@ -78,4 +78,6 @@ export interface AptlyPublicOfferCheckoutSchema<ID, DATE> extends AptlyExtension
78
78
  active: boolean;
79
79
  };
80
80
  };
81
+ total: AptlyLegalMonetaryTotal;
82
+ allowanceCharges: AptlyAllowanceChargeSchema<ID, boolean>[];
81
83
  }
@@ -1,5 +1,5 @@
1
1
  import { AptlyQuantityUnitCode } from '../enums/index.js';
2
- import { AptlyAllowanceChargeSchema, AptlyAllowance, AptlyExtensionAmount, AptlyPrice } from './algorithm.js';
2
+ import { AptlyAllowance, AptlyExtensionAmount, AptlyPrice, AptlyAllowanceChargeItemSchema } from './algorithm.js';
3
3
  import { AptlyBaseSchema } from './extends.js';
4
4
  import { AptlyItemSchema, AptlyItemType } from './item.js';
5
5
  import { AptlyMediaSrcSchema } from './media.js';
@@ -37,7 +37,7 @@ export interface AptlyOptionSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
37
37
  amountCategory: ID | AptlyCategorySchema<ID, DATE> | null;
38
38
  amountCategoryKey?: string;
39
39
  allowance?: AptlyAllowance | null;
40
- allowanceCharge: AptlyAllowanceChargeSchema<ID, boolean>[];
40
+ allowanceCharge: AptlyAllowanceChargeItemSchema<ID, boolean>[];
41
41
  }
42
42
  export type AptlyOptionPopulated = AptlyOptionPopulatedSchema<string, string>;
43
43
  export interface AptlyOptionPopulatedSchema<ID, DATE> extends Omit<AptlyOptionSchema<ID, DATE>, 'product'>, AptlyExtensionAmount {
package/models/order.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { AptlyOrderStatus } from '../enums/index.js';
2
2
  import { AptlyAddress } from './address.js';
3
+ import { AptlyAllowanceChargeSchema, AptlyLegalMonetaryTotal } from './algorithm.js';
3
4
  import { AptlyAppImplementationSetting, AptlyAppSchema } from './app.js';
4
5
  import { AptlyCustomerSchema } from './customer.js';
5
6
  import { AptlyDocumentSchema } from './document.js';
@@ -40,6 +41,8 @@ export interface AptlyOrderSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DAT
40
41
  vatAmount?: number;
41
42
  totalVat?: number;
42
43
  totalCost: number;
44
+ total?: AptlyLegalMonetaryTotal | null;
45
+ allowanceCharges: AptlyAllowanceChargeSchema<ID, boolean>[];
43
46
  customer?: AptlyCustomerSchema<ID, DATE>;
44
47
  shipping?: AptlyAddress;
45
48
  billing?: AptlyAddress;
@@ -1,4 +1,5 @@
1
1
  import { AptlyAddress } from './address.js';
2
+ import { AptlyAllowanceChargeSchema, AptlyLegalMonetaryTotal } from './algorithm.js';
2
3
  import { AptlyAppSchema } from './app.js';
3
4
  import { AptlyCustomer, AptlyCustomerSchema } from './customer.js';
4
5
  import { AptlyDocumentSchema } from './document.js';
@@ -24,6 +25,8 @@ export interface AptlyPaymentSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, D
24
25
  vatAmount: number;
25
26
  totalCost: number;
26
27
  totalVat: number;
28
+ total?: AptlyLegalMonetaryTotal | null;
29
+ allowanceCharges?: AptlyAllowanceChargeSchema<ID, boolean>[];
27
30
  items: AptlyPaymentItemSchema<ID>[];
28
31
  picks: (ID | AptlyPickConfirmedSchema<ID, DATE>)[];
29
32
  transaction: {
package/models/pick.d.ts CHANGED
@@ -22,6 +22,7 @@ export interface AptlyPickSchema<ID, DATE> extends Pick<AptlyBaseSchema<ID, DATE
22
22
  offerItem: ID | null;
23
23
  order: ID | AptlyOrderSchema<ID, DATE> | null;
24
24
  period: ID | null;
25
+ index: number;
25
26
  quantity?: number;
26
27
  note: string;
27
28
  invoicedQuantity?: number | null;
@@ -1,6 +1,6 @@
1
1
  import { AptlyCurrency, AptlyQuantityUnitCode } from '../enums/index.js';
2
2
  import { AptlyAddress } from './address.js';
3
- import { AptlyPrice } from './algorithm.js';
3
+ import { AptlyAllowanceChargeSchema, AptlyLegalMonetaryTotal, AptlyPrice } from './algorithm.js';
4
4
  import { AptlyCustomerSchema } from './customer.js';
5
5
  import { AptlyItemSchema } from './item.js';
6
6
  import { AptlyOrganizationSchema } from './organization.js';
@@ -12,15 +12,15 @@ export interface AptlyPlanPaymentSchema<ID, DATE> {
12
12
  users: ID[];
13
13
  from: DATE;
14
14
  to: DATE;
15
- amount: number;
16
- vatAmount: number;
15
+ total: AptlyLegalMonetaryTotal;
16
+ allowanceCharges: AptlyAllowanceChargeSchema<ID, boolean>[];
17
17
  customer: AptlyCustomerSchema<ID, DATE>;
18
18
  billing: AptlyAddress;
19
- items: AptlyPlanPaymentItemSchema<ID, DATE>[];
19
+ lines: AptlyPlanPaymentLineSchema<ID, DATE>[];
20
20
  createdAt: DATE;
21
21
  }
22
- export type AptlyPlanPaymentItem = AptlyPlanPaymentItemSchema<string, string>;
23
- export interface AptlyPlanPaymentItemSchema<ID, DATE> {
22
+ export type AptlyPlanPaymentItem = AptlyPlanPaymentLineSchema<string, string>;
23
+ export interface AptlyPlanPaymentLineSchema<ID, DATE> {
24
24
  _id: ID;
25
25
  item: AptlyItemSchema<ID, DATE>;
26
26
  invoicedQuantity: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptly-as/types",
3
- "version": "3.1.5",
3
+ "version": "3.2.1",
4
4
  "description": "Aptly types and enums",
5
5
  "type": "module",
6
6
  "main": "./index.js",