@loomcore/api 0.1.148 → 0.1.149

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.
@@ -16,8 +16,8 @@ export const getPostgresTestSchema = (config) => {
16
16
  "count" INTEGER,
17
17
  "_created" TIMESTAMPTZ NOT NULL,
18
18
  "_createdBy" INTEGER NOT NULL,
19
- "_updated" TIMESTAMPTZ NOT NULL,
20
- "_updatedBy" INTEGER NOT NULL,
19
+ "_updated" TIMESTAMPTZ,
20
+ "_updatedBy" INTEGER,
21
21
  "_deleted" TIMESTAMPTZ,
22
22
  "_deletedBy" INTEGER
23
23
  )
@@ -57,8 +57,8 @@ export const getPostgresTestSchema = (config) => {
57
57
  "category_id" INTEGER NOT NULL,
58
58
  "_created" TIMESTAMPTZ NOT NULL,
59
59
  "_createdBy" INTEGER NOT NULL,
60
- "_updated" TIMESTAMPTZ NOT NULL,
61
- "_updatedBy" INTEGER NOT NULL,
60
+ "_updated" TIMESTAMPTZ,
61
+ "_updatedBy" INTEGER,
62
62
  "_deleted" TIMESTAMPTZ,
63
63
  "_deletedBy" INTEGER,
64
64
  CONSTRAINT "fk_products_category" FOREIGN KEY ("category_id") REFERENCES "categories"("_id") ON DELETE CASCADE
@@ -82,8 +82,8 @@ export const getPostgresTestSchema = (config) => {
82
82
  "event_date" TIMESTAMPTZ,
83
83
  "_created" TIMESTAMPTZ NOT NULL,
84
84
  "_createdBy" INTEGER NOT NULL,
85
- "_updated" TIMESTAMPTZ NOT NULL,
86
- "_updatedBy" INTEGER NOT NULL,
85
+ "_updated" TIMESTAMPTZ,
86
+ "_updatedBy" INTEGER,
87
87
  "_deleted" TIMESTAMPTZ,
88
88
  "_deletedBy" INTEGER
89
89
  )
@@ -104,8 +104,8 @@ export const getPostgresTestSchema = (config) => {
104
104
  "person_id" INTEGER NOT NULL UNIQUE,
105
105
  "_created" TIMESTAMPTZ NOT NULL,
106
106
  "_createdBy" INTEGER NOT NULL,
107
- "_updated" TIMESTAMPTZ NOT NULL,
108
- "_updatedBy" INTEGER NOT NULL,
107
+ "_updated" TIMESTAMPTZ,
108
+ "_updatedBy" INTEGER,
109
109
  "_deleted" TIMESTAMPTZ,
110
110
  "_deletedBy" INTEGER,
111
111
  CONSTRAINT fk_agents_person_id FOREIGN KEY ("person_id") REFERENCES persons("_id") ON DELETE CASCADE
@@ -129,8 +129,8 @@ export const getPostgresTestSchema = (config) => {
129
129
  "agent_id" INTEGER,
130
130
  "_created" TIMESTAMPTZ NOT NULL,
131
131
  "_createdBy" INTEGER NOT NULL,
132
- "_updated" TIMESTAMPTZ NOT NULL,
133
- "_updatedBy" INTEGER NOT NULL,
132
+ "_updated" TIMESTAMPTZ,
133
+ "_updatedBy" INTEGER,
134
134
  "_deleted" TIMESTAMPTZ,
135
135
  "_deletedBy" INTEGER,
136
136
  CONSTRAINT fk_clients_person_id FOREIGN KEY ("person_id") REFERENCES persons("_id") ON DELETE CASCADE,
@@ -155,8 +155,8 @@ export const getPostgresTestSchema = (config) => {
155
155
  "frequency" VARCHAR NOT NULL,
156
156
  "_created" TIMESTAMPTZ NOT NULL,
157
157
  "_createdBy" INTEGER NOT NULL,
158
- "_updated" TIMESTAMPTZ NOT NULL,
159
- "_updatedBy" INTEGER NOT NULL,
158
+ "_updated" TIMESTAMPTZ,
159
+ "_updatedBy" INTEGER,
160
160
  "_deleted" TIMESTAMPTZ,
161
161
  "_deletedBy" INTEGER,
162
162
  CONSTRAINT fk_policies_client_id FOREIGN KEY ("client_id") REFERENCES clients("_id") ON DELETE CASCADE
@@ -179,8 +179,8 @@ export const getPostgresTestSchema = (config) => {
179
179
  "agent_id" INTEGER NOT NULL,
180
180
  "_created" TIMESTAMPTZ NOT NULL,
181
181
  "_createdBy" INTEGER NOT NULL,
182
- "_updated" TIMESTAMPTZ NOT NULL,
183
- "_updatedBy" INTEGER NOT NULL,
182
+ "_updated" TIMESTAMPTZ,
183
+ "_updatedBy" INTEGER,
184
184
  "_deleted" TIMESTAMPTZ,
185
185
  "_deletedBy" INTEGER,
186
186
  CONSTRAINT fk_agents_policies_policy_id FOREIGN KEY ("policy_id") REFERENCES policies("_id") ON DELETE CASCADE,
@@ -206,8 +206,8 @@ export const getPostgresTestSchema = (config) => {
206
206
  "date" DATE NOT NULL,
207
207
  "_created" TIMESTAMPTZ NOT NULL,
208
208
  "_createdBy" INTEGER NOT NULL,
209
- "_updated" TIMESTAMPTZ NOT NULL,
210
- "_updatedBy" INTEGER NOT NULL,
209
+ "_updated" TIMESTAMPTZ,
210
+ "_updatedBy" INTEGER,
211
211
  "_deleted" TIMESTAMPTZ,
212
212
  "_deletedBy" INTEGER,
213
213
  CONSTRAINT fk_premiums_policy_id FOREIGN KEY ("policy_id") REFERENCES policies("_id") ON DELETE CASCADE
@@ -233,8 +233,8 @@ export const getPostgresTestSchema = (config) => {
233
233
  "is_default" BOOLEAN NOT NULL,
234
234
  "_created" TIMESTAMPTZ NOT NULL,
235
235
  "_createdBy" INTEGER NOT NULL,
236
- "_updated" TIMESTAMPTZ NOT NULL,
237
- "_updatedBy" INTEGER NOT NULL,
236
+ "_updated" TIMESTAMPTZ,
237
+ "_updatedBy" INTEGER,
238
238
  "_deleted" TIMESTAMPTZ,
239
239
  "_deletedBy" INTEGER,
240
240
  CONSTRAINT fk_email_addresses_person_id FOREIGN KEY ("person_id") REFERENCES persons("_id") ON DELETE CASCADE
@@ -259,8 +259,8 @@ export const getPostgresTestSchema = (config) => {
259
259
  "is_default" BOOLEAN NOT NULL DEFAULT FALSE,
260
260
  "_created" TIMESTAMPTZ NOT NULL,
261
261
  "_createdBy" INTEGER NOT NULL,
262
- "_updated" TIMESTAMPTZ NOT NULL,
263
- "_updatedBy" INTEGER NOT NULL,
262
+ "_updated" TIMESTAMPTZ,
263
+ "_updatedBy" INTEGER,
264
264
  "_deleted" TIMESTAMPTZ,
265
265
  "_deletedBy" INTEGER
266
266
  )
@@ -288,8 +288,8 @@ export const getPostgresTestSchema = (config) => {
288
288
  "country" VARCHAR NOT NULL,
289
289
  "_created" TIMESTAMPTZ NOT NULL,
290
290
  "_createdBy" INTEGER NOT NULL,
291
- "_updated" TIMESTAMPTZ NOT NULL,
292
- "_updatedBy" INTEGER NOT NULL,
291
+ "_updated" TIMESTAMPTZ,
292
+ "_updatedBy" INTEGER,
293
293
  "_deleted" TIMESTAMPTZ,
294
294
  "_deletedBy" INTEGER
295
295
  )
@@ -311,8 +311,8 @@ export const getPostgresTestSchema = (config) => {
311
311
  "person_id" INTEGER NOT NULL,
312
312
  "_created" TIMESTAMPTZ NOT NULL,
313
313
  "_createdBy" INTEGER NOT NULL,
314
- "_updated" TIMESTAMPTZ NOT NULL,
315
- "_updatedBy" INTEGER NOT NULL,
314
+ "_updated" TIMESTAMPTZ,
315
+ "_updatedBy" INTEGER,
316
316
  "_deleted" TIMESTAMPTZ,
317
317
  "_deletedBy" INTEGER,
318
318
  CONSTRAINT fk_persons_addresses_address_id FOREIGN KEY ("address_id") REFERENCES addresses("_id") ON DELETE CASCADE,
@@ -337,8 +337,8 @@ export const getPostgresTestSchema = (config) => {
337
337
  "person_id" INTEGER NOT NULL,
338
338
  "_created" TIMESTAMPTZ NOT NULL,
339
339
  "_createdBy" INTEGER NOT NULL,
340
- "_updated" TIMESTAMPTZ NOT NULL,
341
- "_updatedBy" INTEGER NOT NULL,
340
+ "_updated" TIMESTAMPTZ,
341
+ "_updatedBy" INTEGER,
342
342
  "_deleted" TIMESTAMPTZ,
343
343
  "_deletedBy" INTEGER,
344
344
  CONSTRAINT fk_persons_phone_numbers_phone_number_id FOREIGN KEY ("phone_number_id") REFERENCES phone_numbers("_id") ON DELETE CASCADE,
@@ -362,8 +362,8 @@ export const getPostgresTestSchema = (config) => {
362
362
  "name" VARCHAR NOT NULL,
363
363
  "_created" TIMESTAMPTZ NOT NULL,
364
364
  "_createdBy" INTEGER NOT NULL,
365
- "_updated" TIMESTAMPTZ NOT NULL,
366
- "_updatedBy" INTEGER NOT NULL,
365
+ "_updated" TIMESTAMPTZ,
366
+ "_updatedBy" INTEGER,
367
367
  "_deleted" TIMESTAMPTZ,
368
368
  "_deletedBy" INTEGER
369
369
  )
@@ -385,8 +385,8 @@ export const getPostgresTestSchema = (config) => {
385
385
  "state_id" INTEGER NOT NULL,
386
386
  "_created" TIMESTAMPTZ NOT NULL,
387
387
  "_createdBy" INTEGER NOT NULL,
388
- "_updated" TIMESTAMPTZ NOT NULL,
389
- "_updatedBy" INTEGER NOT NULL,
388
+ "_updated" TIMESTAMPTZ,
389
+ "_updatedBy" INTEGER,
390
390
  "_deleted" TIMESTAMPTZ,
391
391
  "_deletedBy" INTEGER,
392
392
  CONSTRAINT fk_districts_state_id FOREIGN KEY ("state_id") REFERENCES states("_id") ON DELETE CASCADE
@@ -409,8 +409,8 @@ export const getPostgresTestSchema = (config) => {
409
409
  "district_id" INTEGER NOT NULL,
410
410
  "_created" TIMESTAMPTZ NOT NULL,
411
411
  "_createdBy" INTEGER NOT NULL,
412
- "_updated" TIMESTAMPTZ NOT NULL,
413
- "_updatedBy" INTEGER NOT NULL,
412
+ "_updated" TIMESTAMPTZ,
413
+ "_updatedBy" INTEGER,
414
414
  "_deleted" TIMESTAMPTZ,
415
415
  "_deletedBy" INTEGER,
416
416
  CONSTRAINT fk_schools_district_id FOREIGN KEY ("district_id") REFERENCES districts("_id") ON DELETE CASCADE
@@ -433,8 +433,8 @@ export const getPostgresTestSchema = (config) => {
433
433
  "school_id" INTEGER NOT NULL,
434
434
  "_created" TIMESTAMPTZ NOT NULL,
435
435
  "_createdBy" INTEGER NOT NULL,
436
- "_updated" TIMESTAMPTZ NOT NULL,
437
- "_updatedBy" INTEGER NOT NULL,
436
+ "_updated" TIMESTAMPTZ,
437
+ "_updatedBy" INTEGER,
438
438
  "_deleted" TIMESTAMPTZ,
439
439
  "_deletedBy" INTEGER,
440
440
  CONSTRAINT fk_persons_schools_person_id FOREIGN KEY ("person_id") REFERENCES persons("_id") ON DELETE CASCADE,
@@ -20,8 +20,6 @@ export function getTestMetaOrg() {
20
20
  isMetaOrg: true,
21
21
  _created: new Date(),
22
22
  _createdBy: 'system',
23
- _updated: new Date(),
24
- _updatedBy: 'system',
25
23
  };
26
24
  }
27
25
  ;
@@ -36,8 +34,6 @@ export function getTestMetaOrgUser() {
36
34
  password: TEST_META_ORG_USER_PASSWORD,
37
35
  _created: new Date(),
38
36
  _createdBy: 'system',
39
- _updated: new Date(),
40
- _updatedBy: 'system',
41
37
  };
42
38
  }
43
39
  export function getTestMetaOrgUserPerson() {
@@ -52,8 +48,6 @@ export function getTestMetaOrgUserPerson() {
52
48
  isEmployee: false,
53
49
  _created: new Date(),
54
50
  _createdBy: 'system',
55
- _updated: new Date(),
56
- _updatedBy: 'system',
57
51
  };
58
52
  return person;
59
53
  }
@@ -92,8 +86,6 @@ export function getTestOrg() {
92
86
  isMetaOrg: false,
93
87
  _created: new Date(),
94
88
  _createdBy: 'system',
95
- _updated: new Date(),
96
- _updatedBy: 'system',
97
89
  };
98
90
  }
99
91
  ;
@@ -109,8 +101,6 @@ export function getTestOrgUser() {
109
101
  password: TEST_ORG_USER_PASSWORD,
110
102
  _created: new Date(),
111
103
  _createdBy: 'system',
112
- _updated: new Date(),
113
- _updatedBy: 'system',
114
104
  };
115
105
  }
116
106
  export function getTestOrgUserPerson() {
@@ -125,8 +115,6 @@ export function getTestOrgUserPerson() {
125
115
  isEmployee: false,
126
116
  _created: new Date(),
127
117
  _createdBy: 'system',
128
- _updated: new Date(),
129
- _updatedBy: 'system',
130
118
  };
131
119
  }
132
120
  export function getTestOrgUserContext() {
@@ -5,6 +5,4 @@ export function auditForCreate(userContext, doc) {
5
5
  const userId = userContext.user?._id ?? getSystemUserId();
6
6
  doc._created = now;
7
7
  doc._createdBy = userId;
8
- doc._updated = now;
9
- doc._updatedBy = userId;
10
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomcore/api",
3
- "version": "0.1.148",
3
+ "version": "0.1.149",
4
4
  "private": false,
5
5
  "description": "Loom Core Api - An opinionated Node.js api using Typescript, Express, and MongoDb or PostgreSQL",
6
6
  "scripts": {