@stamhoofd/backend 2.134.0 → 2.135.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.
Files changed (26) hide show
  1. package/package.json +17 -17
  2. package/src/endpoints/auth/VerifyEmailEndpoint.test.ts +154 -0
  3. package/src/endpoints/auth/VerifyEmailEndpoint.ts +4 -0
  4. package/src/endpoints/global/members/GetMembersEndpoint.test.ts +224 -2
  5. package/src/endpoints/global/registration/RegisterMembersEndpoint.test.ts +150 -0
  6. package/src/endpoints/global/registration/RegisterMembersEndpoint.ts +4 -3
  7. package/src/endpoints/organization/dashboard/organization/PatchOrganizationEndpoint.ts +2 -0
  8. package/src/endpoints/organization/dashboard/organization/SetUitpasClientCredentialsEndpoint.ts +1 -8
  9. package/src/endpoints/organization/dashboard/webshops/PatchWebshopEndpoint.test.ts +49 -0
  10. package/src/endpoints/organization/dashboard/webshops/PatchWebshopOrdersEndpoint.test.ts +71 -0
  11. package/src/endpoints/organization/dashboard/webshops/PatchWebshopOrdersEndpoint.ts +4 -0
  12. package/src/endpoints/organization/webshops/GetWebshopEndpoint.test.ts +11 -0
  13. package/src/endpoints/organization/webshops/OrderConfirmationEmailLanguage.test.ts +70 -0
  14. package/src/endpoints/organization/webshops/PlaceOrderEndpoint.test.ts +68 -1
  15. package/src/endpoints/organization/webshops/PlaceOrderEndpoint.ts +8 -0
  16. package/src/helpers/GlobalHelper.ts +1 -1
  17. package/src/helpers/MembershipCharger.ts +2 -1
  18. package/src/helpers/UitpasTokenRepository.ts +12 -11
  19. package/src/seeds/1783097277-update-member-last-registered.sql +6 -0
  20. package/src/seeds/1783939632-mark-zero-price-payments-succeeded.ts +90 -0
  21. package/src/services/PaymentService.ts +33 -8
  22. package/src/services/PlatformMembershipService.ts +2 -1
  23. package/src/services/RegistrationService.ts +5 -0
  24. package/src/services/uitpas/UitpasService.ts +3 -4
  25. package/src/sql-filters/members.ts +5 -0
  26. package/src/sql-sorters/members.ts +12 -1
@@ -368,14 +368,13 @@ export class UitpasService {
368
368
  }
369
369
 
370
370
  /**
371
- * Store the uitpas client credentials if they are valid
371
+ * Store the uitpas client credentials if they are valid, throws otherwise
372
372
  * @param organizationId null for platform
373
373
  * @param clientId
374
374
  * @param clientSecret
375
- * @returns wether the credentials were valid and thus stored successfully
376
375
  */
377
- static async storeIfValid(organizationId: string | null, clientId: string, clientSecret: string): Promise<boolean> {
378
- return await UitpasTokenRepository.storeIfValid(organizationId, clientId, clientSecret);
376
+ static async storeIfValid(organizationId: string | null, clientId: string, clientSecret: string): Promise<void> {
377
+ await UitpasTokenRepository.storeIfValid(organizationId, clientId, clientSecret);
379
378
  }
380
379
 
381
380
  static async clearClientCredentialsFor(organizationId: string | null) {
@@ -65,6 +65,11 @@ export const memberFilterCompilers: SQLFilterDefinitions = {
65
65
  type: SQLValueType.Datetime,
66
66
  nullable: false,
67
67
  }),
68
+ 'lastRegisteredAt': createColumnFilter({
69
+ expression: SQL.column(membersTable, 'lastRegisteredAt'),
70
+ type: SQLValueType.Datetime,
71
+ nullable: true,
72
+ }),
68
73
  'organizationName': createColumnFilter({
69
74
  expression: SQL.column('organizations', 'name'),
70
75
  type: SQLValueType.String,
@@ -69,7 +69,7 @@ export const memberSorters: SQLSortDefinitions<MemberWithUsersRegistrationsAndGr
69
69
  },
70
70
  createdAt: {
71
71
  getValue(a) {
72
- return a.createdAt;
72
+ return Formatter.dateTimeIso(a.createdAt, 'UTC');
73
73
  },
74
74
  toSQL: (direction: SQLOrderByDirection): SQLOrderBy => {
75
75
  return new SQLOrderBy({
@@ -78,4 +78,15 @@ export const memberSorters: SQLSortDefinitions<MemberWithUsersRegistrationsAndGr
78
78
  });
79
79
  },
80
80
  },
81
+ lastRegisteredAt: {
82
+ getValue(a) {
83
+ return a.lastRegisteredAt ? Formatter.dateTimeIso(a.lastRegisteredAt, 'UTC') : null;
84
+ },
85
+ toSQL: (direction: SQLOrderByDirection): SQLOrderBy => {
86
+ return new SQLOrderBy({
87
+ column: SQL.column('lastRegisteredAt'),
88
+ direction,
89
+ });
90
+ },
91
+ },
81
92
  };