@sphereon/ssi-sdk.data-store 0.22.0 → 0.23.1-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/contact/PartyTypeEntity.d.ts +2 -1
- package/dist/entities/contact/PartyTypeEntity.d.ts.map +1 -1
- package/dist/entities/contact/PartyTypeEntity.js +4 -0
- package/dist/entities/contact/PartyTypeEntity.js.map +1 -1
- package/dist/migrations/postgres/1690925872592-CreateContacts.d.ts.map +1 -1
- package/dist/migrations/postgres/1690925872592-CreateContacts.js +5 -2
- package/dist/migrations/postgres/1690925872592-CreateContacts.js.map +1 -1
- package/dist/migrations/sqlite/1690925872693-CreateContacts.js +1 -1
- package/dist/migrations/sqlite/1690925872693-CreateContacts.js.map +1 -1
- package/dist/types/contact/IAbstractContactStore.d.ts +2 -1
- package/dist/types/contact/IAbstractContactStore.d.ts.map +1 -1
- package/dist/types/contact/contact.d.ts +5 -0
- package/dist/types/contact/contact.d.ts.map +1 -1
- package/dist/types/contact/contact.js +6 -1
- package/dist/types/contact/contact.js.map +1 -1
- package/dist/utils/contact/MappingUtils.d.ts.map +1 -1
- package/dist/utils/contact/MappingUtils.js +2 -0
- package/dist/utils/contact/MappingUtils.js.map +1 -1
- package/package.json +4 -4
- package/src/__tests__/contact.entities.test.ts +51 -1
- package/src/__tests__/contact.store.test.ts +74 -1
- package/src/entities/contact/PartyTypeEntity.ts +5 -2
- package/src/migrations/postgres/1690925872592-CreateContacts.ts +9 -2
- package/src/migrations/sqlite/1690925872693-CreateContacts.ts +1 -1
- package/src/types/contact/IAbstractContactStore.ts +2 -0
- package/src/types/contact/contact.ts +6 -0
- package/src/utils/contact/MappingUtils.ts +2 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataSource, FindOptionsWhere } from 'typeorm'
|
|
2
|
-
import { DataStoreContactEntities, DataStoreMigrations } from '../index'
|
|
2
|
+
import { DataStoreContactEntities, DataStoreMigrations, PartyOrigin } from '../index'
|
|
3
3
|
import { BaseContactEntity } from '../entities/contact/BaseContactEntity'
|
|
4
4
|
import { ConnectionEntity } from '../entities/contact/ConnectionEntity'
|
|
5
5
|
import { CorrelationIdentifierEntity } from '../entities/contact/CorrelationIdentifierEntity'
|
|
@@ -74,6 +74,7 @@ describe('Database entities tests', (): void => {
|
|
|
74
74
|
uri: 'example.com',
|
|
75
75
|
partyType: {
|
|
76
76
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
77
|
+
origin: PartyOrigin.internal,
|
|
77
78
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
78
79
|
name: 'example_name',
|
|
79
80
|
},
|
|
@@ -99,6 +100,7 @@ describe('Database entities tests', (): void => {
|
|
|
99
100
|
expect(fromDb?.uri).toEqual(party.uri)
|
|
100
101
|
expect(fromDb?.partyType).toBeDefined()
|
|
101
102
|
expect(fromDb?.partyType.type).toEqual(party.partyType.type)
|
|
103
|
+
expect(fromDb?.partyType.origin).toEqual(party.partyType.origin)
|
|
102
104
|
expect(fromDb?.partyType.tenantId).toEqual(party.partyType.tenantId)
|
|
103
105
|
expect(fromDb?.partyType.name).toEqual(party.partyType.name)
|
|
104
106
|
expect(fromDb?.contact).toBeDefined()
|
|
@@ -113,6 +115,7 @@ describe('Database entities tests', (): void => {
|
|
|
113
115
|
uri: 'example.com',
|
|
114
116
|
partyType: {
|
|
115
117
|
type: PartyTypeEnum.ORGANIZATION,
|
|
118
|
+
origin: PartyOrigin.internal,
|
|
116
119
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
117
120
|
name: 'example_name',
|
|
118
121
|
},
|
|
@@ -136,6 +139,7 @@ describe('Database entities tests', (): void => {
|
|
|
136
139
|
expect(fromDb?.uri).toEqual(party.uri)
|
|
137
140
|
expect(fromDb?.partyType).toBeDefined()
|
|
138
141
|
expect(fromDb?.partyType.type).toEqual(party.partyType.type)
|
|
142
|
+
expect(fromDb?.partyType.origin).toEqual(party.partyType.origin)
|
|
139
143
|
expect(fromDb?.partyType.tenantId).toEqual(party.partyType.tenantId)
|
|
140
144
|
expect(fromDb?.partyType.name).toEqual(party.partyType.name)
|
|
141
145
|
expect(fromDb?.contact).toBeDefined()
|
|
@@ -148,6 +152,7 @@ describe('Database entities tests', (): void => {
|
|
|
148
152
|
uri: 'example1.com',
|
|
149
153
|
partyType: {
|
|
150
154
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
155
|
+
origin: PartyOrigin.internal,
|
|
151
156
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
152
157
|
name: 'example_name1',
|
|
153
158
|
},
|
|
@@ -168,6 +173,7 @@ describe('Database entities tests', (): void => {
|
|
|
168
173
|
uri: 'example2.com',
|
|
169
174
|
partyType: {
|
|
170
175
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
176
|
+
origin: PartyOrigin.internal,
|
|
171
177
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d288',
|
|
172
178
|
name: 'example_name2',
|
|
173
179
|
},
|
|
@@ -212,6 +218,7 @@ describe('Database entities tests', (): void => {
|
|
|
212
218
|
uri: 'example.com',
|
|
213
219
|
partyType: {
|
|
214
220
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
221
|
+
origin: PartyOrigin.internal,
|
|
215
222
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
216
223
|
name: 'example_name',
|
|
217
224
|
},
|
|
@@ -233,6 +240,7 @@ describe('Database entities tests', (): void => {
|
|
|
233
240
|
uri: 'example.com',
|
|
234
241
|
partyType: {
|
|
235
242
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
243
|
+
origin: PartyOrigin.external,
|
|
236
244
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
237
245
|
name: 'example_name',
|
|
238
246
|
},
|
|
@@ -254,6 +262,7 @@ describe('Database entities tests', (): void => {
|
|
|
254
262
|
uri: 'example.com',
|
|
255
263
|
partyType: {
|
|
256
264
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
265
|
+
origin: PartyOrigin.external,
|
|
257
266
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
258
267
|
name: 'example_name',
|
|
259
268
|
},
|
|
@@ -275,6 +284,7 @@ describe('Database entities tests', (): void => {
|
|
|
275
284
|
uri: 'example.com',
|
|
276
285
|
partyType: {
|
|
277
286
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
287
|
+
origin: PartyOrigin.external,
|
|
278
288
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
279
289
|
name: 'example_name',
|
|
280
290
|
},
|
|
@@ -296,6 +306,7 @@ describe('Database entities tests', (): void => {
|
|
|
296
306
|
uri: 'example.com',
|
|
297
307
|
partyType: {
|
|
298
308
|
type: PartyTypeEnum.ORGANIZATION,
|
|
309
|
+
origin: PartyOrigin.internal,
|
|
299
310
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
300
311
|
name: 'example_name',
|
|
301
312
|
},
|
|
@@ -315,6 +326,7 @@ describe('Database entities tests', (): void => {
|
|
|
315
326
|
uri: 'example.com',
|
|
316
327
|
partyType: {
|
|
317
328
|
type: PartyTypeEnum.ORGANIZATION,
|
|
329
|
+
origin: PartyOrigin.internal,
|
|
318
330
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
319
331
|
name: 'example_name',
|
|
320
332
|
},
|
|
@@ -334,6 +346,7 @@ describe('Database entities tests', (): void => {
|
|
|
334
346
|
uri: 'example.com',
|
|
335
347
|
partyType: {
|
|
336
348
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
349
|
+
origin: PartyOrigin.external,
|
|
337
350
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
338
351
|
name: '',
|
|
339
352
|
},
|
|
@@ -355,6 +368,7 @@ describe('Database entities tests', (): void => {
|
|
|
355
368
|
uri: 'example.com',
|
|
356
369
|
partyType: {
|
|
357
370
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
371
|
+
origin: PartyOrigin.internal,
|
|
358
372
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
359
373
|
name: 'example_name',
|
|
360
374
|
description: '',
|
|
@@ -377,6 +391,7 @@ describe('Database entities tests', (): void => {
|
|
|
377
391
|
uri: 'example.com',
|
|
378
392
|
partyType: {
|
|
379
393
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
394
|
+
origin: PartyOrigin.external,
|
|
380
395
|
tenantId: '',
|
|
381
396
|
name: 'example_name',
|
|
382
397
|
},
|
|
@@ -772,6 +787,7 @@ describe('Database entities tests', (): void => {
|
|
|
772
787
|
uri: 'example.com',
|
|
773
788
|
partyType: {
|
|
774
789
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
790
|
+
origin: PartyOrigin.internal,
|
|
775
791
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
776
792
|
name: 'example_name1',
|
|
777
793
|
},
|
|
@@ -792,6 +808,7 @@ describe('Database entities tests', (): void => {
|
|
|
792
808
|
uri: 'example.com',
|
|
793
809
|
partyType: {
|
|
794
810
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
811
|
+
origin: PartyOrigin.internal,
|
|
795
812
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d288',
|
|
796
813
|
name: 'example_name2',
|
|
797
814
|
},
|
|
@@ -951,6 +968,7 @@ describe('Database entities tests', (): void => {
|
|
|
951
968
|
uri: 'example.com',
|
|
952
969
|
partyType: {
|
|
953
970
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
971
|
+
origin: PartyOrigin.external,
|
|
954
972
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
955
973
|
name: 'example_name',
|
|
956
974
|
},
|
|
@@ -1051,6 +1069,7 @@ describe('Database entities tests', (): void => {
|
|
|
1051
1069
|
uri: 'example.com',
|
|
1052
1070
|
partyType: {
|
|
1053
1071
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1072
|
+
origin: PartyOrigin.external,
|
|
1054
1073
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
1055
1074
|
name: 'example_name',
|
|
1056
1075
|
},
|
|
@@ -1126,6 +1145,7 @@ describe('Database entities tests', (): void => {
|
|
|
1126
1145
|
uri: 'example.com',
|
|
1127
1146
|
partyType: {
|
|
1128
1147
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1148
|
+
origin: PartyOrigin.internal,
|
|
1129
1149
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
1130
1150
|
name: 'example_name',
|
|
1131
1151
|
},
|
|
@@ -1153,6 +1173,7 @@ describe('Database entities tests', (): void => {
|
|
|
1153
1173
|
uri: 'example.com',
|
|
1154
1174
|
partyType: {
|
|
1155
1175
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1176
|
+
origin: PartyOrigin.internal,
|
|
1156
1177
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
1157
1178
|
name: 'example_name',
|
|
1158
1179
|
},
|
|
@@ -1248,6 +1269,7 @@ describe('Database entities tests', (): void => {
|
|
|
1248
1269
|
uri: 'example.com',
|
|
1249
1270
|
partyType: {
|
|
1250
1271
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1272
|
+
origin: PartyOrigin.internal,
|
|
1251
1273
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
1252
1274
|
name: 'example_name',
|
|
1253
1275
|
},
|
|
@@ -1275,6 +1297,7 @@ describe('Database entities tests', (): void => {
|
|
|
1275
1297
|
uri: 'example.com',
|
|
1276
1298
|
partyType: {
|
|
1277
1299
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1300
|
+
origin: PartyOrigin.external,
|
|
1278
1301
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
1279
1302
|
name: 'example_name',
|
|
1280
1303
|
},
|
|
@@ -1317,6 +1340,7 @@ describe('Database entities tests', (): void => {
|
|
|
1317
1340
|
it('Should set last updated date when saving party type', async (): Promise<void> => {
|
|
1318
1341
|
const partyType: NonPersistedPartyType = {
|
|
1319
1342
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1343
|
+
origin: PartyOrigin.external,
|
|
1320
1344
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
1321
1345
|
name: 'example_name',
|
|
1322
1346
|
}
|
|
@@ -1335,6 +1359,7 @@ describe('Database entities tests', (): void => {
|
|
|
1335
1359
|
it('Should set last creation date when saving party type', async (): Promise<void> => {
|
|
1336
1360
|
const partyType: NonPersistedPartyType = {
|
|
1337
1361
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1362
|
+
origin: PartyOrigin.internal,
|
|
1338
1363
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
1339
1364
|
name: 'example_name',
|
|
1340
1365
|
}
|
|
@@ -1381,6 +1406,7 @@ describe('Database entities tests', (): void => {
|
|
|
1381
1406
|
const name = 'non_unique_value'
|
|
1382
1407
|
const partyType1: NonPersistedPartyType = {
|
|
1383
1408
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1409
|
+
origin: PartyOrigin.external,
|
|
1384
1410
|
tenantId,
|
|
1385
1411
|
name,
|
|
1386
1412
|
}
|
|
@@ -1392,6 +1418,7 @@ describe('Database entities tests', (): void => {
|
|
|
1392
1418
|
|
|
1393
1419
|
const partyType2: NonPersistedPartyType = {
|
|
1394
1420
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1421
|
+
origin: PartyOrigin.internal,
|
|
1395
1422
|
tenantId,
|
|
1396
1423
|
name,
|
|
1397
1424
|
}
|
|
@@ -1406,6 +1433,7 @@ describe('Database entities tests', (): void => {
|
|
|
1406
1433
|
const name = 'non_unique_value'
|
|
1407
1434
|
const partyType1: NonPersistedPartyType = {
|
|
1408
1435
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1436
|
+
origin: PartyOrigin.internal,
|
|
1409
1437
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
1410
1438
|
name,
|
|
1411
1439
|
}
|
|
@@ -1417,6 +1445,7 @@ describe('Database entities tests', (): void => {
|
|
|
1417
1445
|
|
|
1418
1446
|
const partyType2: NonPersistedPartyType = {
|
|
1419
1447
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1448
|
+
origin: PartyOrigin.internal,
|
|
1420
1449
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d288',
|
|
1421
1450
|
name,
|
|
1422
1451
|
}
|
|
@@ -1482,6 +1511,7 @@ describe('Database entities tests', (): void => {
|
|
|
1482
1511
|
uri: 'example1.com',
|
|
1483
1512
|
partyType: {
|
|
1484
1513
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1514
|
+
origin: PartyOrigin.internal,
|
|
1485
1515
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
1486
1516
|
name: 'example_name1',
|
|
1487
1517
|
},
|
|
@@ -1504,6 +1534,7 @@ describe('Database entities tests', (): void => {
|
|
|
1504
1534
|
uri: 'example2.com',
|
|
1505
1535
|
partyType: {
|
|
1506
1536
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1537
|
+
origin: PartyOrigin.internal,
|
|
1507
1538
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d288',
|
|
1508
1539
|
name: 'example_name2',
|
|
1509
1540
|
},
|
|
@@ -1544,6 +1575,7 @@ describe('Database entities tests', (): void => {
|
|
|
1544
1575
|
uri: 'example1.com',
|
|
1545
1576
|
partyType: {
|
|
1546
1577
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1578
|
+
origin: PartyOrigin.internal,
|
|
1547
1579
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
1548
1580
|
name: 'example_name1',
|
|
1549
1581
|
},
|
|
@@ -1564,6 +1596,7 @@ describe('Database entities tests', (): void => {
|
|
|
1564
1596
|
uri: 'example2.com',
|
|
1565
1597
|
partyType: {
|
|
1566
1598
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1599
|
+
origin: PartyOrigin.internal,
|
|
1567
1600
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d288',
|
|
1568
1601
|
name: 'example_name2',
|
|
1569
1602
|
},
|
|
@@ -1602,6 +1635,7 @@ describe('Database entities tests', (): void => {
|
|
|
1602
1635
|
uri: 'example1.com',
|
|
1603
1636
|
partyType: {
|
|
1604
1637
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1638
|
+
origin: PartyOrigin.internal,
|
|
1605
1639
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
1606
1640
|
name: 'example_name1',
|
|
1607
1641
|
},
|
|
@@ -1622,6 +1656,7 @@ describe('Database entities tests', (): void => {
|
|
|
1622
1656
|
uri: 'example2.com',
|
|
1623
1657
|
partyType: {
|
|
1624
1658
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1659
|
+
origin: PartyOrigin.internal,
|
|
1625
1660
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d288',
|
|
1626
1661
|
name: 'example_name2',
|
|
1627
1662
|
},
|
|
@@ -1660,6 +1695,7 @@ describe('Database entities tests', (): void => {
|
|
|
1660
1695
|
uri: 'example1.com',
|
|
1661
1696
|
partyType: {
|
|
1662
1697
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1698
|
+
origin: PartyOrigin.internal,
|
|
1663
1699
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
1664
1700
|
name: 'example_name1',
|
|
1665
1701
|
},
|
|
@@ -1682,6 +1718,7 @@ describe('Database entities tests', (): void => {
|
|
|
1682
1718
|
uri: 'example2.com',
|
|
1683
1719
|
partyType: {
|
|
1684
1720
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1721
|
+
origin: PartyOrigin.internal,
|
|
1685
1722
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d288',
|
|
1686
1723
|
name: 'example_name2',
|
|
1687
1724
|
},
|
|
@@ -1734,6 +1771,7 @@ describe('Database entities tests', (): void => {
|
|
|
1734
1771
|
uri: 'example1.com',
|
|
1735
1772
|
partyType: {
|
|
1736
1773
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1774
|
+
origin: PartyOrigin.internal,
|
|
1737
1775
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
1738
1776
|
name: 'example_name1',
|
|
1739
1777
|
},
|
|
@@ -1756,6 +1794,7 @@ describe('Database entities tests', (): void => {
|
|
|
1756
1794
|
uri: 'example2.com',
|
|
1757
1795
|
partyType: {
|
|
1758
1796
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1797
|
+
origin: PartyOrigin.internal,
|
|
1759
1798
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d288',
|
|
1760
1799
|
name: 'example_name2',
|
|
1761
1800
|
},
|
|
@@ -1798,6 +1837,7 @@ describe('Database entities tests', (): void => {
|
|
|
1798
1837
|
it('Should save party type to database', async (): Promise<void> => {
|
|
1799
1838
|
const partyType: NonPersistedPartyType = {
|
|
1800
1839
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1840
|
+
origin: PartyOrigin.internal,
|
|
1801
1841
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
1802
1842
|
name: 'example_name',
|
|
1803
1843
|
}
|
|
@@ -1933,6 +1973,7 @@ describe('Database entities tests', (): void => {
|
|
|
1933
1973
|
uri: 'example.com',
|
|
1934
1974
|
partyType: {
|
|
1935
1975
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
1976
|
+
origin: PartyOrigin.internal,
|
|
1936
1977
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
1937
1978
|
name: 'example_name',
|
|
1938
1979
|
},
|
|
@@ -1966,6 +2007,7 @@ describe('Database entities tests', (): void => {
|
|
|
1966
2007
|
uri: 'example.com',
|
|
1967
2008
|
partyType: {
|
|
1968
2009
|
type: PartyTypeEnum.ORGANIZATION,
|
|
2010
|
+
origin: PartyOrigin.internal,
|
|
1969
2011
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
1970
2012
|
name: 'example_name',
|
|
1971
2013
|
},
|
|
@@ -1996,6 +2038,7 @@ describe('Database entities tests', (): void => {
|
|
|
1996
2038
|
uri: 'example.com',
|
|
1997
2039
|
partyType: {
|
|
1998
2040
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
2041
|
+
origin: PartyOrigin.internal,
|
|
1999
2042
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
2000
2043
|
name: 'example_name',
|
|
2001
2044
|
},
|
|
@@ -2029,6 +2072,7 @@ describe('Database entities tests', (): void => {
|
|
|
2029
2072
|
uri: 'example1.com',
|
|
2030
2073
|
partyType: {
|
|
2031
2074
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
2075
|
+
origin: PartyOrigin.internal,
|
|
2032
2076
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
2033
2077
|
name: 'example_name1',
|
|
2034
2078
|
},
|
|
@@ -2051,6 +2095,7 @@ describe('Database entities tests', (): void => {
|
|
|
2051
2095
|
uri: 'example2.com',
|
|
2052
2096
|
partyType: {
|
|
2053
2097
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
2098
|
+
origin: PartyOrigin.internal,
|
|
2054
2099
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d288',
|
|
2055
2100
|
name: 'example_name2',
|
|
2056
2101
|
},
|
|
@@ -2092,6 +2137,7 @@ describe('Database entities tests', (): void => {
|
|
|
2092
2137
|
it('Should delete party type', async (): Promise<void> => {
|
|
2093
2138
|
const partyType: NonPersistedPartyType = {
|
|
2094
2139
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
2140
|
+
origin: PartyOrigin.internal,
|
|
2095
2141
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
2096
2142
|
name: 'example_name',
|
|
2097
2143
|
}
|
|
@@ -2115,6 +2161,7 @@ describe('Database entities tests', (): void => {
|
|
|
2115
2161
|
uri: 'example.com',
|
|
2116
2162
|
partyType: {
|
|
2117
2163
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
2164
|
+
origin: PartyOrigin.internal,
|
|
2118
2165
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
2119
2166
|
name: 'example_name',
|
|
2120
2167
|
},
|
|
@@ -2141,6 +2188,7 @@ describe('Database entities tests', (): void => {
|
|
|
2141
2188
|
it('Should save party with existing party type', async (): Promise<void> => {
|
|
2142
2189
|
const partyType: NonPersistedPartyType = {
|
|
2143
2190
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
2191
|
+
origin: PartyOrigin.internal,
|
|
2144
2192
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
2145
2193
|
name: 'example_name',
|
|
2146
2194
|
}
|
|
@@ -2173,6 +2221,7 @@ describe('Database entities tests', (): void => {
|
|
|
2173
2221
|
expect(fromDb?.partyType).toBeDefined()
|
|
2174
2222
|
expect(fromDb?.partyType.id).toEqual(savedPartyType.id)
|
|
2175
2223
|
expect(fromDb?.partyType.type).toEqual(savedPartyType.type)
|
|
2224
|
+
expect(fromDb?.partyType.origin).toEqual(savedPartyType.origin)
|
|
2176
2225
|
expect(fromDb?.partyType.tenantId).toEqual(savedPartyType.tenantId)
|
|
2177
2226
|
expect(fromDb?.partyType.name).toEqual(savedPartyType.name)
|
|
2178
2227
|
})
|
|
@@ -2180,6 +2229,7 @@ describe('Database entities tests', (): void => {
|
|
|
2180
2229
|
it('Should not update creation date when saving party type', async (): Promise<void> => {
|
|
2181
2230
|
const partyType: NonPersistedPartyType = {
|
|
2182
2231
|
type: PartyTypeEnum.NATURAL_PERSON,
|
|
2232
|
+
origin: PartyOrigin.internal,
|
|
2183
2233
|
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
|
|
2184
2234
|
name: 'example_name',
|
|
2185
2235
|
}
|