@stamhoofd/backend 2.114.0 → 2.115.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.
@@ -54,88 +54,4 @@ export const orderSorters: SQLSortDefinitions<Order> = {
54
54
  });
55
55
  },
56
56
  },
57
- status: {
58
- getValue(a) {
59
- return a.status;
60
- },
61
- toSQL: (direction: SQLOrderByDirection): SQLOrderBy => {
62
- return new SQLOrderBy({
63
- column: SQL.column('status'),
64
- direction,
65
- });
66
- },
67
- },
68
- paymentMethod: {
69
- getValue(a) {
70
- return a.data.paymentMethod;
71
- },
72
- toSQL: (direction: SQLOrderByDirection): SQLOrderBy => {
73
- return new SQLOrderBy({
74
- column: SQL.jsonExtract(SQL.column('data'), '$.value.paymentMethod'),
75
- direction,
76
- });
77
- },
78
- },
79
- checkoutMethod: {
80
- getValue(a) {
81
- return a.data.checkoutMethod?.type;
82
- },
83
- toSQL: (direction: SQLOrderByDirection): SQLOrderBy => {
84
- return new SQLOrderBy({
85
- column: SQL.jsonExtract(SQL.column('data'), '$.value.checkoutMethod.type'),
86
- direction,
87
- });
88
- },
89
- },
90
- timeSlotDate: {
91
- getValue(a) {
92
- return a.data.timeSlot?.date.getTime();
93
- },
94
- toSQL: (direction: SQLOrderByDirection): SQLOrderBy => {
95
- return new SQLOrderBy({
96
- column: SQL.jsonExtract(SQL.column('data'), '$.value.timeSlot.date'),
97
- direction,
98
- });
99
- },
100
- },
101
- timeSlotTime: {
102
- getValue(a) {
103
- return a.data.timeSlot?.endTime;
104
- },
105
- toSQL: (direction: SQLOrderByDirection): SQLOrderBy => {
106
- return new SQLOrderBy({
107
- column: SQL.jsonExtract(SQL.column('data'), '$.value.timeSlot.endTime'),
108
- direction,
109
- });
110
- },
111
- },
112
- validAt: {
113
- getValue(a) {
114
- return a.validAt?.getTime();
115
- },
116
- toSQL: (direction: SQLOrderByDirection): SQLOrderBy => {
117
- return new SQLOrderBy({
118
- column: SQL.column('validAt'),
119
- direction,
120
- });
121
- },
122
- },
123
- totalPrice: {
124
- getValue(a) {
125
- return a.data.totalPrice;
126
- },
127
- toSQL: (direction: SQLOrderByDirection): SQLOrderBy => {
128
- return new SQLOrderBy({
129
- column: SQL.jsonExtract(SQL.column('data'), '$.value.totalPrice'),
130
- direction,
131
- });
132
- },
133
- },
134
- // amount: {
135
- // getValue: (order) => {
136
- // return order.data.cart.items.reduce((acc, item) => {
137
- // return acc + item.amount;
138
- // }, 0);
139
- // }
140
- // }
141
57
  };
@@ -60,7 +60,7 @@ export const organizationSorters: SQLSortDefinitions<Organization> = {
60
60
  },
61
61
  toSQL: (direction: SQLOrderByDirection): SQLOrderBy => {
62
62
  return new SQLOrderBy({
63
- column: SQL.jsonExtract(SQL.column('meta'), '$.value.type'),
63
+ column: SQL.jsonValue(SQL.column('meta'), '$.value.type', 'CHAR'),
64
64
  direction,
65
65
  });
66
66
  },
@@ -71,7 +71,7 @@ export const organizationSorters: SQLSortDefinitions<Organization> = {
71
71
  },
72
72
  toSQL: (direction: SQLOrderByDirection): SQLOrderBy => {
73
73
  return new SQLOrderBy({
74
- column: SQL.jsonExtract(SQL.column('address'), '$.value.city'),
74
+ column: SQL.jsonValue(SQL.column('address'), '$.value.city', 'CHAR'),
75
75
  direction,
76
76
  });
77
77
  },
@@ -82,7 +82,7 @@ export const organizationSorters: SQLSortDefinitions<Organization> = {
82
82
  },
83
83
  toSQL: (direction: SQLOrderByDirection): SQLOrderBy => {
84
84
  return new SQLOrderBy({
85
- column: SQL.jsonExtract(SQL.column('address'), '$.value.country'),
85
+ column: SQL.jsonValue(SQL.column('address'), '$.value.country', 'CHAR'),
86
86
  direction,
87
87
  });
88
88
  },