@aptly-as/types 3.9.2 → 3.10.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.
package/core/scope.d.ts CHANGED
@@ -49,6 +49,7 @@ export declare enum AptlyScopes {
49
49
  OrganizationBooking = "organizationBooking",
50
50
  OrganizationCategories = "organizationCategories",
51
51
  OrganizationClients = "organizationClients",
52
+ OrganizationCustomers = "organizationCustomers",
52
53
  OrganizationDepartments = "organizationDepartments",
53
54
  OrganizationDocuments = "organizationDocuments",
54
55
  OrganizationLogo = "organizationLogo",
package/core/scope.js CHANGED
@@ -51,6 +51,7 @@ export var AptlyScopes;
51
51
  AptlyScopes["OrganizationBooking"] = "organizationBooking";
52
52
  AptlyScopes["OrganizationCategories"] = "organizationCategories";
53
53
  AptlyScopes["OrganizationClients"] = "organizationClients";
54
+ AptlyScopes["OrganizationCustomers"] = "organizationCustomers";
54
55
  AptlyScopes["OrganizationDepartments"] = "organizationDepartments";
55
56
  AptlyScopes["OrganizationDocuments"] = "organizationDocuments";
56
57
  AptlyScopes["OrganizationLogo"] = "organizationLogo";
@@ -1,11 +1,24 @@
1
+ import { AptlyBaseSchema } from './extends.js';
1
2
  import { AptlyUserSchema } from './user.js';
2
3
  export type AptlyCustomer = AptlyCustomerSchema<string, string>;
3
- export interface AptlyCustomerSchema<ID, DATE> {
4
+ export interface AptlyCustomerSchema<ID, DATE> extends Pick<AptlyBaseSchema<ID, DATE>, '_id' | 'createdAt' | 'updatedAt'> {
5
+ organization: ID;
4
6
  user?: ID | AptlyUserSchema<ID, DATE> | null;
7
+ email: string;
5
8
  fullName: string;
6
9
  firstName: string;
7
10
  lastName: string;
11
+ phone: string;
12
+ companyName: string;
13
+ companyVat: string;
14
+ }
15
+ export type AptlyCustomerData = AptlyCustomerDataSchema<string, string>;
16
+ export interface AptlyCustomerDataSchema<ID, DATE> {
17
+ user?: ID | AptlyUserSchema<ID, DATE> | null;
8
18
  email: string;
19
+ fullName: string;
20
+ firstName: string;
21
+ lastName: string;
9
22
  phone?: string;
10
23
  companyName?: string;
11
24
  companyVat?: string;
package/models/info.d.ts CHANGED
@@ -9,6 +9,7 @@ export interface AptlyInfoSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
9
9
  media: AptlyMediaSrcSchema<ID, DATE> | null;
10
10
  embed: string;
11
11
  module: AptlyModules;
12
+ modules: AptlyModules[];
12
13
  description: string;
13
14
  levels: AptlySlugLevel[];
14
15
  href: string;
package/models/offer.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Populated } from '../core/mongoose.js';
2
2
  import { AptlyAddress, AptlySearchAddress } from './address.js';
3
3
  import { AptlyAllowance, AptlyAllowanceChargeSchema, AptlyExtensionAmount, AptlyLegalMonetaryTotal } from './algorithm.js';
4
- import { AptlyCustomer, AptlyCustomerSchema } from './customer.js';
4
+ import { AptlyCustomerData, AptlyCustomerDataSchema } from './customer.js';
5
5
  import { AptlyDocumentSchema } from './document.js';
6
6
  import { AptlyBaseSchema } from './extends.js';
7
7
  import { AptlyOptionPopulatedSchema, AptlyOptionSchema } from './option.js';
@@ -32,7 +32,7 @@ export interface AptlyOfferSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>, O
32
32
  allowance?: AptlyAllowance | null;
33
33
  algorithm: ID | null;
34
34
  items: AptlyOfferItemSchema<ID, DATE>[];
35
- customer: AptlyCustomerSchema<ID, DATE> | null;
35
+ customer: AptlyCustomerDataSchema<ID, DATE> | null;
36
36
  shipping: AptlyAddress | null;
37
37
  openedAt: DATE | null;
38
38
  acceptedAt: DATE | null;
@@ -66,12 +66,12 @@ export interface AptlyOfferSendUnitBody {
66
66
  phone?: string;
67
67
  app?: AptlyApp | string | null;
68
68
  }
69
- export interface AptlyOfferSendPrivateBody extends Omit<AptlyCustomer, 'fullName' | 'user'> {
69
+ export interface AptlyOfferSendPrivateBody extends Omit<AptlyCustomerData, 'fullName' | 'user'> {
70
70
  unit: string | null;
71
71
  address: AptlySearchAddress | null;
72
72
  app?: AptlyApp | string | null;
73
73
  }
74
- export interface AptlyOfferSendCompanyBody extends Omit<AptlyCustomer, 'fullName' | 'user'> {
74
+ export interface AptlyOfferSendCompanyBody extends Omit<AptlyCustomerData, 'fullName' | 'user'> {
75
75
  company: Pick<AptlyOrganization, 'name' | 'vat' | 'address'>;
76
76
  address: AptlyAddress;
77
77
  app?: AptlyApp | string | null;
@@ -101,7 +101,7 @@ export interface AptlyPublicOfferCheckoutSchema<ID, DATE> extends AptlyExtension
101
101
  allowanceCharges: AptlyAllowanceChargeSchema<ID, boolean>[];
102
102
  }
103
103
  export interface AptlyPublicOfferAcceptBody {
104
- customer: AptlyCustomer;
104
+ customer: AptlyCustomerData;
105
105
  shipping: AptlyAddress;
106
106
  billing: AptlyAddress | null;
107
107
  redirectUri: string;
package/models/order.d.ts CHANGED
@@ -2,7 +2,7 @@ import { AptlyOrderStatus } from '../enums/index.js';
2
2
  import { AptlyAddress } from './address.js';
3
3
  import { AptlyAllowanceChargeSchema, AptlyLegalMonetaryTotal } from './algorithm.js';
4
4
  import { AptlyAppImplementationSetting, AptlyAppSchema } from './app.js';
5
- import { AptlyCustomerSchema } from './customer.js';
5
+ import { AptlyCustomerDataSchema } from './customer.js';
6
6
  import { AptlyDocumentSchema } from './document.js';
7
7
  import { AptlyEmailSchema } from './email.js';
8
8
  import { AptlyOfferSchema } from './offer.js';
@@ -46,7 +46,7 @@ export interface AptlyOrderSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DAT
46
46
  totalCost: number;
47
47
  total?: AptlyLegalMonetaryTotal | null;
48
48
  allowanceCharges: AptlyAllowanceChargeSchema<ID, boolean>[];
49
- customer?: AptlyCustomerSchema<ID, DATE>;
49
+ customer?: AptlyCustomerDataSchema<ID, DATE>;
50
50
  shipping?: AptlyAddress;
51
51
  billing?: AptlyAddress;
52
52
  pricePipeline: AptlyOrderPricePipelineItemSchema<ID>[];
@@ -1,7 +1,7 @@
1
1
  import { AptlyAddress } from './address.js';
2
2
  import { AptlyAllowanceChargeSchema, AptlyLegalMonetaryTotal } from './algorithm.js';
3
3
  import { AptlyAppSchema } from './app.js';
4
- import { AptlyCustomer, AptlyCustomerSchema } from './customer.js';
4
+ import { AptlyCustomerData, AptlyCustomerDataSchema } from './customer.js';
5
5
  import { AptlyDocumentSchema } from './document.js';
6
6
  import { AptlyBaseSchema } from './extends.js';
7
7
  import { AptlyOrder, AptlyOrderSchema } from './order.js';
@@ -37,7 +37,7 @@ export interface AptlyPaymentSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, D
37
37
  at: DATE;
38
38
  };
39
39
  company: AptlyPaymentCompany;
40
- customer: AptlyCustomerSchema<ID, DATE>;
40
+ customer: AptlyCustomerDataSchema<ID, DATE>;
41
41
  shipping: AptlyAddress;
42
42
  shippingDate?: DATE;
43
43
  shippingDescription?: string;
@@ -100,7 +100,7 @@ export interface AptlyPaymentInitPaymentBody {
100
100
  project: AptlyProjectContent;
101
101
  unit: AptlyUnitContent;
102
102
  order: AptlyOrder;
103
- customer: AptlyCustomer;
103
+ customer: AptlyCustomerData;
104
104
  shipping: AptlyAddress;
105
105
  billing: AptlyAddress;
106
106
  redirectUri: string;
@@ -1,7 +1,7 @@
1
1
  import { AptlyCurrency, AptlyQuantityUnitCode } from '../enums/index.js';
2
2
  import { AptlyAddress } from './address.js';
3
3
  import { AptlyAllowanceChargeSchema, AptlyLegalMonetaryTotal, AptlyPrice } from './algorithm.js';
4
- import { AptlyCustomerSchema } from './customer.js';
4
+ import { AptlyCustomerDataSchema } from './customer.js';
5
5
  import { AptlyItemSchema } from './item.js';
6
6
  import { AptlyOrganizationSchema } from './organization.js';
7
7
  export type AptlyPlanPayment = AptlyPlanPaymentSchema<string, string>;
@@ -14,7 +14,7 @@ export interface AptlyPlanPaymentSchema<ID, DATE> {
14
14
  to: DATE;
15
15
  total: AptlyLegalMonetaryTotal;
16
16
  allowanceCharges: AptlyAllowanceChargeSchema<ID, boolean>[];
17
- customer: AptlyCustomerSchema<ID, DATE>;
17
+ customer: AptlyCustomerDataSchema<ID, DATE>;
18
18
  billing: AptlyAddress;
19
19
  lines: AptlyPlanPaymentLineSchema<ID, DATE>[];
20
20
  createdAt: DATE;
@@ -19,7 +19,6 @@ export interface AptlyProjectSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>,
19
19
  template?: ID | null;
20
20
  customers: ID[];
21
21
  periods: AptlyPeriodSchema<ID, DATE>[];
22
- algorithms: AptlyAlgorithmSchema<ID>[];
23
22
  documents: AptlyDocumentSchema<ID, DATE>[];
24
23
  pages: (ID | AptlyPageSchema<ID, DATE>)[];
25
24
  myPageText?: string;
@@ -37,6 +36,8 @@ export interface AptlyProjectSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>,
37
36
  field?: string;
38
37
  address?: AptlyAddress;
39
38
  invoiceEmail?: string;
39
+ algorithms: AptlyAlgorithmSchema<ID>[];
40
+ algorithm: ID | null;
40
41
  paymentApp?: ID | AptlyAppSchema<ID, DATE> | null;
41
42
  invites?: AptlyProjectInviteSchema<ID, DATE>[];
42
43
  signApp?: ID | AptlyAppSchema<ID, DATE> | null;
package/models/unit.d.ts CHANGED
@@ -12,6 +12,7 @@ import { AptlyUnitTemplateBaseSchema, AptlyUnitTemplateCategorySchema, AptlyUnit
12
12
  import { AptlyIntegration, AptlyUnitItemParamKey, AptlyUnitStatus } from '../enums/index.js';
13
13
  import { AptlyUserSchema } from './user.js';
14
14
  import { AptlyOrganizationSchema } from './organization.js';
15
+ import { AptlyCustomerSchema } from './customer.js';
15
16
  export type AptlyUnitContent = AptlyUnitContentSchema<string, string>;
16
17
  export type AptlyUnitContentSchema<ID, DATE> = Pick<AptlyUnitSchema<ID, DATE>, '_id' | 'name' | 'address' | 'shipping' | 'billing'>;
17
18
  export type AptlyUnit = AptlyUnitSchema<string, string>;
@@ -41,6 +42,7 @@ export interface AptlyUnitSchema<ID, DATE> extends AptlyUnitTemplateBaseSchema<I
41
42
  organization: AptlyOrganizationSchema<ID, DATE> | ID;
42
43
  project: AptlyProjectSchema<ID, DATE> | ID;
43
44
  users: (AptlyUserSchema<ID, DATE> | ID)[];
45
+ customers: (AptlyCustomerSchema<ID, DATE> | ID)[];
44
46
  unitTemplate?: ID | AptlyUnitTemplateSchema<ID, DATE> | null;
45
47
  unitTemplateEjected?: boolean;
46
48
  confirmedPeriods: AptlyUnitConfirmedPeriodSchema<ID, DATE>[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptly-as/types",
3
- "version": "3.9.2",
3
+ "version": "3.10.1",
4
4
  "description": "Aptly types and enums",
5
5
  "type": "module",
6
6
  "main": "./index.js",