@stamhoofd/backend 2.13.0 → 2.14.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stamhoofd/backend",
3
- "version": "2.13.0",
3
+ "version": "2.14.0",
4
4
  "main": "./dist/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -41,7 +41,7 @@
41
41
  "@stamhoofd/models": "^2.13.0",
42
42
  "@stamhoofd/queues": "^2.13.0",
43
43
  "@stamhoofd/sql": "^2.13.0",
44
- "@stamhoofd/structures": "^2.13.0",
44
+ "@stamhoofd/structures": "^2.14.0",
45
45
  "@stamhoofd/utility": "^2.13.0",
46
46
  "aws-sdk": "^2.885.0",
47
47
  "axios": "1.6.8",
@@ -58,5 +58,5 @@
58
58
  "postmark": "4.0.2",
59
59
  "stripe": "^16.6.0"
60
60
  },
61
- "gitHead": "2b130616eebea8cd30feb0f361c7bb0f48b534ba"
61
+ "gitHead": "93374a0a3799ee54f387d4cff70c7cf70afc0ac8"
62
62
  }
@@ -3,7 +3,7 @@ import { Decoder } from '@simonbackx/simple-encoding';
3
3
  import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-endpoints';
4
4
  import { SimpleError } from '@simonbackx/simple-errors';
5
5
  import { Payment } from '@stamhoofd/models';
6
- import { SQLJsonUnquote, SQL, SQLConcat, SQLFilterDefinitions, SQLOrderBy, SQLOrderByDirection, SQLScalar, SQLSortDefinitions, baseSQLFilterCompilers, compileToSQLFilter, compileToSQLSorter, createSQLColumnFilterCompiler, createSQLExpressionFilterCompiler, createSQLFilterNamespace, createSQLRelationFilterCompiler, SQLCast } from "@stamhoofd/sql";
6
+ import { SQL, SQLCast, SQLConcat, SQLFilterDefinitions, SQLJsonUnquote, SQLOrderBy, SQLOrderByDirection, SQLScalar, SQLSortDefinitions, baseSQLFilterCompilers, compileToSQLFilter, compileToSQLSorter, createSQLColumnFilterCompiler, createSQLExpressionFilterCompiler, createSQLFilterNamespace, createSQLRelationFilterCompiler } from "@stamhoofd/sql";
7
7
  import { CountFilteredRequest, LimitedFilteredRequest, PaginatedResponse, PaymentGeneral, StamhoofdFilter, getSortFilter } from '@stamhoofd/structures';
8
8
  import { Formatter } from '@stamhoofd/utility';
9
9
 
@@ -34,6 +34,7 @@ const filterCompilers: SQLFilterDefinitions = {
34
34
  status: createSQLColumnFilterCompiler('status'),
35
35
  organizationId: createSQLColumnFilterCompiler('organizationId'),
36
36
  createdAt: createSQLColumnFilterCompiler('createdAt'),
37
+ updatedAt: createSQLColumnFilterCompiler('updatedAt'),
37
38
  paidAt: createSQLColumnFilterCompiler('paidAt', {nullable: true}),
38
39
  price: createSQLColumnFilterCompiler('price'),
39
40
  provider: createSQLColumnFilterCompiler('provider', {nullable: true}),
@@ -169,7 +169,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
169
169
  })
170
170
  }
171
171
 
172
- if (patch.method || patch.paidAt !== undefined) {
172
+ if (patch.method || patch.paidAt !== undefined || patch.status !== undefined) {
173
173
  if (payment.method && ![PaymentMethod.Unknown, PaymentMethod.Transfer, PaymentMethod.PointOfSale].includes(payment.method)) {
174
174
  throw new SimpleError({
175
175
  code: "invalid_field",