@stamhoofd/backend 2.106.1 → 2.107.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/index.ts +6 -1
- package/package.json +17 -11
- package/src/boot.ts +28 -22
- package/src/endpoints/frontend/FrontendEnvironmentEndpoint.ts +89 -0
- package/src/endpoints/global/billing/ActivatePackagesEndpoint.ts +30 -0
- package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.ts +3 -2
- package/src/endpoints/global/registration/PatchUserMembersEndpoint.ts +8 -3
- package/src/endpoints/global/registration/RegisterMembersEndpoint.test.ts +109 -109
- package/src/endpoints/global/registration/RegisterMembersEndpoint.ts +7 -0
- package/src/endpoints/organization/dashboard/payments/PatchBalanceItemsEndpoint.ts +9 -7
- package/src/endpoints/organization/dashboard/payments/PatchPaymentsEndpoint.ts +7 -0
- package/src/endpoints/organization/webshops/PlaceOrderEndpoint.ts +9 -2
- package/src/excel-loaders/payments.ts +5 -5
- package/src/excel-loaders/receivable-balances.ts +7 -7
- package/src/helpers/AdminPermissionChecker.ts +20 -0
- package/src/helpers/BuckarooHelper.ts +1 -1
- package/src/helpers/ServiceFeeHelper.ts +8 -4
- package/src/helpers/StripeHelper.ts +20 -35
- package/src/seeds/1752848561-groups-registration-periods.ts +35 -0
- package/src/services/BalanceItemService.ts +15 -2
- package/src/services/PaymentReallocationService.test.ts +298 -128
- package/src/services/PaymentReallocationService.ts +46 -16
- package/src/services/PaymentService.ts +49 -2
- package/src/services/uitpas/getSocialTariffForEvent.ts +2 -2
- package/src/services/uitpas/getSocialTariffForUitpasNumbers.ts +2 -2
- package/src/services/uitpas/registerTicketSales.ts +2 -2
- package/tests/e2e/bundle-discounts.test.ts +415 -391
- package/tests/e2e/documents.test.ts +21 -21
- package/tests/e2e/register.test.ts +93 -93
- package/tests/e2e/stock.test.ts +4 -4
|
@@ -86,8 +86,8 @@ describe('E2E.Register', () => {
|
|
|
86
86
|
|
|
87
87
|
const group = await new GroupFactory({
|
|
88
88
|
organization,
|
|
89
|
-
price:
|
|
90
|
-
reducedPrice:
|
|
89
|
+
price: 2500,
|
|
90
|
+
reducedPrice: 2100,
|
|
91
91
|
stock: 5,
|
|
92
92
|
}).create();
|
|
93
93
|
|
|
@@ -131,7 +131,7 @@ describe('E2E.Register', () => {
|
|
|
131
131
|
administrationFee: 0,
|
|
132
132
|
freeContribution: 0,
|
|
133
133
|
paymentMethod: PaymentMethod.PointOfSale,
|
|
134
|
-
totalPrice:
|
|
134
|
+
totalPrice: 2500,
|
|
135
135
|
customer: null,
|
|
136
136
|
});
|
|
137
137
|
|
|
@@ -144,9 +144,9 @@ describe('E2E.Register', () => {
|
|
|
144
144
|
pricePaid: 0,
|
|
145
145
|
type: BalanceItemType.Registration,
|
|
146
146
|
status: BalanceItemStatus.Due,
|
|
147
|
-
unitPrice:
|
|
147
|
+
unitPrice: 2500,
|
|
148
148
|
amount: 1,
|
|
149
|
-
pricePending:
|
|
149
|
+
pricePending: 2500,
|
|
150
150
|
priceOpen: 0,
|
|
151
151
|
},
|
|
152
152
|
]);
|
|
@@ -158,16 +158,16 @@ describe('E2E.Register', () => {
|
|
|
158
158
|
const option1 = GroupOption.create({
|
|
159
159
|
name: 'option 1',
|
|
160
160
|
price: ReduceablePrice.create({
|
|
161
|
-
price:
|
|
162
|
-
reducedPrice:
|
|
161
|
+
price: 500,
|
|
162
|
+
reducedPrice: 300,
|
|
163
163
|
}),
|
|
164
164
|
});
|
|
165
165
|
|
|
166
166
|
const option2 = GroupOption.create({
|
|
167
167
|
name: 'option 2',
|
|
168
168
|
price: ReduceablePrice.create({
|
|
169
|
-
price:
|
|
170
|
-
reducedPrice:
|
|
169
|
+
price: 300,
|
|
170
|
+
reducedPrice: 100,
|
|
171
171
|
}),
|
|
172
172
|
});
|
|
173
173
|
|
|
@@ -214,7 +214,7 @@ describe('E2E.Register', () => {
|
|
|
214
214
|
administrationFee: 0,
|
|
215
215
|
freeContribution: 0,
|
|
216
216
|
paymentMethod: PaymentMethod.PointOfSale,
|
|
217
|
-
totalPrice:
|
|
217
|
+
totalPrice: 5000,
|
|
218
218
|
customer: null,
|
|
219
219
|
});
|
|
220
220
|
|
|
@@ -226,10 +226,10 @@ describe('E2E.Register', () => {
|
|
|
226
226
|
{
|
|
227
227
|
type: BalanceItemType.Registration,
|
|
228
228
|
amount: 2,
|
|
229
|
-
unitPrice:
|
|
230
|
-
price:
|
|
229
|
+
unitPrice: 500,
|
|
230
|
+
price: 1000,
|
|
231
231
|
pricePaid: 0,
|
|
232
|
-
pricePending:
|
|
232
|
+
pricePending: 1000,
|
|
233
233
|
relations: new Map([
|
|
234
234
|
[
|
|
235
235
|
BalanceItemRelationType.Group,
|
|
@@ -257,10 +257,10 @@ describe('E2E.Register', () => {
|
|
|
257
257
|
{
|
|
258
258
|
type: BalanceItemType.Registration,
|
|
259
259
|
amount: 5,
|
|
260
|
-
unitPrice:
|
|
261
|
-
price:
|
|
260
|
+
unitPrice: 300,
|
|
261
|
+
price: 1500,
|
|
262
262
|
pricePaid: 0,
|
|
263
|
-
pricePending:
|
|
263
|
+
pricePending: 1500,
|
|
264
264
|
relations: new Map([
|
|
265
265
|
[
|
|
266
266
|
BalanceItemRelationType.Group,
|
|
@@ -288,9 +288,9 @@ describe('E2E.Register', () => {
|
|
|
288
288
|
{
|
|
289
289
|
type: BalanceItemType.Registration,
|
|
290
290
|
amount: 1,
|
|
291
|
-
price:
|
|
291
|
+
price: 2500,
|
|
292
292
|
pricePaid: 0,
|
|
293
|
-
pricePending:
|
|
293
|
+
pricePending: 2500,
|
|
294
294
|
relations: new Map([
|
|
295
295
|
[
|
|
296
296
|
BalanceItemRelationType.Group,
|
|
@@ -325,9 +325,9 @@ describe('E2E.Register', () => {
|
|
|
325
325
|
deleteRegistrationIds: [],
|
|
326
326
|
}),
|
|
327
327
|
administrationFee: 0,
|
|
328
|
-
freeContribution:
|
|
328
|
+
freeContribution: 3100,
|
|
329
329
|
paymentMethod: PaymentMethod.PointOfSale,
|
|
330
|
-
totalPrice:
|
|
330
|
+
totalPrice: 2500,
|
|
331
331
|
customer: null,
|
|
332
332
|
});
|
|
333
333
|
|
|
@@ -344,7 +344,7 @@ describe('E2E.Register', () => {
|
|
|
344
344
|
expect(receivableBalanceAfter.body.amountOpen).toBe(0);
|
|
345
345
|
expect(receivableBalanceAfter.body.balanceItems).toEqual(expect.arrayContaining([
|
|
346
346
|
expect.objectContaining({
|
|
347
|
-
price:
|
|
347
|
+
price: 2500,
|
|
348
348
|
pricePaid: 0,
|
|
349
349
|
}),
|
|
350
350
|
]));
|
|
@@ -355,7 +355,7 @@ describe('E2E.Register', () => {
|
|
|
355
355
|
|
|
356
356
|
organization.meta.recordsConfiguration.freeContribution = FreeContributionSettings.create({
|
|
357
357
|
description: 'free contribution settings',
|
|
358
|
-
amounts: [
|
|
358
|
+
amounts: [3000, 2000],
|
|
359
359
|
});
|
|
360
360
|
|
|
361
361
|
await organization.save();
|
|
@@ -378,9 +378,9 @@ describe('E2E.Register', () => {
|
|
|
378
378
|
deleteRegistrationIds: [],
|
|
379
379
|
}),
|
|
380
380
|
administrationFee: 0,
|
|
381
|
-
freeContribution:
|
|
381
|
+
freeContribution: 3000,
|
|
382
382
|
paymentMethod: PaymentMethod.PointOfSale,
|
|
383
|
-
totalPrice:
|
|
383
|
+
totalPrice: 5500,
|
|
384
384
|
customer: null,
|
|
385
385
|
});
|
|
386
386
|
|
|
@@ -394,16 +394,16 @@ describe('E2E.Register', () => {
|
|
|
394
394
|
const receivableBalanceAfter = await getReceivableBalance(ReceivableBalanceType.user, user.id, organization, token);
|
|
395
395
|
expect(receivableBalanceAfter).toBeDefined();
|
|
396
396
|
expect(receivableBalanceAfter.body.balanceItems.length).toBe(2);
|
|
397
|
-
expect(receivableBalanceAfter.body.amountPending).toBe(
|
|
397
|
+
expect(receivableBalanceAfter.body.amountPending).toBe(5500);
|
|
398
398
|
|
|
399
399
|
expect(receivableBalanceAfter.body.balanceItems).toEqual(expect.arrayContaining([
|
|
400
400
|
expect.objectContaining({
|
|
401
|
-
price:
|
|
401
|
+
price: 3000,
|
|
402
402
|
pricePaid: 0,
|
|
403
403
|
type: BalanceItemType.FreeContribution,
|
|
404
404
|
}),
|
|
405
405
|
expect.objectContaining({
|
|
406
|
-
price:
|
|
406
|
+
price: 2500,
|
|
407
407
|
pricePaid: 0,
|
|
408
408
|
}),
|
|
409
409
|
]));
|
|
@@ -413,7 +413,7 @@ describe('E2E.Register', () => {
|
|
|
413
413
|
const { organization, group, groupPrice, token, member, user } = await initData();
|
|
414
414
|
|
|
415
415
|
organization.meta.registrationPaymentConfiguration.administrationFee = AdministrationFeeSettings.create({
|
|
416
|
-
fixed:
|
|
416
|
+
fixed: 3300,
|
|
417
417
|
});
|
|
418
418
|
|
|
419
419
|
await organization.save();
|
|
@@ -435,10 +435,10 @@ describe('E2E.Register', () => {
|
|
|
435
435
|
],
|
|
436
436
|
deleteRegistrationIds: [],
|
|
437
437
|
}),
|
|
438
|
-
administrationFee:
|
|
438
|
+
administrationFee: 3300,
|
|
439
439
|
freeContribution: 0,
|
|
440
440
|
paymentMethod: PaymentMethod.PointOfSale,
|
|
441
|
-
totalPrice:
|
|
441
|
+
totalPrice: 5800,
|
|
442
442
|
});
|
|
443
443
|
|
|
444
444
|
const receivableBalanceBefore = await getReceivableBalance(ReceivableBalanceType.user, user.id, organization
|
|
@@ -452,16 +452,16 @@ describe('E2E.Register', () => {
|
|
|
452
452
|
const receivableBalanceAfter = await getReceivableBalance(ReceivableBalanceType.user, user.id, organization, token);
|
|
453
453
|
expect(receivableBalanceAfter).toBeDefined();
|
|
454
454
|
expect(receivableBalanceAfter.body.balanceItems.length).toBe(2);
|
|
455
|
-
expect(receivableBalanceAfter.body.amountPending).toBe(
|
|
455
|
+
expect(receivableBalanceAfter.body.amountPending).toBe(5800);
|
|
456
456
|
|
|
457
457
|
expect(receivableBalanceAfter.body.balanceItems).toEqual(expect.arrayContaining([
|
|
458
458
|
expect.objectContaining({
|
|
459
|
-
price:
|
|
459
|
+
price: 2500,
|
|
460
460
|
pricePaid: 0,
|
|
461
461
|
type: BalanceItemType.Registration,
|
|
462
462
|
}),
|
|
463
463
|
expect.objectContaining({
|
|
464
|
-
price:
|
|
464
|
+
price: 3300,
|
|
465
465
|
pricePaid: 0,
|
|
466
466
|
type: BalanceItemType.AdministrationFee,
|
|
467
467
|
}),
|
|
@@ -478,12 +478,12 @@ describe('E2E.Register', () => {
|
|
|
478
478
|
payingOrganizationId: organization.id,
|
|
479
479
|
type: BalanceItemType.Registration,
|
|
480
480
|
amount: 10,
|
|
481
|
-
unitPrice:
|
|
481
|
+
unitPrice: 200,
|
|
482
482
|
}).create();
|
|
483
483
|
|
|
484
484
|
const cartItem = BalanceItemCartItem.create({
|
|
485
485
|
item: balanceItem1.getStructure(),
|
|
486
|
-
price:
|
|
486
|
+
price: 1000,
|
|
487
487
|
});
|
|
488
488
|
|
|
489
489
|
const body = IDRegisterCheckout.create({
|
|
@@ -507,7 +507,7 @@ describe('E2E.Register', () => {
|
|
|
507
507
|
administrationFee: 0,
|
|
508
508
|
freeContribution: 0,
|
|
509
509
|
paymentMethod: PaymentMethod.PointOfSale,
|
|
510
|
-
totalPrice:
|
|
510
|
+
totalPrice: 3500,
|
|
511
511
|
});
|
|
512
512
|
|
|
513
513
|
const response = await register(body, organization, token);
|
|
@@ -516,15 +516,15 @@ describe('E2E.Register', () => {
|
|
|
516
516
|
const receivableBalanceAfter = await getReceivableBalance(ReceivableBalanceType.user, user.id, organization, token);
|
|
517
517
|
|
|
518
518
|
expect(receivableBalanceAfter.body.balanceItems.length).toBe(2);
|
|
519
|
-
expect(receivableBalanceAfter.body.amountPending).toBe(
|
|
520
|
-
expect(receivableBalanceAfter.body.amountOpen).toBe(
|
|
519
|
+
expect(receivableBalanceAfter.body.amountPending).toBe(3500);
|
|
520
|
+
expect(receivableBalanceAfter.body.amountOpen).toBe(1000);
|
|
521
521
|
|
|
522
522
|
expect(receivableBalanceAfter.body.balanceItems).toEqual(expect.arrayContaining([
|
|
523
523
|
expect.objectContaining({
|
|
524
|
-
pricePending:
|
|
524
|
+
pricePending: 1000,
|
|
525
525
|
}),
|
|
526
526
|
expect.objectContaining({
|
|
527
|
-
pricePending:
|
|
527
|
+
pricePending: 2500,
|
|
528
528
|
}),
|
|
529
529
|
]));
|
|
530
530
|
});
|
|
@@ -557,7 +557,7 @@ describe('E2E.Register', () => {
|
|
|
557
557
|
administrationFee: 0,
|
|
558
558
|
freeContribution: 0,
|
|
559
559
|
paymentMethod: PaymentMethod.PointOfSale,
|
|
560
|
-
totalPrice:
|
|
560
|
+
totalPrice: 2100,
|
|
561
561
|
customer: null,
|
|
562
562
|
});
|
|
563
563
|
|
|
@@ -567,10 +567,10 @@ describe('E2E.Register', () => {
|
|
|
567
567
|
|
|
568
568
|
await assertBalances({ member }, [
|
|
569
569
|
{
|
|
570
|
-
unitPrice:
|
|
570
|
+
unitPrice: 2100,
|
|
571
571
|
amount: 1,
|
|
572
572
|
pricePaid: 0,
|
|
573
|
-
pricePending:
|
|
573
|
+
pricePending: 2100,
|
|
574
574
|
priceOpen: 0,
|
|
575
575
|
type: BalanceItemType.Registration,
|
|
576
576
|
status: BalanceItemStatus.Due,
|
|
@@ -589,16 +589,16 @@ describe('E2E.Register', () => {
|
|
|
589
589
|
const option1 = GroupOption.create({
|
|
590
590
|
name: 'option 1',
|
|
591
591
|
price: ReduceablePrice.create({
|
|
592
|
-
price:
|
|
593
|
-
reducedPrice:
|
|
592
|
+
price: 500,
|
|
593
|
+
reducedPrice: 300,
|
|
594
594
|
}),
|
|
595
595
|
});
|
|
596
596
|
|
|
597
597
|
const option2 = GroupOption.create({
|
|
598
598
|
name: 'option 2',
|
|
599
599
|
price: ReduceablePrice.create({
|
|
600
|
-
price:
|
|
601
|
-
reducedPrice:
|
|
600
|
+
price: 300,
|
|
601
|
+
reducedPrice: 100,
|
|
602
602
|
}),
|
|
603
603
|
});
|
|
604
604
|
|
|
@@ -645,7 +645,7 @@ describe('E2E.Register', () => {
|
|
|
645
645
|
administrationFee: 0,
|
|
646
646
|
freeContribution: 0,
|
|
647
647
|
paymentMethod: PaymentMethod.PointOfSale,
|
|
648
|
-
totalPrice:
|
|
648
|
+
totalPrice: 3200,
|
|
649
649
|
customer: null,
|
|
650
650
|
});
|
|
651
651
|
|
|
@@ -655,23 +655,23 @@ describe('E2E.Register', () => {
|
|
|
655
655
|
|
|
656
656
|
await assertBalances({ member }, [
|
|
657
657
|
{
|
|
658
|
-
unitPrice:
|
|
658
|
+
unitPrice: 300,
|
|
659
659
|
amount: 2,
|
|
660
|
-
pricePending:
|
|
660
|
+
pricePending: 600,
|
|
661
661
|
pricePaid: 0,
|
|
662
662
|
status: BalanceItemStatus.Due,
|
|
663
663
|
},
|
|
664
664
|
{
|
|
665
|
-
unitPrice:
|
|
665
|
+
unitPrice: 2100,
|
|
666
666
|
pricePaid: 0,
|
|
667
|
-
pricePending:
|
|
667
|
+
pricePending: 2100,
|
|
668
668
|
amount: 1,
|
|
669
669
|
status: BalanceItemStatus.Due,
|
|
670
670
|
},
|
|
671
671
|
{
|
|
672
|
-
unitPrice:
|
|
672
|
+
unitPrice: 100,
|
|
673
673
|
pricePaid: 0,
|
|
674
|
-
pricePending:
|
|
674
|
+
pricePending: 500,
|
|
675
675
|
amount: 5,
|
|
676
676
|
status: BalanceItemStatus.Due,
|
|
677
677
|
},
|
|
@@ -700,7 +700,7 @@ describe('E2E.Register', () => {
|
|
|
700
700
|
administrationFee: 0,
|
|
701
701
|
freeContribution: 0,
|
|
702
702
|
paymentMethod: PaymentMethod.PointOfSale,
|
|
703
|
-
totalPrice:
|
|
703
|
+
totalPrice: 2500,
|
|
704
704
|
customer: null,
|
|
705
705
|
});
|
|
706
706
|
|
|
@@ -712,10 +712,10 @@ describe('E2E.Register', () => {
|
|
|
712
712
|
|
|
713
713
|
await assertBalances({ member }, [
|
|
714
714
|
{
|
|
715
|
-
unitPrice:
|
|
715
|
+
unitPrice: 2500,
|
|
716
716
|
pricePaid: 0,
|
|
717
717
|
status: BalanceItemStatus.Due,
|
|
718
|
-
pricePending:
|
|
718
|
+
pricePending: 2500,
|
|
719
719
|
priceOpen: 0,
|
|
720
720
|
registrationId: registrationToDelete.id,
|
|
721
721
|
},
|
|
@@ -723,7 +723,7 @@ describe('E2E.Register', () => {
|
|
|
723
723
|
|
|
724
724
|
const group = await new GroupFactory({
|
|
725
725
|
organization,
|
|
726
|
-
price:
|
|
726
|
+
price: 3000,
|
|
727
727
|
stock: 5,
|
|
728
728
|
}).create();
|
|
729
729
|
|
|
@@ -742,7 +742,7 @@ describe('E2E.Register', () => {
|
|
|
742
742
|
],
|
|
743
743
|
deleteRegistrationIds: [registrationToDelete.id],
|
|
744
744
|
}),
|
|
745
|
-
totalPrice:
|
|
745
|
+
totalPrice: 3000 - 2500,
|
|
746
746
|
asOrganizationId: organization.id,
|
|
747
747
|
});
|
|
748
748
|
|
|
@@ -750,19 +750,19 @@ describe('E2E.Register', () => {
|
|
|
750
750
|
|
|
751
751
|
await assertBalances({ member }, [
|
|
752
752
|
{
|
|
753
|
-
unitPrice:
|
|
753
|
+
unitPrice: 2500,
|
|
754
754
|
amount: 1,
|
|
755
755
|
pricePaid: 0,
|
|
756
756
|
status: BalanceItemStatus.Canceled,
|
|
757
757
|
registrationId: registrationToDelete.id,
|
|
758
|
-
pricePending:
|
|
759
|
-
priceOpen: -
|
|
758
|
+
pricePending: 2500,
|
|
759
|
+
priceOpen: -2500,
|
|
760
760
|
},
|
|
761
761
|
{
|
|
762
|
-
unitPrice:
|
|
762
|
+
unitPrice: 3000,
|
|
763
763
|
pricePaid: 0,
|
|
764
764
|
status: BalanceItemStatus.Due,
|
|
765
|
-
priceOpen:
|
|
765
|
+
priceOpen: 3000,
|
|
766
766
|
pricePending: 0,
|
|
767
767
|
},
|
|
768
768
|
]);
|
|
@@ -774,16 +774,16 @@ describe('E2E.Register', () => {
|
|
|
774
774
|
const option1 = GroupOption.create({
|
|
775
775
|
name: 'option 1',
|
|
776
776
|
price: ReduceablePrice.create({
|
|
777
|
-
price:
|
|
778
|
-
reducedPrice:
|
|
777
|
+
price: 500,
|
|
778
|
+
reducedPrice: 300,
|
|
779
779
|
}),
|
|
780
780
|
});
|
|
781
781
|
|
|
782
782
|
const option2 = GroupOption.create({
|
|
783
783
|
name: 'option 2',
|
|
784
784
|
price: ReduceablePrice.create({
|
|
785
|
-
price:
|
|
786
|
-
reducedPrice:
|
|
785
|
+
price: 300,
|
|
786
|
+
reducedPrice: 100,
|
|
787
787
|
}),
|
|
788
788
|
});
|
|
789
789
|
|
|
@@ -823,7 +823,7 @@ describe('E2E.Register', () => {
|
|
|
823
823
|
}),
|
|
824
824
|
],
|
|
825
825
|
}),
|
|
826
|
-
totalPrice:
|
|
826
|
+
totalPrice: 5000,
|
|
827
827
|
customer: null,
|
|
828
828
|
asOrganizationId: organization.id,
|
|
829
829
|
});
|
|
@@ -836,25 +836,25 @@ describe('E2E.Register', () => {
|
|
|
836
836
|
|
|
837
837
|
await assertBalances({ member }, [
|
|
838
838
|
{
|
|
839
|
-
unitPrice:
|
|
839
|
+
unitPrice: 500,
|
|
840
840
|
amount: 2,
|
|
841
841
|
pricePending: 0,
|
|
842
|
-
priceOpen:
|
|
842
|
+
priceOpen: 1000,
|
|
843
843
|
status: BalanceItemStatus.Due,
|
|
844
844
|
registrationId: registrationToDelete.id,
|
|
845
845
|
},
|
|
846
846
|
{
|
|
847
|
-
unitPrice:
|
|
847
|
+
unitPrice: 300,
|
|
848
848
|
amount: 5,
|
|
849
849
|
pricePending: 0,
|
|
850
|
-
priceOpen:
|
|
850
|
+
priceOpen: 1500,
|
|
851
851
|
status: BalanceItemStatus.Due,
|
|
852
852
|
registrationId: registrationToDelete.id,
|
|
853
853
|
},
|
|
854
854
|
{
|
|
855
|
-
unitPrice:
|
|
855
|
+
unitPrice: 2500,
|
|
856
856
|
pricePending: 0,
|
|
857
|
-
priceOpen:
|
|
857
|
+
priceOpen: 2500,
|
|
858
858
|
status: BalanceItemStatus.Due,
|
|
859
859
|
registrationId: registrationToDelete.id,
|
|
860
860
|
},
|
|
@@ -862,7 +862,7 @@ describe('E2E.Register', () => {
|
|
|
862
862
|
|
|
863
863
|
const group = await new GroupFactory({
|
|
864
864
|
organization,
|
|
865
|
-
price:
|
|
865
|
+
price: 3000,
|
|
866
866
|
stock: 5,
|
|
867
867
|
}).create();
|
|
868
868
|
|
|
@@ -881,7 +881,7 @@ describe('E2E.Register', () => {
|
|
|
881
881
|
],
|
|
882
882
|
deleteRegistrationIds: [registrationToDelete.id],
|
|
883
883
|
}),
|
|
884
|
-
totalPrice:
|
|
884
|
+
totalPrice: 3000 - 5000,
|
|
885
885
|
asOrganizationId: organization.id,
|
|
886
886
|
});
|
|
887
887
|
|
|
@@ -889,7 +889,7 @@ describe('E2E.Register', () => {
|
|
|
889
889
|
|
|
890
890
|
await assertBalances({ member }, [
|
|
891
891
|
{
|
|
892
|
-
unitPrice:
|
|
892
|
+
unitPrice: 500,
|
|
893
893
|
amount: 2,
|
|
894
894
|
pricePending: 0,
|
|
895
895
|
priceOpen: 0,
|
|
@@ -897,7 +897,7 @@ describe('E2E.Register', () => {
|
|
|
897
897
|
registrationId: registrationToDelete.id,
|
|
898
898
|
},
|
|
899
899
|
{
|
|
900
|
-
unitPrice:
|
|
900
|
+
unitPrice: 300,
|
|
901
901
|
amount: 5,
|
|
902
902
|
pricePending: 0,
|
|
903
903
|
priceOpen: 0,
|
|
@@ -905,19 +905,19 @@ describe('E2E.Register', () => {
|
|
|
905
905
|
registrationId: registrationToDelete.id,
|
|
906
906
|
},
|
|
907
907
|
{
|
|
908
|
-
unitPrice:
|
|
908
|
+
unitPrice: 2500,
|
|
909
909
|
pricePending: 0,
|
|
910
910
|
priceOpen: 0,
|
|
911
911
|
status: BalanceItemStatus.Canceled,
|
|
912
912
|
registrationId: registrationToDelete.id,
|
|
913
913
|
},
|
|
914
914
|
{
|
|
915
|
-
unitPrice:
|
|
915
|
+
unitPrice: 3000,
|
|
916
916
|
pricePaid: 0,
|
|
917
917
|
amount: 1,
|
|
918
918
|
status: BalanceItemStatus.Due,
|
|
919
919
|
pricePending: 0,
|
|
920
|
-
priceOpen:
|
|
920
|
+
priceOpen: 3000,
|
|
921
921
|
},
|
|
922
922
|
]);
|
|
923
923
|
});
|
|
@@ -937,7 +937,7 @@ describe('E2E.Register', () => {
|
|
|
937
937
|
}),
|
|
938
938
|
],
|
|
939
939
|
}),
|
|
940
|
-
totalPrice:
|
|
940
|
+
totalPrice: 2500,
|
|
941
941
|
asOrganizationId: organization.id,
|
|
942
942
|
});
|
|
943
943
|
|
|
@@ -949,19 +949,19 @@ describe('E2E.Register', () => {
|
|
|
949
949
|
|
|
950
950
|
await assertBalances({ member }, [
|
|
951
951
|
{
|
|
952
|
-
unitPrice:
|
|
952
|
+
unitPrice: 2500,
|
|
953
953
|
pricePaid: 0,
|
|
954
954
|
status: BalanceItemStatus.Due,
|
|
955
955
|
type: BalanceItemType.Registration,
|
|
956
956
|
pricePending: 0,
|
|
957
|
-
priceOpen:
|
|
957
|
+
priceOpen: 2500,
|
|
958
958
|
registrationId: registrationToDelete.id,
|
|
959
959
|
},
|
|
960
960
|
]);
|
|
961
961
|
|
|
962
962
|
const group = await new GroupFactory({
|
|
963
963
|
organization,
|
|
964
|
-
price:
|
|
964
|
+
price: 3000,
|
|
965
965
|
stock: 5,
|
|
966
966
|
}).create();
|
|
967
967
|
|
|
@@ -982,7 +982,7 @@ describe('E2E.Register', () => {
|
|
|
982
982
|
],
|
|
983
983
|
deleteRegistrationIds: [registrationToDelete.id],
|
|
984
984
|
}),
|
|
985
|
-
totalPrice:
|
|
985
|
+
totalPrice: 3000 - 2500 + 500, // 20% of 2500 is 500
|
|
986
986
|
asOrganizationId: organization.id,
|
|
987
987
|
cancellationFeePercentage: 20_00,
|
|
988
988
|
});
|
|
@@ -990,7 +990,7 @@ describe('E2E.Register', () => {
|
|
|
990
990
|
await register(body2, organization, token);
|
|
991
991
|
await assertBalances({ member }, [
|
|
992
992
|
{
|
|
993
|
-
unitPrice:
|
|
993
|
+
unitPrice: 2500,
|
|
994
994
|
pricePaid: 0,
|
|
995
995
|
status: BalanceItemStatus.Canceled,
|
|
996
996
|
pricePending: 0,
|
|
@@ -999,20 +999,20 @@ describe('E2E.Register', () => {
|
|
|
999
999
|
registrationId: registrationToDelete.id,
|
|
1000
1000
|
},
|
|
1001
1001
|
{
|
|
1002
|
-
unitPrice:
|
|
1002
|
+
unitPrice: 500,
|
|
1003
1003
|
pricePaid: 0,
|
|
1004
1004
|
pricePending: 0,
|
|
1005
|
-
priceOpen:
|
|
1005
|
+
priceOpen: 500,
|
|
1006
1006
|
amount: 1,
|
|
1007
1007
|
type: BalanceItemType.CancellationFee,
|
|
1008
1008
|
status: BalanceItemStatus.Due,
|
|
1009
1009
|
registrationId: registrationToDelete.id,
|
|
1010
1010
|
},
|
|
1011
1011
|
{
|
|
1012
|
-
unitPrice:
|
|
1012
|
+
unitPrice: 3000,
|
|
1013
1013
|
pricePaid: 0,
|
|
1014
1014
|
pricePending: 0,
|
|
1015
|
-
priceOpen:
|
|
1015
|
+
priceOpen: 3000,
|
|
1016
1016
|
amount: 1,
|
|
1017
1017
|
status: BalanceItemStatus.Due,
|
|
1018
1018
|
type: BalanceItemType.Registration,
|
|
@@ -1080,7 +1080,7 @@ describe('E2E.Register', () => {
|
|
|
1080
1080
|
}),
|
|
1081
1081
|
],
|
|
1082
1082
|
}),
|
|
1083
|
-
totalPrice:
|
|
1083
|
+
totalPrice: 2500,
|
|
1084
1084
|
asOrganizationId: organization.id,
|
|
1085
1085
|
});
|
|
1086
1086
|
|
package/tests/e2e/stock.test.ts
CHANGED
|
@@ -266,13 +266,13 @@ describe('E2E.Stock', () => {
|
|
|
266
266
|
|
|
267
267
|
productPrice1 = ProductPrice.create({
|
|
268
268
|
name: 'productPrice1',
|
|
269
|
-
price:
|
|
269
|
+
price: 1_0000,
|
|
270
270
|
stock: 100,
|
|
271
271
|
});
|
|
272
272
|
|
|
273
273
|
productPrice2 = ProductPrice.create({
|
|
274
274
|
name: 'productPrice2',
|
|
275
|
-
price:
|
|
275
|
+
price: 1_5000,
|
|
276
276
|
stock: 100,
|
|
277
277
|
});
|
|
278
278
|
|
|
@@ -284,7 +284,7 @@ describe('E2E.Stock', () => {
|
|
|
284
284
|
|
|
285
285
|
checkboxOption1 = Option.create({
|
|
286
286
|
name: 'checkboxOption1',
|
|
287
|
-
price:
|
|
287
|
+
price: 1000,
|
|
288
288
|
stock: 100,
|
|
289
289
|
});
|
|
290
290
|
|
|
@@ -296,7 +296,7 @@ describe('E2E.Stock', () => {
|
|
|
296
296
|
|
|
297
297
|
radioOption1 = Option.create({
|
|
298
298
|
name: 'radioOption1',
|
|
299
|
-
price:
|
|
299
|
+
price: 1000,
|
|
300
300
|
stock: 100,
|
|
301
301
|
});
|
|
302
302
|
|