@vini-wine/admin-core-models 1.0.2 → 1.1.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/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { CurrencyCodeEnum, UploadVisibilityTypeEnum, ContactPointTypeEnum, CurrencyRateSourceEnum, OrganisationStatusEnum, UserStatusEnum, GenderEnum, LocaleEnum, ImageVariationEnum, ImageTypeEnum, UserOrganisationStatusEnum, TimezoneEnum, DateTimeFormatEnum, OfferAlertFilterCriteriaFieldEnum, FilterOperatorEnum, UploadStatusEnum, UploadTypeEnum, CountryEnum, NotificationChannelEnum, NotificationTypeEnum, VintageScoreAuthorEnum, PackageEnum, OfferAlertTimelineActionEnum, OfferRequestStatusEnum, OfferRequestOptionEnum, OfferRequestOptionStatusEnum, OfferRequestTimelineActionEnum, OrganisationUserInvitationStatusEnum } from '@vini-wine/core-enums';
1
+ import { CurrencyCodeEnum, UploadVisibilityTypeEnum, ContactPointTypeEnum, CountryEnum, OrganisationStatusEnum, UserOrganisationStatusEnum, GenderEnum, LocaleEnum, UserStatusEnum, ImageVariationEnum, ImageTypeEnum, TimezoneEnum, DateTimeFormatEnum, CurrencyRateSourceEnum, OfferAlertFilterCriteriaFieldEnum, FilterOperatorEnum, UploadStatusEnum, UploadTypeEnum, NotificationTypeEnum, NotificationChannelEnum, VintageRatingEnum, VintageScoreAuthorEnum, PackageEnum, OfferAlertTimelineActionEnum, OfferRequestStatusEnum, OfferRequestOptionEnum, OfferRequestOptionStatusEnum, OfferRequestTimelineActionEnum, OrganisationUserInvitationStatusEnum } from '@vini-wine/core-enums';
2
2
 
