IHTSDO / component-identifier-service-legacy

A REST Server for managing the generation and assignment of Terminology Component Identifiers.
Other
1 stars 4 forks source link

Clean service does not set comment and modification time for SCTIDs #9

Open apeteri opened 8 years ago

apeteri commented 8 years ago

See the following example from the audit table:

+------------+----------+-----------+-------------+------------+--------------------------------------+-----------+-----------------+---------------------+----------------+----------------------------------+-------+---------------------+---------------------+
| sctid      | sequence | namespace | partitionId | checkDigit | systemId                             | status    | author          | software            | expirationDate | comment                          | jobId | created_at          | modified_at         |
+------------+----------+-----------+-------------+------------+--------------------------------------+-----------+-----------------+---------------------+----------------+----------------------------------+-------+---------------------+---------------------+
| ...        |          |           |             |            |                                      |           |                 |                     |                |                                  |       |                     |                     |
| 6558562026 |  6558562 |         0 | 02          |          6 | 5c954079-7d72-220b-51db-1f676a2a4f72 | Reserved  | termserver-prod | Snow Owl Production | 2016-03-23     | Requested by Snow Owl Production |  NULL | 2016-03-22 00:40:34 | 2016-03-22 00:40:34 |
| 6558562026 |  6558562 |         0 | 02          |          6 | 5c954079-7d72-220b-51db-1f676a2a4f72 | Available | termserver-prod | Clean Service       | NULL           | Requested by Snow Owl Production |  NULL | 2016-03-22 00:40:34 | 2016-03-22 00:40:34 |
| ...        |          |           |             |            |                                      |           |                 |                     |                |                                  |       |                     |                     |
+------------+----------+-----------+-------------+------------+--------------------------------------+-----------+-----------------+---------------------+----------------+----------------------------------+-------+---------------------+---------------------+

CleanService wakes up in 24h intervals; it unsets the expiry date and sets Reserved status to Available, if the previous expiration date is after the current time, as specified in CleanService.js#34.

The UPDATE statement could be extended to include a different comment (including the expiry date which is being unset) and an updated modified_at timestamp, so we know when the service actually ran, and based on which expiration date it acted upon.