@tamu-dor/famis-db 1.3.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 (58) hide show
  1. package/change.txt +123 -0
  2. package/changes.md +405 -0
  3. package/docs/assets/anchor.js +350 -0
  4. package/docs/assets/bass-addons.css +12 -0
  5. package/docs/assets/bass.css +544 -0
  6. package/docs/assets/fonts/EOT/SourceCodePro-Bold.eot +0 -0
  7. package/docs/assets/fonts/EOT/SourceCodePro-Regular.eot +0 -0
  8. package/docs/assets/fonts/LICENSE.txt +93 -0
  9. package/docs/assets/fonts/OTF/SourceCodePro-Bold.otf +0 -0
  10. package/docs/assets/fonts/OTF/SourceCodePro-Regular.otf +0 -0
  11. package/docs/assets/fonts/TTF/SourceCodePro-Bold.ttf +0 -0
  12. package/docs/assets/fonts/TTF/SourceCodePro-Regular.ttf +0 -0
  13. package/docs/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff +0 -0
  14. package/docs/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff +0 -0
  15. package/docs/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff +0 -0
  16. package/docs/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff +0 -0
  17. package/docs/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 +0 -0
  18. package/docs/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 +0 -0
  19. package/docs/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 +0 -0
  20. package/docs/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 +0 -0
  21. package/docs/assets/fonts/source-code-pro.css +23 -0
  22. package/docs/assets/github.css +123 -0
  23. package/docs/assets/site.js +168 -0
  24. package/docs/assets/split.css +15 -0
  25. package/docs/assets/split.js +782 -0
  26. package/docs/assets/style.css +147 -0
  27. package/docs/index.html +3737 -0
  28. package/docs.md +591 -0
  29. package/famisDb.pdf +0 -0
  30. package/index.js +1497 -0
  31. package/package.json +25 -0
  32. package/readme.md +38 -0
  33. package/readme.wiki +332 -0
  34. package/schemas/00-initial-data.sql +116 -0
  35. package/schemas/migrations/201906101221.sql +29 -0
  36. package/schemas/migrations/201907081530.sql +51 -0
  37. package/schemas/migrations/201908230849.sql +40 -0
  38. package/schemas/migrations/201910031358.sql +73 -0
  39. package/schemas/migrations/20191024.sql +38 -0
  40. package/schemas/migrations/201911060915.sql +3 -0
  41. package/schemas/migrations/202001221335.sql +58 -0
  42. package/schemas/migrations/202003041114.sql +53 -0
  43. package/schemas/migrations/202003261143.sql +47 -0
  44. package/schemas/migrations/202004201456.sql +3 -0
  45. package/schemas/migrations/20200722.sql +92 -0
  46. package/schemas/migrations/202007281124.sql +17 -0
  47. package/schemas/migrations/20200729.sql +76 -0
  48. package/schemas/migrations/20200806-FCF.sql +72 -0
  49. package/schemas/migrations/20200806-IMAC.sql +60 -0
  50. package/schemas/migrations/20200811.sql +46 -0
  51. package/schemas/migrations/20200813.sql +36 -0
  52. package/schemas/migrations/202010210924.sql +66 -0
  53. package/schemas/migrations/202010211558.sql +20 -0
  54. package/schemas/migrations/202011130651.sql +4 -0
  55. package/schemas/migrations/202011130951.sql +17 -0
  56. package/schemas/migrations/202101201051.sql +33 -0
  57. package/schemas/migrations/postponed-202004221221.sql +66 -0
  58. package/schemas/schema.sql +155 -0
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@tamu-dor/famis-db",
3
+ "version": "1.3.0",
4
+ "description": "DB library for FAMIS database",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "docs:md": "documentation build index.js -f md --markdown-toc-max-depth 2 --sort-order alpha > docs.md",
9
+ "docs:html": "documentation build index.js -f html --sort-order alpha -o docs"
10
+ },
11
+ "keywords": [
12
+ "famis",
13
+ "postgres",
14
+ "knex"
15
+ ],
16
+ "author": "Matt Voss",
17
+ "license": "ISC",
18
+ "dependencies": {
19
+ "awaity": "^1.0.0",
20
+ "cuid": "^2.1.8",
21
+ "knex": "^3.1.0",
22
+ "pg": "^8.11.3",
23
+ "rev-hash": "^3.0.0"
24
+ }
25
+ }
package/readme.md ADDED
@@ -0,0 +1,38 @@
1
+ # FAMIS DB API
2
+
3
+ ## Installation
4
+
5
+ `npm install famis-db`
6
+
7
+ ## Usage
8
+
9
+ ```javascript
10
+ import FamisDb from 'famis-db'
11
+
12
+ const famisdb = new FAMISDb({
13
+ host: 'localhost',
14
+ user: 'username',
15
+ password: 'password',
16
+ database: 'dbname',
17
+ });
18
+ ```
19
+
20
+ ## Configuration
21
+
22
+ ```javascript
23
+ {
24
+ host: 'localhost',
25
+ user: 'username',
26
+ password: 'password',
27
+ database: 'dbname',
28
+ }
29
+ ```
30
+
31
+ - host = [`string`] host name of database server
32
+ - user = [`string`] username to access database
33
+ - password = [`string`] password to access database
34
+ - database = [`string`] name of database
35
+
36
+ ## API
37
+
38
+ [API Documentation](docs.md)
package/readme.wiki ADDED
@@ -0,0 +1,332 @@
1
+ = FAMIS DB API =
2
+
3
+ == Installation ==
4
+
5
+ <code>npm install famis-db</code>
6
+
7
+ == Usage ==
8
+
9
+ <source lang="javascript">import FamisDb from 'famis-db'
10
+
11
+ const famisdb = new FAMISDb({
12
+ host: 'localhost',
13
+ user: 'username',
14
+ password: 'password',
15
+ database: 'dbname',
16
+ });</source>
17
+ == Configuration ==
18
+
19
+ <source lang="javascript">{
20
+ host: 'localhost',
21
+ user: 'username',
22
+ password: 'password',
23
+ database: 'dbname',
24
+ }</source>
25
+ * host = [<code>string</code>] host name of database server
26
+ * user = [<code>string</code>] username to access database
27
+ * password = [<code>string</code>] password to access database
28
+ * database = [<code>string</code>] name of database
29
+
30
+ == API ==
31
+
32
+ <!-- Generated by documentation.js. Update this documentation by updating the source code. -->
33
+ ==== Table of Contents ====
34
+
35
+ * [[#processinvoice|processInvoice]]
36
+ ** [[#parameters|Parameters]]
37
+ * [[#getinvoicebyid|getInvoiceById]]
38
+ ** [[#parameters-1|Parameters]]
39
+ * [[#getinvoicebyuid|getInvoiceByUid]]
40
+ ** [[#parameters-2|Parameters]]
41
+ * [[#getinvoicebynumber|getInvoiceByNumber]]
42
+ ** [[#parameters-3|Parameters]]
43
+ * [[#getinvoicesbyaccount|getInvoicesByAccount]]
44
+ ** [[#parameters-4|Parameters]]
45
+ * [[#getallinvoices|getAllInvoices]]
46
+ ** [[#parameters-5|Parameters]]
47
+ * [[#getlatestinvoices|getLatestInvoices]]
48
+ * [[#getheldinvoices|getHeldInvoices]]
49
+ * [[#searchinvoicesbynumber|searchInvoicesByNumber]]
50
+ ** [[#parameters-6|Parameters]]
51
+ * [[#searchinvoicesbyfamis|searchInvoicesByFamis]]
52
+ ** [[#parameters-7|Parameters]]
53
+ * [[#addinvoice|addInvoice]]
54
+ ** [[#parameters-8|Parameters]]
55
+ * [[#updateinvoice|updateInvoice]]
56
+ ** [[#parameters-9|Parameters]]
57
+ * [[#markinvoiced|markInvoiced]]
58
+ ** [[#parameters-10|Parameters]]
59
+ * [[#getfundbyaccountnumber|getFundByAccountNumber]]
60
+ ** [[#parameters-11|Parameters]]
61
+ * [[#searchfundbyaccountnumber|searchFundByAccountNumber]]
62
+ ** [[#parameters-12|Parameters]]
63
+ * [[#getfundsbyuin|getFundsByUin]]
64
+ ** [[#parameters-13|Parameters]]
65
+ * [[#getfundsbyresponsibleuin|getFundsByResponsibleUin]]
66
+ ** [[#parameters-14|Parameters]]
67
+ * [[#getnextfamisinvoicenumber|getNextFAMISInvoiceNumber]]
68
+ ** [[#parameters-15|Parameters]]
69
+ * [[#getexpensecode|getExpenseCode]]
70
+ ** [[#parameters-16|Parameters]]
71
+ * [[#getcorebyaccount|getCoreByAccount]]
72
+ ** [[#parameters-17|Parameters]]
73
+ * [[#getsystembyid|getSystemById]]
74
+ ** [[#parameters-18|Parameters]]
75
+ * [[#getusercores|getUserCores]]
76
+ ** [[#parameters-19|Parameters]]
77
+ * [[#getusersystemparts|getUserSystemParts]]
78
+ ** [[#parameters-20|Parameters]]
79
+ * [[#getuser|getUser]]
80
+ ** [[#parameters-21|Parameters]]
81
+ * [[#getcustomernumber|getCustomerNumber]]
82
+ ** [[#parameters-22|Parameters]]
83
+
84
+ === processInvoice ===
85
+
86
+ Process an invoice to have all necessary relationships
87
+
88
+ ==== Parameters ====
89
+
90
+ * <code>invoice</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object object]'''
91
+
92
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object object]&gt;''' invoice object
93
+
94
+ === getInvoiceById ===
95
+
96
+ Get invoice by id
97
+
98
+ ==== Parameters ====
99
+
100
+ * <code>id</code> '''nhumber'''
101
+
102
+ Returns '''any''' object&gt;} invoice object
103
+
104
+ === getInvoiceByUid ===
105
+
106
+ Get invoice by uid
107
+
108
+ ==== Parameters ====
109
+
110
+ * <code>uid</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]'''
111
+
112
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object object]&gt;''' invoice object
113
+
114
+ === getInvoiceByNumber ===
115
+
116
+ Get invoice by originating system assigned number
117
+
118
+ ==== Parameters ====
119
+
120
+ * <code>number</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]'''
121
+
122
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object object]&gt;''' invoice object
123
+
124
+ === getInvoicesByAccount ===
125
+
126
+ Get all invoices associated with a specified account number
127
+
128
+ ==== Parameters ====
129
+
130
+ * <code>accountNumber</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]'''
131
+
132
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array array]&gt;''' invoice objects
133
+
134
+ === getAllInvoices ===
135
+
136
+ Get all invoice ordered by and sorted by paramaters passed
137
+
138
+ ==== Parameters ====
139
+
140
+ * <code>orderBy</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]''' (optional, default <code>'date'</code>)
141
+ * <code>dir</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]''' (optional, default <code>'desc'</code>)
142
+
143
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array array]&gt;''' invoice objects
144
+
145
+ === getLatestInvoices ===
146
+
147
+ Retreives invoices from the latest date
148
+
149
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array array]&gt;''' invoice objects
150
+
151
+ === getHeldInvoices ===
152
+
153
+ Returns all held invoices
154
+
155
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array array]&gt;''' held invoice objects
156
+
157
+ === searchInvoicesByNumber ===
158
+
159
+ Search invoices by originating system generated invoice number
160
+
161
+ ==== Parameters ====
162
+
163
+ * <code>number</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]'''
164
+
165
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array array]&gt;''' invoice objects
166
+
167
+ === searchInvoicesByFamis ===
168
+
169
+ Search invoices by FAMIS invoice number
170
+
171
+ ==== Parameters ====
172
+
173
+ * <code>famis</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]'''
174
+
175
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array array]&gt;''' invoice objects
176
+
177
+ === addInvoice ===
178
+
179
+ Adds an invoice
180
+
181
+ ==== Parameters ====
182
+
183
+ * <code>invoice</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object object]'''
184
+ * <code>type</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]'''
185
+ * <code>famisInvoiceNumber</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]'''
186
+
187
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object object]&gt;''' invoice
188
+
189
+ === updateInvoice ===
190
+
191
+ Updates an invoice
192
+
193
+ ==== Parameters ====
194
+
195
+ * <code>id</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number number]'''
196
+ * <code>invoice</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]'''
197
+
198
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object object]&gt;''' invoice object
199
+
200
+ === markInvoiced ===
201
+
202
+ Toggles an invoice as paid
203
+
204
+ ==== Parameters ====
205
+
206
+ * <code>id</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number number]'''
207
+ * <code>invoiced</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean boolean]'''
208
+
209
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object object]&gt;''' invoice object
210
+
211
+ === getFundByAccountNumber ===
212
+
213
+ Get PI funds by account number
214
+
215
+ ==== Parameters ====
216
+
217
+ * <code>number</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]'''
218
+
219
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object object]&gt;''' fund object
220
+
221
+ === searchFundByAccountNumber ===
222
+
223
+ Search PI funds by partial account number
224
+
225
+ ==== Parameters ====
226
+
227
+ * <code>number</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]'''
228
+
229
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array array]&gt;''' fund object(s)
230
+
231
+ === getFundsByUin ===
232
+
233
+ Get PI funds by UIN
234
+
235
+ ==== Parameters ====
236
+
237
+ * <code>uin</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]'''
238
+
239
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object object]&gt;''' fund object
240
+
241
+ === getFundsByResponsibleUin ===
242
+
243
+ Get PI funds by responsible UIN
244
+
245
+ ==== Parameters ====
246
+
247
+ * <code>uin</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]'''
248
+
249
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array array]&gt;''' fund object(s)
250
+
251
+ === getNextFAMISInvoiceNumber ===
252
+
253
+ Get next FAMIS invoice number in sequence for specified invoice type
254
+
255
+ ==== Parameters ====
256
+
257
+ * <code>type</code><br />
258
+
259
+ * <code>invoice</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]'''
260
+
261
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]&gt;''' next invoice number in sequence
262
+
263
+ === getExpenseCode ===
264
+
265
+ Get matching expense code for specified revenue code
266
+
267
+ ==== Parameters ====
268
+
269
+ * <code>revenue</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]'''
270
+
271
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]&gt;''' expense code
272
+
273
+ === getCoreByAccount ===
274
+
275
+ Get core by account number
276
+
277
+ ==== Parameters ====
278
+
279
+ * <code>account</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]'''
280
+
281
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object object]&gt;''' core object
282
+
283
+ === getSystemById ===
284
+
285
+ Get System part by ID
286
+
287
+ ==== Parameters ====
288
+
289
+ * <code>id</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number number]'''
290
+
291
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object object]&gt;''' system part object
292
+
293
+ === getUserCores ===
294
+
295
+ Get a user's cores they manage
296
+
297
+ ==== Parameters ====
298
+
299
+ * <code>userId</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]'''
300
+
301
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array array]&gt;''' core objects
302
+
303
+ === getUserSystemParts ===
304
+
305
+ Get a user's system parts they manage
306
+
307
+ ==== Parameters ====
308
+
309
+ * <code>userId</code> '''any'''
310
+
311
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object object]&gt;''' system objects
312
+
313
+ === getUser ===
314
+
315
+ Get user
316
+
317
+ ==== Parameters ====
318
+
319
+ * <code>userId</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]'''
320
+
321
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object object]&gt;''' user object
322
+
323
+ === getCustomerNumber ===
324
+
325
+ Get customer a customer account
326
+
327
+ ==== Parameters ====
328
+
329
+ * <code>accountNumber</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]'''
330
+ * <code>campusCode</code> '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String string]'''
331
+
332
+ Returns '''[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]&lt;[https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object object]&gt;''' customer account object
@@ -0,0 +1,116 @@
1
+ -- Initialization data current as of 2019-07-08.
2
+ -- Latest backup of these tables should be the point of reference
3
+ -- for initialization after this date.
4
+
5
+ -- Initial data for the departments table was in a separate file, but we now
6
+ -- receive a feed from FAMIS instead.
7
+
8
+ INSERT INTO "codes" ("revenue", "expense", "sales") VALUES
9
+ ('0410', '5683', 'false'),
10
+ ('0420', '5670', 'false'),
11
+ ('0422', '4013', 'true'),
12
+ ('0435', '5810', 'true'),
13
+ ('0443', '5864', 'false'),
14
+ ('0441', '5864', 'false'),
15
+ ('0496', '5670', 'false'),
16
+ ('0499', '4013', 'false'),
17
+ ('0522', '4025', 'true'),
18
+ ('0523', '4012', 'true'),
19
+ ('0525', '4075', 'true'),
20
+ ('0526', '4075', 'true'),
21
+ ('0556', '4040', 'false'),
22
+ ('0596', '5610', 'false'),
23
+ ('0602', '5670', 'false'),
24
+ ('0603', '5654', 'false'),
25
+ ('0609', '5684', 'false'),
26
+ ('0616', '5619', 'false'),
27
+ ('0620', '5670', 'false'),
28
+ ('0638', '5665', 'false'),
29
+ ('0655', '5654', 'false');
30
+
31
+ INSERT INTO "system" ("name", "due", "fein", "agency", "checkAddress", "credit", "creditUrl", "creditFee", "part", "abbrev") VALUES
32
+ ('Texas A&M University System', 'ALL PAYMENTS ARE DUE WITHIN 30 DAYS OF RECEIPT OF INVOICE. Please make checks payable to Texas A&M University and reference the invoice number on the check.', '74‐6000531', '3711711711 000', 'Texas A&M University
33
+ Financial Management Operations
34
+ Attn: Sales & Receivables Department
35
+ 6000 TAMU
36
+ College Station, TX 77843‐6000', '1', 'https://fmo.tamu.edu/invoice-payment-02 ', 'Please note this includes a 2.75% non-refundable fee.', '01', 'TAMUS'),
37
+ ('Texas A&M University', 'ALL PAYMENTS ARE DUE WITHIN 30 DAYS OF RECEIPT OF INVOICE. Please make checks payable to Texas A&M University and reference the invoice number on the check.', '74-6000531', '3711711711 000', 'Texas A&M University
38
+ Financial Management Operations
39
+ Attn: Sales & Receivables Department
40
+ 6000 TAMU
41
+ College Station, TX 77843‐6000', '1', 'https://fmo.tamu.edu/invoice-payment-02 ', 'Please note this includes a 2.75% non-refundable fee.', '02', 'TAMU'),
42
+ ('Tarleton State University', NULL, NULL, NULL, NULL, '0', NULL, NULL, '04', 'TSU'),
43
+ ('Prairie View A&M University', NULL, NULL, NULL, NULL, '0', NULL, NULL, '05', 'PVAMU'),
44
+ ('Texas Agrilife Research', 'ALL PAYMENTS ARE DUE WITHIN 30 DAYS OF RECEIPT OF INVOICE. Please make checks payable to Texas A&M Agrilife Research and reference the invoice number on the check.', '74‐6000541', '35565565567', 'Texas A&M Agrilife Research
45
+ Attn: Banking & Receivables Department
46
+ PO BOX 10420
47
+ College Station, TX 77842', '0', NULL, NULL, '06', 'ALRSCH'),
48
+ ('Texas Agrilife Extension Service', NULL, NULL, NULL, NULL, '0', NULL, NULL, '07', 'ALEXT'),
49
+ ('Texas Engineering Extension Service', NULL, NULL, NULL, NULL, '0', NULL, NULL, '09', 'TEEX'),
50
+ ('Texas A&M University - Galveston', NULL, NULL, NULL, NULL, '0', NULL, NULL, '10', 'TAMUG'),
51
+ ('Texas Forest Service', NULL, NULL, NULL, NULL, '0', NULL, NULL, '11', 'TFS'),
52
+ ('Texas Transportation Institute', NULL, NULL, NULL, NULL, '0', NULL, NULL, '12', 'TTI'),
53
+ ('Texas A&M University - Corpus Christi', NULL, NULL, NULL, NULL, '0', NULL, NULL, '15', 'TAMUCC'),
54
+ ('Texas A&M International University', NULL, NULL, NULL, NULL, '0', NULL, NULL, '16', 'TAMIU'),
55
+ ('Texas A&M University - Kingsville', NULL, NULL, NULL, NULL, '0', NULL, NULL, '17', 'TAMUK'),
56
+ ('West Texas A&M University', NULL, NULL, NULL, NULL, '0', NULL, NULL, '18', 'WTAMU'),
57
+ ('TAMUS-HSC Baylor College of Dentistry', NULL, NULL, NULL, NULL, '0', NULL, NULL, '19', NULL),
58
+ ('Texas Veterinary Medical Diagnostic Lab', NULL, NULL, NULL, NULL, '0', NULL, NULL, '20', 'TVMDL'),
59
+ ('Texas A&M University - Commerce', NULL, NULL, NULL, NULL, '0', NULL, NULL, '21', 'TAMUC'),
60
+ ('Texas A&M University - Texarkana', NULL, NULL, NULL, NULL, '0', NULL, NULL, '22', 'TAMUT'),
61
+ ('TAMUS Health Science Center', 'ALL PAYMENTS ARE DUE WITHIN 30 DAYS OF RECEIPT OF INVOICE. Please make checks payable to Texas A&M Health Science Center and reference the invoice number on the check.', '74-2907553', '37097097093', 'Texas A&M Health Science Center
62
+ Financial Management Operations
63
+ Attn: Sales & Receivables Department
64
+ 6000 TAMU
65
+ College Station, TX 77843‐6000', '0', NULL, NULL, '23', 'SHSC'),
66
+ ('Texas A&M University - Central Texas', NULL, NULL, NULL, NULL, '0', NULL, NULL, '24', 'TAMUCT'),
67
+ ('Texas A&M University - San Antonio', NULL, NULL, NULL, NULL, '0', NULL, NULL, '25', 'TAMUSA'),
68
+ ('RELLIS', NULL, NULL, NULL, NULL, '0', NULL, NULL, '26', 'RELLIS'),
69
+ ('Texas Engineering Experiment Station', 'ALL PAYMENTS ARE DUE WITHIN 30 DAYS OF RECEIPT OF INVOICE. Please make checks payable to Texas A&M Engineering Experiment Station and reference the invoice number on the check.', '74-1974733', '37127127126 000', 'Texas A&M Engineering Experiment Station
70
+ Attn: Business Office
71
+ 3124 TAMU
72
+ College Station, TX 77843', '0', NULL, NULL, '28', 'TEES'),
73
+ ('Research Foundation', NULL, NULL, NULL, NULL, '0', NULL, NULL, '99', 'RF');
74
+
75
+ INSERT INTO "cores" ("facility", "contact", "contactEmail", "coreEmail", "corePhone", "coreAddress", "account", "systemId", "enabled") VALUES
76
+ ('Molecular Genomics Workspace', 'Cody Holland', 'cholland@cvm.tamu.edu', NULL, NULL, NULL, '0620312396310', 5, '0'),
77
+ ('IBT Center for Advanced Imaging Core', 'Candida DuBose', 'cdubose@medicine.tamhsc.edu', NULL, NULL, NULL, '2321234000000', 19, '0'),
78
+ ('IBT High Throughput Research and Screening Center Core', 'Candida DuBose', 'cdubose@medicine.tamhsc.edu', NULL, NULL, NULL, '2321043050000', 19, '0'),
79
+ ('IBT Flow Cytometry Analysis and Cell Sorting Core', 'Candida DuBose', 'cdubose@medicine.tamhsc.edu', NULL, NULL, NULL, '2328020000000', 19, '0'),
80
+ ('Geochemical Environmental Research Group (GERG)', 'Michelle Jeter', 'mjeter@tamu.edu', NULL, NULL, NULL, NULL, 2, '0'),
81
+ ('Microscopy and Imaging Center (MIC)', 'Aimee Curington', 'acurington@tamu.edu', 'microscopy@tamu.edu', NULL, NULL, '0227053000000', 2, '1'),
82
+ ('Materials Characterization Facility (MCF)', 'Rene Yeargan-Stutt', 'ryeargan@tamu.edu', NULL, NULL, NULL, '0227105000000', 2, '0'),
83
+ ('Protein Chemistry Laboratory', 'Virginia Johnson', 'jinny@tamu.edu', NULL, NULL, NULL, '0227102010000', 2, '0'),
84
+ ('Integrated Metabolics Analysis Core', 'Cory Klemasherich', 'klem24@tamu.edu', NULL, NULL, NULL, '0227102050000', 2, '0'),
85
+ ('Systems & Synthetic Biology Innovation Lab', 'Linda Brochu', 'l-brochu@tamu.edu', NULL, NULL, NULL, NULL, 2, '0'),
86
+ ('Nuclear Science Center', 'Peggy Rutkowski', 'peggyr@tamu.edu', NULL, NULL, NULL, '2828069000000', 23, '0'),
87
+ ('ILSB Biological MS Lab', 'Ronald G. Carter', 'r-carter@tamu.edu', NULL, NULL, NULL, NULL, 2, '0'),
88
+ ('CVM Flow Cytometry Core Facility', 'Cody Holland', 'cholland@cvm.tamu.edu', NULL, NULL, NULL, '0620312384090', 5, '0'),
89
+ ('Biomedical Engineering Shared Laboratories', 'Michelle Mitchell', 'mitchellm@tamu.edu', NULL, NULL, NULL, '2823313100000', 23, '0'),
90
+ ('NMR Facility', 'Ronald G. Carter', 'r-carter@tamu.edu', NULL, NULL, NULL, '0227192000000', 2, '0'),
91
+ ('AggieFab Nanofabrication Facility', 'Chelsey Michalasky', 'cmichalsky@tamu.edu', NULL, NULL, NULL, '2827006000000', 23, '0'),
92
+ ('Mechanical Engineering Shared Service Facility', 'Amy Caldwell', 'amy@tamu.edu', NULL, NULL, NULL, '0227061000000', 2, '0'),
93
+ ('COM Cell Analysis Facility (COM-CAF)', 'Paula McCarver', 'pmccarver@medicine.tamhsc.edu', NULL, NULL, NULL, NULL, 19, '0'),
94
+ ('Core for Integrated Microbiota Research', 'Paula McCarver', 'pmccarver@medicine.tamhsc.edu', NULL, NULL, NULL, NULL, 19, '0'),
95
+ ('Crop Genome Editing Laboratory at Center', 'Dana McMahon', 'Mcmahon.dana@tamu.edu', NULL, NULL, NULL, NULL, 2, '0'),
96
+ ('Soft Matter Facility', 'Andrea Raines', 'araines@tamu.edu', NULL, NULL, NULL, '2827144000000', 23, '0'),
97
+ ('Image Analysis laboratory', 'Cody Holland', 'cholland@cvm.tamu.edu', NULL, NULL, NULL, '0227106000000', 2, '0');
98
+
99
+ INSERT INTO "users" ("userId", "admin") VALUES
100
+ ('6e9a47818957f1ad5b2b028022a56339', 'true'),
101
+ ('103308479281204c4d6e52960afb0192', 'false'),
102
+ ('63f2ac72d8bfc2a62f3976cc104a04d5', 'false'),
103
+ ('30a175d50a10984baf7fa07c9617400e', 'false'),
104
+ ('1bd645107a1b040cd187591af43a2680', 'false'),
105
+ ('b57a2dddc6c877178e3159ab39a764e8', 'false');
106
+
107
+ INSERT INTO "user_cores" ("coreId", "userId", "email") VALUES
108
+ (6, 2, 'true'),
109
+ (3, 5, 'true'),
110
+ (3, 6, 'true');
111
+
112
+ INSERT INTO "user_systems" ("systemId", "userId", "email") VALUES
113
+ (2, 3, 'true'),
114
+ (2, 4, 'true'),
115
+ (19, 3, 'true'),
116
+ (19, 4, 'true');
@@ -0,0 +1,29 @@
1
+ BEGIN TRANSACTION;
2
+ ALTER TABLE invoices ADD COLUMN IF NOT EXISTS "postedDate" date;
3
+ ALTER TABLE invoices ADD COLUMN IF NOT EXISTS emailed boolean DEFAULT FALSE NOT NULL;
4
+ UPDATE invoices
5
+ SET
6
+ "postedDate" = '2019-05-29',
7
+ emailed = True
8
+ WHERE date = '2019-05-06';
9
+ END TRANSACTION;
10
+
11
+ BEGIN TRANSACTION;
12
+ DO $$
13
+ BEGIN
14
+ IF EXISTS(SELECT *
15
+ FROM information_schema.columns
16
+ WHERE table_name='cores' and column_name='email')
17
+ THEN
18
+ ALTER TABLE cores RENAME COLUMN email TO "contactEmail";
19
+ END IF;
20
+ END $$;
21
+ ALTER TABLE cores ADD COLUMN IF NOT EXISTS "coreEmail" character varying(255);
22
+ ALTER TABLE cores ADD COLUMN IF NOT EXISTS "corePhone" character varying(255);
23
+ ALTER TABLE cores ADD COLUMN IF NOT EXISTS "coreAddress" text;
24
+ UPDATE cores SET "coreEmail" = 'microscopy@tamu.edu' WHERE id = 6;
25
+ END TRANSACTION;
26
+
27
+ INSERT INTO departments (part, code, sub, name, email)
28
+ VALUES ('15', 'CTCS', NULL, 'CENTER FOR COASTAL STUDIES', 'lisa.garza@tamucc.edu'),
29
+ ('20', 'VMDL', NULL, 'Texas A&M Veterinary Medical Diagnostic Laboratory', 'vseidel@tvmdl.tamu.edu');
@@ -0,0 +1,51 @@
1
+ BEGIN TRANSACTION;
2
+ CREATE TABLE IF NOT EXISTS public.force_ar (
3
+ id integer GENERATED ALWAYS AS IDENTITY,
4
+ part character varying(2) NOT NULL,
5
+ "beginRange" integer NOT NULL,
6
+ "endRange" integer NOT NULL,
7
+ PRIMARY KEY("id")
8
+ );
9
+ CREATE INDEX IF NOT EXISTS force_ar_part ON public.force_ar USING btree ("part");
10
+ ALTER TABLE public.force_ar OWNER TO dba;
11
+ GRANT SELECT ON public.force_ar TO famis;
12
+ END TRANSACTION;
13
+
14
+ BEGIN TRANSACTION;
15
+ UPDATE public."system"
16
+ SET
17
+ name = 'RELLIS',
18
+ abbrev = 'RELLIS'
19
+ WHERE part = '26';
20
+ UPDATE public."system"
21
+ SET
22
+ abbrev = 'RF'
23
+ WHERE part = '99';
24
+ UPDATE public.cores
25
+ SET
26
+ "systemId" = 19
27
+ WHERE id = 2 OR id = 3 OR id = 4;
28
+ END TRANSACTION;
29
+
30
+ -- unique constraints for each user+core or user+system pair
31
+ BEGIN TRANSACTION;
32
+ CREATE UNIQUE INDEX IF NOT EXISTS "user_cores_coreId_userId" ON user_cores ("coreId", "userId");
33
+ CREATE UNIQUE INDEX IF NOT EXISTS "user_systems_systemId_userId" ON user_systems ("systemId", "userId");
34
+ END TRANSACTION;
35
+
36
+ BEGIN TRANSACTION;
37
+ INSERT INTO public."users" ("userId", "admin") VALUES
38
+ ('1bd645107a1b040cd187591af43a2680', 'false'),
39
+ ('b57a2dddc6c877178e3159ab39a764e8', 'false')
40
+ ON CONFLICT DO NOTHING;
41
+
42
+ -- If these are already present, this transaction will be rolled back (due
43
+ -- to above unique index).
44
+ INSERT INTO "user_cores" ("coreId", "userId", "email") VALUES
45
+ (3, 5, 'true'),
46
+ (3, 6, 'true');
47
+
48
+ INSERT INTO public."user_systems" ("systemId", "userId", "email") VALUES
49
+ (19, 3, 'true'),
50
+ (19, 4, 'true');
51
+ END TRANSACTION;
@@ -0,0 +1,40 @@
1
+ BEGIN TRANSACTION;
2
+ CREATE TABLE IF NOT EXISTS public.core_accounts (
3
+ id integer GENERATED ALWAYS AS IDENTITY,
4
+ "coreId" integer NOT NULL,
5
+ account character varying(13) NOT NULL,
6
+ effective date NOT NULL,
7
+ PRIMARY KEY("id")
8
+ );
9
+ CREATE INDEX IF NOT EXISTS core_accounts_core_id ON public.core_accounts USING btree ("coreId");
10
+ ALTER TABLE public.core_accounts OWNER TO dba;
11
+ GRANT SELECT ON public.core_accounts TO famis;
12
+ END TRANSACTION;
13
+
14
+ BEGIN TRANSACTION;
15
+ INSERT INTO public.core_accounts ("coreId", account, effective)
16
+ SELECT id, account, '2019-05-01'
17
+ FROM cores
18
+ WHERE
19
+ account IS NOT NULL
20
+ AND NOT EXISTS (
21
+ SELECT 1 FROM public.core_accounts
22
+ );
23
+ END TRANSACTION;
24
+
25
+ BEGIN TRANSACTION;
26
+ UPDATE public.cores SET
27
+ "contactEmail" = 'cdubose@tamu.edu',
28
+ "enabled" = '1',
29
+ "coreEmail" = 'cdubose@tamu.edu',
30
+ "corePhone" = '(713) 677-7461'
31
+ WHERE id = '3';
32
+
33
+ UPDATE public.system SET agency = '37097097093 000' WHERE id = '19';
34
+
35
+ INSERT INTO public.core_accounts ("coreId", "account", "effective")
36
+ SELECT '3', '2371202802700', '2019-09-01'
37
+ WHERE NOT EXISTS (
38
+ SELECT 1 FROM public.core_accounts WHERE "coreId" = '3' AND account = '2371202802700' AND effective = '2019-09-01'
39
+ );
40
+ END TRANSACTION;