3
3
  interface PriceModel {
4
4
  priceMicros: number;
@@ -23,32 +23,11 @@ interface ContactTypeModel {
23
23
 
24
24
  interface TelephoneModel {
25
25
  number: string;
26
- countryCode: string;
27
- }
28
-
29
- interface ContactPointModel extends UUID {
30
- email: string | null;
31
- telephone: TelephoneModel | null;
32
- name: string;
33
- contactType: ContactTypeModel;
34
- }
35
-
36
- interface CountryModel {
37
- name: string;
38
- codeAlpha2: string;
39
- codeAlpha3: string;
40
- codeUn: string;
41
- }
42
-
43
- interface CurrencyRateModel {
44
- currencyCode: CurrencyCodeEnum;
45
- rate: number;
46
- synchronizedAt: Date;
47
- source: CurrencyRateSourceEnum;
26
+ countryCode: CountryEnum;
48
27
  }
49
28
 
50
29
  interface PostalAddressModel {
51
- countryCode: string;
30
+ countryCode: CountryEnum;
52
31
  locality: string;
53
32
  region: string | null;
54
33
  postalCode: string;
@@ -56,7 +35,7 @@ interface PostalAddressModel {
56
35
  }
57
36
 
58
37
  interface VatTaxModel {
59
- countryCode: string;
38
+ countryCode: CountryEnum;
60
39
  value: string;
61
40
  }
62
41
 
@@ -87,24 +66,40 @@ interface PermissionModel extends UUID {
87
66
  action: string;
88
67
  }
89
68
 
90
- interface UserStatusModel {
91
- id: UserStatusEnum;
69
+ interface UserOrganisationStatusModel {
70
+ id: UserOrganisationStatusEnum;
92
71
  name: string;
93
72
  }
94
73
 
74
+ interface UserOrganisationModel {
75
+ organisation: OrganisationModel;
76
+ createdAt: Date;
77
+ isOrganisationOwner: boolean;
78
+ isUserDefaultOrganisation: boolean;
79
+ status: UserOrganisationStatusModel;
80
+ user?: UserAccountModel;
81
+ permissions?: PermissionModel[];
82
+ roles?: RoleModel[];
83
+ }
84
+
95
85
  interface GenderModel extends UUID {
96
86
  id: GenderEnum;
97
87
  name: string;
98
88
  }
99
89
 
100
90
  interface PersonModel extends UUID {
91
+ gender: GenderModel;
101
92
  firstName: string;
102
93
  lastName: string;
103
94
  preferredLanguage: LocaleEnum;
104
- gender: GenderModel;
105
95
  preferredCurrency: CurrencyCodeEnum;
106
96
  }
107
97
 
98
+ interface UserStatusModel {
99
+ id: UserStatusEnum;
100
+ name: string;
101
+ }
102
+
108
103
  interface ImageVariationModel {
109
104
  id: ImageVariationEnum;
110
105
  }
@@ -123,38 +118,6 @@ interface ImageModel extends UUID {
123
118
  type: ImageTypeModel;
124
119
  }
125
120
 
126
- interface UserModel extends UUID {
127
- person: PersonModel;
128
- defaultUserOrganisation?: UserOrganisationModel;
129
- permissions?: PermissionModel[];
130
- roles?: RoleModel[];
131
- userOrganisations?: UserOrganisationModel[];
132
- numNotificationsUnPreRead?: number;
133
- avatar?: ImageModel;
134
- status: UserStatusModel;
135
- email: string;
136
- emailVerified: boolean;
137
- lastLoginAt: Date;
138
- createdAt: Date;
139
- updatedAt: Date;
140
- }
141
-
142
- interface UserOrganisationStatusModel {
143
- id: UserOrganisationStatusEnum;
144
- name: string;
145
- }
146
-
147
- interface UserOrganisationModel {
148
- organisation: OrganisationModel;
149
- createdAt: Date;
150
- isOrganisationOwner: boolean;
151
- isUserDefaultOrganisation: boolean;
152
- status: UserOrganisationStatusModel;
153
- user?: UserModel;
154
- permissions?: PermissionModel[];
155
- roles?: RoleModel[];
156
- }
157
-
158
121
  interface UserAccountModel extends UUID {
159
122
  person: PersonModel;
160
123
  defaultUserOrganisation?: UserOrganisationModel;
@@ -176,7 +139,7 @@ interface UserAccountModel extends UUID {
176
139
  interface OrganisationModel extends UUID {
177
140
  suppliers?: Partial<SupplierModel>[];
178
141
  billingPostalAddress?: PostalAddressModel;
179
- defaultShippingPostalAddress?: PostalAddressModel;
142
+ defaultShippingPostalAddress?: PostalAddressModel | null;
180
143
  organisationOwner?: Partial<UserAccountModel>;
181
144
  registeredBy?: Partial<UserAccountModel>;
182
145
  userOrganisations?: UserOrganisationModel[];
@@ -184,7 +147,7 @@ interface OrganisationModel extends UUID {
184
147
  numSuppliers?: number;
185
148
  numSuppliedSuppliers?: number;
186
149
  numUploads?: number;
187
- avatar?: ImageModel;
150
+ avatar?: ImageModel | null;
188
151
  name: string;
189
152
  legalName: string;
190
153
  vatTax: VatTaxModel;
@@ -193,6 +156,28 @@ interface OrganisationModel extends UUID {
193
156
  status: OrganisationStatusModel;
194
157
  }
195
158
 
159
+ interface ContactPointModel extends UUID {
160
+ email: string | null;
161
+ telephone: TelephoneModel | null;
162
+ name: string;
163
+ contactType: ContactTypeModel;
164
+ createdOrganisation?: OrganisationModel;
165
+ createdUser?: UserAccountModel | null;
166
+ }
167
+
168
+ interface CountryModel {
169
+ codeAlpha2: CountryEnum;
170
+ codeAlpha3: string;
171
+ codeUn: string;
172
+ }
173
+
174
+ interface CurrencyRateModel {
175
+ currencyCode: CurrencyCodeEnum;
176
+ rate: number;
177
+ synchronizedAt: Date;
178
+ source: CurrencyRateSourceEnum;
179
+ }
180
+
196
181
  interface CustomerModel extends UUID {
197
182
  isSupplier: boolean;
198
183
  name: string;
@@ -251,25 +236,23 @@ interface ImportResolvedFileHeaderValueModel {
251
236
  interface MarginMarketModel {
252
237
  countryCode: CountryEnum;
253
238
  margin: number;
239
+ organisation?: OrganisationModel;
240
+ createdBy?: UserAccountModel | null;
241
+ updatedBy?: UserAccountModel | null;
254
242
  }
255
243
 
256
244
  interface MarginOrganisationModel {
257
245
  margin: number;
258
- marginOrganisation: Partial<OrganisationModel>;
259
- }
260
-
261
- interface NotificationChannelModel {
262
- id: NotificationChannelEnum;
263
- isActive: boolean;
264
- }
265
-
266
- interface NotificationTypeModel {
267
- id: NotificationTypeEnum;
268
- channels: NotificationChannelModel[];
246
+ marginOrganisation?: OrganisationModel;
247
+ organisation?: OrganisationModel;
248
+ createdBy?: UserAccountModel | null;
249
+ updatedBy?: UserAccountModel | null;
269
250
  }
270
251
 
271
252
  interface NotificationModel extends UUID {
272
- type: Partial<NotificationTypeModel>;
253
+ type: {
254
+ id: NotificationTypeEnum;
255
+ };
273
256
  messagePlain: string;
274
257
  messageHtml: string | null;
275
258
  actionText: string;
@@ -280,14 +263,24 @@ interface NotificationModel extends UUID {
280
263
  name: string;
281
264
  }
282
265
 
266
+ interface NotificationChannelModel {
267
+ id: NotificationChannelEnum;
268
+ isActive: boolean;
269
+ }
270
+
271
+ interface NotificationTypeModel {
272
+ id: NotificationTypeEnum;
273
+ channels: NotificationChannelModel[];
274
+ }
275
+
283
276
  interface SellerModel extends UUID {
284
- organisation: Partial<OrganisationModel>;
277
+ organisation?: OrganisationModel;
285
278
  }
286
279
 
287
280
  interface RegionModel extends UUID {
288
281
  country: CountryModel;
289
282
  mappedItems?: any;
290
- parentRegion?: RegionModel;
283
+ parentRegion?: RegionModel | null;
291
284
  subRegions?: RegionModel[];
292
285
  images?: ImageModel[];
293
286
  name: string;
@@ -315,6 +308,8 @@ interface VintageRatingModel {
315
308
  numberOfRatings: number;
316
309
  averageOfRatings: number;
317
310
  updatedAt: Date;
311
+ status: VintageRatingEnum;
312
+ vintage?: VintageModel;
318
313
  }
319
314
 
320
315
  interface VintageScoreAuthorModel {
@@ -325,6 +320,7 @@ interface VintageScoreModel {
325
320
  scoreValue: number;
326
321
  scoreYear: number;
327
322
  author: VintageScoreAuthorModel;
323
+ vintage?: VintageModel;
328
324
  }
329
325
 
330
326
  interface VintageModel extends UUID {
@@ -354,27 +350,29 @@ interface OfferModel extends UUID {
354
350
  createdAt: Date;
355
351
  }
356
352
 
353
+ interface OfferAlertTimelineModel {
354
+ actionCreatedAt: Date;
355
+ action: {
356
+ id: OfferAlertTimelineActionEnum;
357
+ };
358
+ offerAlert?: OfferAlertModel;
359
+ createdByUser?: UserAccountModel;
360
+ }
361
+
357
362
  interface OfferAlertModel extends UUID {
358
363
  title: string;
359
364
  header: string;
360
365
  description: string | null;
361
- backgroundImage: ImageModel | null;
362
366
  validFrom: string;
363
367
  validUntil: string;
364
368
  isExpired: boolean;
365
- filterCriteria: FilterCriteriaModel[];
369
+ organisation?: OrganisationModel;
370
+ backgroundImage?: ImageModel | null;
371
+ filterCriteria?: FilterCriteriaModel[];
372
+ timeline?: OfferAlertTimelineModel;
366
373
  meta?: any;
367
374
  }
368
375
 
369
- interface OfferAlertTimelineModel {
370
- actionCreatedAt: Date;
371
- action: {
372
- id: OfferAlertTimelineActionEnum;
373
- };
374
- offerAlert: OfferAlertModel;
375
- createdByUser: Partial<UserAccountModel>;
376
- }
377
-
378
376
  interface OfferRequestStatusModel {
379
377
  id: OfferRequestStatusEnum;
380
378
  updatedAt: Date;
@@ -388,6 +386,7 @@ interface OfferRequestOptionModel {
388
386
  };
389
387
  requestedValue: string | null;
390
388
  providedValue: string | null;
389
+ offerRequest?: OfferRequestModel;
391
390
  }
392
391
 
393
392
  interface OfferRequestTimelineModel {
@@ -395,23 +394,25 @@ interface OfferRequestTimelineModel {
395
394
  action: {
396
395
  id: OfferRequestTimelineActionEnum;
397
396
  };
398
- offerRequest: OfferRequestModel;
399
- createdByUser: Partial<UserAccountModel>;
397
+ offerRequest?: OfferRequestModel;
398
+ createdByUser?: UserAccountModel | null;
400
399
  }
401
400
 
402
401
  interface OfferRequestModel extends UUID {
403
402
  status: OfferRequestStatusModel;
404
- price: PriceModel | null;
403
+ createdAt: Date;
404
+ changedAt: Date;
405
+ updatedAt: Date;
405
406
  quantity: number;
406
- images: ImageModel[];
407
+ price: PriceModel | null;
407
408
  offer: Partial<OfferModel> | null;
408
- createdAt: Date;
409
409
  organisation: OrganisationModel;
410
- vintageProducts: VintageProductModel[];
411
- timeline: OfferRequestTimelineModel[];
412
410
  seller: OrganisationModel;
413
- subOfferRequests: Partial<OfferRequestModel>[] | [];
414
- userOrganisation: UserOrganisationModel;
411
+ images?: ImageModel[];
412
+ vintageProducts?: VintageProductModel[];
413
+ timeline?: OfferRequestTimelineModel[];
414
+ subOfferRequests?: Partial<OfferRequestModel>[] | [];
415
+ userOrganisation?: UserOrganisationModel;
415
416
  options?: OfferRequestOptionModel[];
416
417
  }
417
418
 
@@ -420,7 +421,12 @@ interface OrganisationUserInvitationStatusModel {
420
421
  name: string;
421
422
  }
422
423
 
423
- interface UserInvitationModel {
424
+ interface OrganisationUserInvitationModel {
425
+ organisation?: Partial<OrganisationModel>;
426
+ invitedBy?: UserAccountModel;
427
+ acceptedByUserOrganisation?: UserOrganisationModel;
428
+ revokedBy?: UserAccountModel | null;
429
+ roles?: RoleModel[] | [];
424
430
  status: OrganisationUserInvitationStatusModel;
425
431
  token: string;
426
432
  expiredAt: Date;
@@ -429,12 +435,6 @@ interface UserInvitationModel {
429
435
  personLastName: string;
430
436
  personEmail: string;
431
437
  acceptedAt: Date | null;
432
- invitedBy: UserModel;
433
- acceptedBy: UserModel | null;
434
- revokedBy: UserModel | null;
435
- roles: RoleModel[] | [];
436
- organisation: Partial<OrganisationModel>;
437
- acceptedByUserOrganisation: UserOrganisationModel;
438
438
  }
439
439
 
440
- export type { B2bMarketPriceModel, ContactPointModel, ContactTypeModel, CountryModel, CurrencyRateModel, CustomerModel, FilterCriteriaModel, GenderModel, ImageModel, ImageTypeModel, ImageVariationModel, ImportFileHeaderModel, ImportResolvedFileHeaderValueModel, MarginMarketModel, MarginOrganisationModel, NotificationChannelModel, NotificationModel, NotificationTypeModel, OfferAlertModel, OfferAlertTimelineModel, OfferModel, OfferRequestModel, OfferRequestOptionModel, OfferRequestStatusModel, OfferRequestTimelineModel, OrganisationModel, OrganisationUserInvitationStatusModel, PermissionModel, PersonModel, PostalAddressModel, PriceModel, RegionModel, RoleModel, SellerModel, SupplierModel, TelephoneModel, UploadModel, UploadVisibilityTypeModel, UserAccountModel, UserInvitationModel, UserModel, UserOrganisationModel, UserOrganisationStatusModel, UserStatusModel, VatTaxModel, VintageModel, VintageProductModel, VintageRatingModel, VintageScoreAuthorModel, VintageScoreModel, WineModel, WineTypeModel, WineryModel };
440
+ export type { B2bMarketPriceModel, ContactPointModel, ContactTypeModel, CountryModel, CurrencyRateModel, CustomerModel, FilterCriteriaModel, GenderModel, ImageModel, ImageTypeModel, ImageVariationModel, ImportFileHeaderModel, ImportResolvedFileHeaderValueModel, MarginMarketModel, MarginOrganisationModel, NotificationChannelModel, NotificationModel, NotificationTypeModel, OfferAlertModel, OfferAlertTimelineModel, OfferModel, OfferRequestModel, OfferRequestOptionModel, OfferRequestStatusModel, OfferRequestTimelineModel, OrganisationModel, OrganisationUserInvitationModel, OrganisationUserInvitationStatusModel, PermissionModel, PersonModel, PostalAddressModel, PriceModel, RegionModel, RoleModel, SellerModel, SupplierModel, TelephoneModel, UploadModel, UploadVisibilityTypeModel, UserAccountModel, UserOrganisationModel, UserOrganisationStatusModel, UserStatusModel, VatTaxModel, VintageModel, VintageProductModel, VintageRatingModel, VintageScoreAuthorModel, VintageScoreModel, WineModel, WineTypeModel, WineryModel };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CurrencyCodeEnum, UploadVisibilityTypeEnum, ContactPointTypeEnum, CurrencyRateSourceEnum, OrganisationStatusEnum, UserStatusEnum, GenderEnum, LocaleEnum, ImageVariationEnum, ImageTypeEnum, UserOrganisationStatusEnum, TimezoneEnum, DateTimeFormatEnum, OfferAlertFilterCriteriaFieldEnum, FilterOperatorEnum, UploadStatusEnum, UploadTypeEnum, CountryEnum, NotificationChannelEnum, NotificationTypeEnum, VintageScoreAuthorEnum, PackageEnum, OfferAlertTimelineActionEnum, OfferRequestStatusEnum, OfferRequestOptionEnum, OfferRequestOptionStatusEnum, OfferRequestTimelineActionEnum, OrganisationUserInvitationStatusEnum } from '@vini-wine/core-enums';
1
+ import { CurrencyCodeEnum, UploadVisibilityTypeEnum, ContactPointTypeEnum, CountryEnum, OrganisationStatusEnum, UserOrganisationStatusEnum, GenderEnum, LocaleEnum, UserStatusEnum, ImageVariationEnum, ImageTypeEnum, TimezoneEnum, DateTimeFormatEnum, CurrencyRateSourceEnum, OfferAlertFilterCriteriaFieldEnum, FilterOperatorEnum, UploadStatusEnum, UploadTypeEnum, NotificationTypeEnum, NotificationChannelEnum, VintageRatingEnum, VintageScoreAuthorEnum, PackageEnum, OfferAlertTimelineActionEnum, OfferRequestStatusEnum, OfferRequestOptionEnum, OfferRequestOptionStatusEnum, OfferRequestTimelineActionEnum, OrganisationUserInvitationStatusEnum } from '@vini-wine/core-enums';
2
2
 
3
3
  interface PriceModel {
4
4
  priceMicros: number;
@@ -23,32 +23,11 @@ interface ContactTypeModel {
23
23
 
24
24
  interface TelephoneModel {
25
25
  number: string;
26
- countryCode: string;
27
- }
28
-
29
- interface ContactPointModel extends UUID {
30
- email: string | null;
31
- telephone: TelephoneModel | null;
32
- name: string;
33
- contactType: ContactTypeModel;
34
- }
35
-
36
- interface CountryModel {
37
- name: string;
38
- codeAlpha2: string;
39
- codeAlpha3: string;
40
- codeUn: string;
41
- }
42
-
43
- interface CurrencyRateModel {
44
- currencyCode: CurrencyCodeEnum;
45
- rate: number;
46
- synchronizedAt: Date;
47
- source: CurrencyRateSourceEnum;
26
+ countryCode: CountryEnum;
48
27
  }
49
28
 
50
29
  interface PostalAddressModel {
51
- countryCode: string;
30
+ countryCode: CountryEnum;
52
31
  locality: string;
53
32
  region: string | null;
54
33
  postalCode: string;
@@ -56,7 +35,7 @@ interface PostalAddressModel {
56
35
  }
57
36
 
58
37
  interface VatTaxModel {
59
- countryCode: string;
38
+ countryCode: CountryEnum;
60
39
  value: string;
61
40
  }
62
41
 
@@ -87,24 +66,40 @@ interface PermissionModel extends UUID {
87
66
  action: string;
88
67
  }
89
68
 
90
- interface UserStatusModel {
91
- id: UserStatusEnum;
69
+ interface UserOrganisationStatusModel {
70
+ id: UserOrganisationStatusEnum;
92
71
  name: string;
93
72
  }
94
73
 
74
+ interface UserOrganisationModel {
75
+ organisation: OrganisationModel;
76
+ createdAt: Date;
77
+ isOrganisationOwner: boolean;
78
+ isUserDefaultOrganisation: boolean;
79
+ status: UserOrganisationStatusModel;
80
+ user?: UserAccountModel;
81
+ permissions?: PermissionModel[];
82
+ roles?: RoleModel[];
83
+ }
84
+
95
85
  interface GenderModel extends UUID {
96
86
  id: GenderEnum;
97
87
  name: string;
98
88
  }
99
89
 
100
90
  interface PersonModel extends UUID {
91
+ gender: GenderModel;
101
92
  firstName: string;
102
93
  lastName: string;
103
94
  preferredLanguage: LocaleEnum;
104
- gender: GenderModel;
105
95
  preferredCurrency: CurrencyCodeEnum;
106
96
  }
107
97
 
98
+ interface UserStatusModel {
99
+ id: UserStatusEnum;
100
+ name: string;
101
+ }
102
+
108
103
  interface ImageVariationModel {
109
104
  id: ImageVariationEnum;
110
105
  }
@@ -123,38 +118,6 @@ interface ImageModel extends UUID {
123
118
  type: ImageTypeModel;
124
119
  }
125
120
 
126
- interface UserModel extends UUID {
127
- person: PersonModel;
128
- defaultUserOrganisation?: UserOrganisationModel;
129
- permissions?: PermissionModel[];
130
- roles?: RoleModel[];
131
- userOrganisations?: UserOrganisationModel[];
132
- numNotificationsUnPreRead?: number;
133
- avatar?: ImageModel;
134
- status: UserStatusModel;
135
- email: string;
136
- emailVerified: boolean;
137
- lastLoginAt: Date;
138
- createdAt: Date;
139
- updatedAt: Date;
140
- }
141
-
142
- interface UserOrganisationStatusModel {
143
- id: UserOrganisationStatusEnum;
144
- name: string;
145
- }
146
-
147
- interface UserOrganisationModel {
148
- organisation: OrganisationModel;
149
- createdAt: Date;
150
- isOrganisationOwner: boolean;
151
- isUserDefaultOrganisation: boolean;
152
- status: UserOrganisationStatusModel;
153
- user?: UserModel;
154
- permissions?: PermissionModel[];
155
- roles?: RoleModel[];
156
- }
157
-
158
121
  interface UserAccountModel extends UUID {
159
122
  person: PersonModel;
160
123
  defaultUserOrganisation?: UserOrganisationModel;
@@ -176,7 +139,7 @@ interface UserAccountModel extends UUID {
176
139
  interface OrganisationModel extends UUID {
177
140
  suppliers?: Partial<SupplierModel>[];
178
141
  billingPostalAddress?: PostalAddressModel;
179
- defaultShippingPostalAddress?: PostalAddressModel;
142
+ defaultShippingPostalAddress?: PostalAddressModel | null;
180
143
  organisationOwner?: Partial<UserAccountModel>;
181
144
  registeredBy?: Partial<UserAccountModel>;
182
145
  userOrganisations?: UserOrganisationModel[];
@@ -184,7 +147,7 @@ interface OrganisationModel extends UUID {
184
147
  numSuppliers?: number;
185
148
  numSuppliedSuppliers?: number;
186
149
  numUploads?: number;
187
- avatar?: ImageModel;
150
+ avatar?: ImageModel | null;
188
151
  name: string;
189
152
  legalName: string;
190
153
  vatTax: VatTaxModel;
@@ -193,6 +156,28 @@ interface OrganisationModel extends UUID {
193
156
  status: OrganisationStatusModel;
194
157
  }
195
158
 
159
+ interface ContactPointModel extends UUID {
160
+ email: string | null;
161
+ telephone: TelephoneModel | null;
162
+ name: string;
163
+ contactType: ContactTypeModel;
164
+ createdOrganisation?: OrganisationModel;
165
+ createdUser?: UserAccountModel | null;
166
+ }
167
+
168
+ interface CountryModel {
169
+ codeAlpha2: CountryEnum;
170
+ codeAlpha3: string;
171
+ codeUn: string;
172
+ }
173
+
174
+ interface CurrencyRateModel {
175
+ currencyCode: CurrencyCodeEnum;
176
+ rate: number;
177
+ synchronizedAt: Date;
178
+ source: CurrencyRateSourceEnum;
179
+ }
180
+
196
181
  interface CustomerModel extends UUID {
197
182
  isSupplier: boolean;
198
183
  name: string;
@@ -251,25 +236,23 @@ interface ImportResolvedFileHeaderValueModel {
251
236
  interface MarginMarketModel {
252
237
  countryCode: CountryEnum;
253
238
  margin: number;
239
+ organisation?: OrganisationModel;
240
+ createdBy?: UserAccountModel | null;
241
+ updatedBy?: UserAccountModel | null;
254
242
  }
255
243
 
256
244
  interface MarginOrganisationModel {
257
245
  margin: number;
258
- marginOrganisation: Partial<OrganisationModel>;
259
- }
260
-
261
- interface NotificationChannelModel {
262
- id: NotificationChannelEnum;
263
- isActive: boolean;
264
- }
265
-
266
- interface NotificationTypeModel {
267
- id: NotificationTypeEnum;
268
- channels: NotificationChannelModel[];
246
+ marginOrganisation?: OrganisationModel;
247
+ organisation?: OrganisationModel;
248
+ createdBy?: UserAccountModel | null;
249
+ updatedBy?: UserAccountModel | null;
269
250
  }
270
251
 
271
252
  interface NotificationModel extends UUID {
272
- type: Partial<NotificationTypeModel>;
253
+ type: {
254
+ id: NotificationTypeEnum;
255
+ };
273
256
  messagePlain: string;
274
257
  messageHtml: string | null;
275
258
  actionText: string;
@@ -280,14 +263,24 @@ interface NotificationModel extends UUID {
280
263
  name: string;
281
264
  }
282
265
 
266
+ interface NotificationChannelModel {
267
+ id: NotificationChannelEnum;
268
+ isActive: boolean;
269
+ }
270
+
271
+ interface NotificationTypeModel {
272
+ id: NotificationTypeEnum;
273
+ channels: NotificationChannelModel[];
274
+ }
275
+
283
276
  interface SellerModel extends UUID {
284
- organisation: Partial<OrganisationModel>;
277
+ organisation?: OrganisationModel;
285
278
  }
286
279
 
287
280
  interface RegionModel extends UUID {
288
281
  country: CountryModel;
289
282
  mappedItems?: any;
290
- parentRegion?: RegionModel;
283
+ parentRegion?: RegionModel | null;
291
284
  subRegions?: RegionModel[];
292
285
  images?: ImageModel[];
293
286
  name: string;
@@ -315,6 +308,8 @@ interface VintageRatingModel {
315
308
  numberOfRatings: number;
316
309
  averageOfRatings: number;
317
310
  updatedAt: Date;
311
+ status: VintageRatingEnum;
312
+ vintage?: VintageModel;
318
313
  }
319
314
 
320
315
  interface VintageScoreAuthorModel {
@@ -325,6 +320,7 @@ interface VintageScoreModel {
325
320
  scoreValue: number;
326
321
  scoreYear: number;
327
322
  author: VintageScoreAuthorModel;
323
+ vintage?: VintageModel;
328
324
  }
329
325
 
330
326
  interface VintageModel extends UUID {
@@ -354,27 +350,29 @@ interface OfferModel extends UUID {
354
350
  createdAt: Date;
355
351
  }
356
352
 
353
+ interface OfferAlertTimelineModel {
354
+ actionCreatedAt: Date;
355
+ action: {
356
+ id: OfferAlertTimelineActionEnum;
357
+ };
358
+ offerAlert?: OfferAlertModel;
359
+ createdByUser?: UserAccountModel;
360
+ }
361
+
357
362
  interface OfferAlertModel extends UUID {
358
363
  title: string;
359
364
  header: string;
360
365
  description: string | null;
361
- backgroundImage: ImageModel | null;
362
366
  validFrom: string;
363
367
  validUntil: string;
364
368
  isExpired: boolean;
365
- filterCriteria: FilterCriteriaModel[];
369
+ organisation?: OrganisationModel;
370
+ backgroundImage?: ImageModel | null;
371
+ filterCriteria?: FilterCriteriaModel[];
372
+ timeline?: OfferAlertTimelineModel;
366
373
  meta?: any;
367
374
  }
368
375
 
369
- interface OfferAlertTimelineModel {
370
- actionCreatedAt: Date;
371
- action: {
372
- id: OfferAlertTimelineActionEnum;
373
- };
374
- offerAlert: OfferAlertModel;
375
- createdByUser: Partial<UserAccountModel>;
376
- }
377
-
378
376
  interface OfferRequestStatusModel {
379
377
  id: OfferRequestStatusEnum;
380
378
  updatedAt: Date;
@@ -388,6 +386,7 @@ interface OfferRequestOptionModel {
388
386
  };
389
387
  requestedValue: string | null;
390
388
  providedValue: string | null;
389
+ offerRequest?: OfferRequestModel;
391
390
  }
392
391
 
393
392
  interface OfferRequestTimelineModel {
@@ -395,23 +394,25 @@ interface OfferRequestTimelineModel {
395
394
  action: {
396
395
  id: OfferRequestTimelineActionEnum;
397
396
  };
398
- offerRequest: OfferRequestModel;
399
- createdByUser: Partial<UserAccountModel>;
397
+ offerRequest?: OfferRequestModel;
398
+ createdByUser?: UserAccountModel | null;
400
399
  }
401
400
 
402
401
  interface OfferRequestModel extends UUID {
403
402
  status: OfferRequestStatusModel;
404
- price: PriceModel | null;
403
+ createdAt: Date;
404
+ changedAt: Date;
405
+ updatedAt: Date;
405
406
  quantity: number;
406
- images: ImageModel[];
407
+ price: PriceModel | null;
407
408
  offer: Partial<OfferModel> | null;
408
- createdAt: Date;
409
409
  organisation: OrganisationModel;
410
- vintageProducts: VintageProductModel[];
411
- timeline: OfferRequestTimelineModel[];
412
410
  seller: OrganisationModel;
413
- subOfferRequests: Partial<OfferRequestModel>[] | [];
414
- userOrganisation: UserOrganisationModel;
411
+ images?: ImageModel[];
412
+ vintageProducts?: VintageProductModel[];
413
+ timeline?: OfferRequestTimelineModel[];
414
+ subOfferRequests?: Partial<OfferRequestModel>[] | [];
415
+ userOrganisation?: UserOrganisationModel;
415
416
  options?: OfferRequestOptionModel[];
416
417
  }
417
418
 
@@ -420,7 +421,12 @@ interface OrganisationUserInvitationStatusModel {
420
421
  name: string;
421
422
  }
422
423
 
423
- interface UserInvitationModel {
424
+ interface OrganisationUserInvitationModel {
425
+ organisation?: Partial<OrganisationModel>;
426
+ invitedBy?: UserAccountModel;
427
+ acceptedByUserOrganisation?: UserOrganisationModel;
428
+ revokedBy?: UserAccountModel | null;
429
+ roles?: RoleModel[] | [];
424
430
  status: OrganisationUserInvitationStatusModel;
425
431
  token: string;
426
432
  expiredAt: Date;
@@ -429,12 +435,6 @@ interface UserInvitationModel {
429
435
  personLastName: string;
430
436
  personEmail: string;
431
437
  acceptedAt: Date | null;
432
- invitedBy: UserModel;
433
- acceptedBy: UserModel | null;
434
- revokedBy: UserModel | null;
435
- roles: RoleModel[] | [];
436
- organisation: Partial<OrganisationModel>;
437
- acceptedByUserOrganisation: UserOrganisationModel;
438
438
  }
439
439
 
440
- export type { B2bMarketPriceModel, ContactPointModel, ContactTypeModel, CountryModel, CurrencyRateModel, CustomerModel, FilterCriteriaModel, GenderModel, ImageModel, ImageTypeModel, ImageVariationModel, ImportFileHeaderModel, ImportResolvedFileHeaderValueModel, MarginMarketModel, MarginOrganisationModel, NotificationChannelModel, NotificationModel, NotificationTypeModel, OfferAlertModel, OfferAlertTimelineModel, OfferModel, OfferRequestModel, OfferRequestOptionModel, OfferRequestStatusModel, OfferRequestTimelineModel, OrganisationModel, OrganisationUserInvitationStatusModel, PermissionModel, PersonModel, PostalAddressModel, PriceModel, RegionModel, RoleModel, SellerModel, SupplierModel, TelephoneModel, UploadModel, UploadVisibilityTypeModel, UserAccountModel, UserInvitationModel, UserModel, UserOrganisationModel, UserOrganisationStatusModel, UserStatusModel, VatTaxModel, VintageModel, VintageProductModel, VintageRatingModel, VintageScoreAuthorModel, VintageScoreModel, WineModel, WineTypeModel, WineryModel };
440
+ export type { B2bMarketPriceModel, ContactPointModel, ContactTypeModel, CountryModel, CurrencyRateModel, CustomerModel, FilterCriteriaModel, GenderModel, ImageModel, ImageTypeModel, ImageVariationModel, ImportFileHeaderModel, ImportResolvedFileHeaderValueModel, MarginMarketModel, MarginOrganisationModel, NotificationChannelModel, NotificationModel, NotificationTypeModel, OfferAlertModel, OfferAlertTimelineModel, OfferModel, OfferRequestModel, OfferRequestOptionModel, OfferRequestStatusModel, OfferRequestTimelineModel, OrganisationModel, OrganisationUserInvitationModel, OrganisationUserInvitationStatusModel, PermissionModel, PersonModel, PostalAddressModel, PriceModel, RegionModel, RoleModel, SellerModel, SupplierModel, TelephoneModel, UploadModel, UploadVisibilityTypeModel, UserAccountModel, UserOrganisationModel, UserOrganisationStatusModel, UserStatusModel, VatTaxModel, VintageModel, VintageProductModel, VintageRatingModel, VintageScoreAuthorModel, VintageScoreModel, WineModel, WineTypeModel, WineryModel };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { B2bMarketPriceModel } from \"./models/b2bMarketPrice\";\nimport { ContactPointModel } from \"./models/contactPoint\";\nimport { ContactTypeModel } from \"./models/contactType\";\nimport { CountryModel } from \"./models/country\";\nimport { CurrencyRateModel } from \"./models/currencyRate\";\nimport { CustomerModel } from \"./models/customer\";\nimport { FilterCriteriaModel } from \"./models/filterCriteria\";\nimport { GenderModel } from \"./models/gender\";\nimport { ImageModel } from \"./models/image\";\nimport { ImageTypeModel } from \"./models/imageType\";\nimport { ImageVariationModel } from \"./models/imageVariation\";\nimport { ImportFileHeaderModel } from \"./models/importFileHeader\";\nimport { ImportResolvedFileHeaderValueModel } from \"./models/importResolvedFileHeaderValue\";\nimport { MarginMarketModel } from \"./models/marginMarket\";\nimport { MarginOrganisationModel } from \"./models/marginOrganisation\";\nimport { NotificationModel } from \"./models/notification\";\nimport { NotificationChannelModel } from \"./models/notificationChannel\";\nimport { NotificationTypeModel } from \"./models/notificationType\";\nimport { OfferModel } from \"./models/offer\";\nimport { OfferAlertModel } from \"./models/offerAlert\";\nimport { OfferAlertTimelineModel } from \"./models/offerAlertTimeline\";\nimport { OfferRequestModel } from \"./models/offerRequest\";\nimport { OfferRequestOptionModel } from \"./models/offerRequestOption\";\nimport { OfferRequestStatusModel } from \"./models/offerRequestStatus\";\nimport { OfferRequestTimelineModel } from \"./models/offerRequestTimeline\";\nimport { OrganisationModel } from \"./models/organisation\";\nimport { OrganisationUserInvitationStatusModel } from \"./models/organisationUserInvitationStatus\";\nimport { PermissionModel } from \"./models/permission\";\nimport { PersonModel } from \"./models/person\";\nimport { PostalAddressModel } from \"./models/postalAddress\";\nimport { PriceModel } from \"./models/price\";\nimport { RegionModel } from \"./models/region\";\nimport { RoleModel } from \"./models/role\";\nimport { SellerModel } from \"./models/seller\";\nimport { SupplierModel } from \"./models/supplier\";\nimport { TelephoneModel } from \"./models/telephone\";\nimport { UploadModel } from \"./models/upload\";\nimport { UploadVisibilityTypeModel } from \"./models/uploadVisibilityType\";\nimport { UserModel } from \"./models/user\";\nimport { UserAccountModel } from \"./models/userAccount\";\nimport { UserInvitationModel } from \"./models/userInvitation\";\nimport { UserOrganisationModel } from \"./models/userOrganisation\";\nimport { UserOrganisationStatusModel } from \"./models/userOrganisationStatus\";\nimport { UserStatusModel } from \"./models/userStatus\";\nimport { VatTaxModel } from \"./models/vatTax\";\nimport { VintageModel } from \"./models/vintage\";\nimport { VintageProductModel } from \"./models/vintageProduct\";\nimport { VintageRatingModel } from \"./models/vintageRating\";\nimport { VintageScoreModel } from \"./models/vintageScore\";\nimport { VintageScoreAuthorModel } from \"./models/vintageScoreAuthor\";\nimport { WineModel } from \"./models/wine\";\nimport { WineryModel } from \"./models/winery\";\nimport { WineTypeModel } from \"./models/wineType\";\n\nexport {\n B2bMarketPriceModel,\n ContactPointModel,\n ContactTypeModel,\n CountryModel,\n CurrencyRateModel,\n CustomerModel,\n FilterCriteriaModel,\n GenderModel,\n ImageModel,\n ImageTypeModel,\n ImageVariationModel,\n ImportFileHeaderModel,\n ImportResolvedFileHeaderValueModel,\n MarginMarketModel,\n MarginOrganisationModel,\n NotificationModel,\n NotificationChannelModel,\n NotificationTypeModel,\n OfferModel,\n OfferAlertModel,\n OfferAlertTimelineModel,\n OfferRequestModel,\n OfferRequestOptionModel,\n OfferRequestStatusModel,\n OfferRequestTimelineModel,\n OrganisationModel,\n OrganisationUserInvitationStatusModel,\n PermissionModel,\n PersonModel,\n PostalAddressModel,\n PriceModel,\n RegionModel,\n RoleModel,\n SellerModel,\n SupplierModel,\n TelephoneModel,\n UploadModel,\n UploadVisibilityTypeModel,\n UserModel,\n UserAccountModel,\n UserInvitationModel,\n UserOrganisationModel,\n UserOrganisationStatusModel,\n UserStatusModel,\n VatTaxModel,\n VintageModel,\n VintageProductModel,\n VintageRatingModel,\n VintageScoreModel,\n VintageScoreAuthorModel,\n WineModel,\n WineryModel,\n WineTypeModel,\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { B2bMarketPriceModel } from \"./models/b2bMarketPrice\";\nimport { ContactPointModel } from \"./models/contactPoint\";\nimport { ContactTypeModel } from \"./models/contactType\";\nimport { CountryModel } from \"./models/country\";\nimport { CurrencyRateModel } from \"./models/currencyRate\";\nimport { CustomerModel } from \"./models/customer\";\nimport { FilterCriteriaModel } from \"./models/filterCriteria\";\nimport { GenderModel } from \"./models/gender\";\nimport { ImageModel } from \"./models/image\";\nimport { ImageTypeModel } from \"./models/imageType\";\nimport { ImageVariationModel } from \"./models/imageVariation\";\nimport { ImportFileHeaderModel } from \"./models/importFileHeader\";\nimport { ImportResolvedFileHeaderValueModel } from \"./models/importResolvedFileHeaderValue\";\nimport { MarginMarketModel } from \"./models/marginMarket\";\nimport { MarginOrganisationModel } from \"./models/marginOrganisation\";\nimport { NotificationModel } from \"./models/notification\";\nimport { NotificationChannelModel } from \"./models/notificationChannel\";\nimport { NotificationTypeModel } from \"./models/notificationType\";\nimport { OfferModel } from \"./models/offer\";\nimport { OfferAlertModel } from \"./models/offerAlert\";\nimport { OfferAlertTimelineModel } from \"./models/offerAlertTimeline\";\nimport { OfferRequestModel } from \"./models/offerRequest\";\nimport { OfferRequestOptionModel } from \"./models/offerRequestOption\";\nimport { OfferRequestStatusModel } from \"./models/offerRequestStatus\";\nimport { OfferRequestTimelineModel } from \"./models/offerRequestTimeline\";\nimport { OrganisationModel } from \"./models/organisation\";\nimport { OrganisationUserInvitationStatusModel } from \"./models/organisationUserInvitationStatus\";\nimport { PermissionModel } from \"./models/permission\";\nimport { PersonModel } from \"./models/person\";\nimport { PostalAddressModel } from \"./models/postalAddress\";\nimport { PriceModel } from \"./models/price\";\nimport { RegionModel } from \"./models/region\";\nimport { RoleModel } from \"./models/role\";\nimport { SellerModel } from \"./models/seller\";\nimport { SupplierModel } from \"./models/supplier\";\nimport { TelephoneModel } from \"./models/telephone\";\nimport { UploadModel } from \"./models/upload\";\nimport { UploadVisibilityTypeModel } from \"./models/uploadVisibilityType\";\nimport { UserAccountModel } from \"./models/userAccount\";\nimport { OrganisationUserInvitationModel } from \"./models/organisationUserInvitation\";\nimport { UserOrganisationModel } from \"./models/userOrganisation\";\nimport { UserOrganisationStatusModel } from \"./models/userOrganisationStatus\";\nimport { UserStatusModel } from \"./models/userStatus\";\nimport { VatTaxModel } from \"./models/vatTax\";\nimport { VintageModel } from \"./models/vintage\";\nimport { VintageProductModel } from \"./models/vintageProduct\";\nimport { VintageRatingModel } from \"./models/vintageRating\";\nimport { VintageScoreModel } from \"./models/vintageScore\";\nimport { VintageScoreAuthorModel } from \"./models/vintageScoreAuthor\";\nimport { WineModel } from \"./models/wine\";\nimport { WineryModel } from \"./models/winery\";\nimport { WineTypeModel } from \"./models/wineType\";\n\nexport {\n B2bMarketPriceModel,\n ContactPointModel,\n ContactTypeModel,\n CountryModel,\n CurrencyRateModel,\n CustomerModel,\n FilterCriteriaModel,\n GenderModel,\n ImageModel,\n ImageTypeModel,\n ImageVariationModel,\n ImportFileHeaderModel,\n ImportResolvedFileHeaderValueModel,\n MarginMarketModel,\n MarginOrganisationModel,\n NotificationModel,\n NotificationChannelModel,\n NotificationTypeModel,\n OfferModel,\n OfferAlertModel,\n OfferAlertTimelineModel,\n OfferRequestModel,\n OfferRequestOptionModel,\n OfferRequestStatusModel,\n OfferRequestTimelineModel,\n OrganisationModel,\n OrganisationUserInvitationStatusModel,\n PermissionModel,\n PersonModel,\n PostalAddressModel,\n PriceModel,\n RegionModel,\n RoleModel,\n SellerModel,\n SupplierModel,\n TelephoneModel,\n UploadModel,\n UploadVisibilityTypeModel,\n UserAccountModel,\n OrganisationUserInvitationModel,\n UserOrganisationModel,\n UserOrganisationStatusModel,\n UserStatusModel,\n VatTaxModel,\n VintageModel,\n VintageProductModel,\n VintageRatingModel,\n VintageScoreModel,\n VintageScoreAuthorModel,\n WineModel,\n WineryModel,\n WineTypeModel,\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vini-wine/admin-core-models",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "Core package for Vini models related to the admin API.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",