Commit graph

3860 commits

Author SHA1 Message Date
Lance Edgar b69785f5be Add initial importers for new/final importing framework
Er, hopefully final.  This one gets test coverage at least, hopefully
that makes it official.
2016-05-11 17:23:36 -05:00
Lance Edgar ff3e66ef82 Update changelog 2016-05-11 13:49:30 -05:00
Lance Edgar 453955dd4b Update changelog 2016-05-11 13:46:17 -05:00
Lance Edgar 98d46b2a2b Add tests for previous changes 2016-05-11 12:34:48 -05:00
Lance Edgar abd7a70a6b Refactor "record changes" mechanism to allow custom behavior
This adds some extra kwargs to both the `db.Session` class and the
`db.changes.record_changes()` function.
2016-05-11 12:33:20 -05:00
Lance Edgar 9b742751cd Tweak Person.emails and Person.phones relationships 2016-05-11 12:32:35 -05:00
Lance Edgar df39d271b7 Grow size of "change key" columns to 255 chars
No reason to limit this really, and extra padding is already needed.
This also adds the `object_key` synonym for `Change.instance_uuid`.
2016-05-11 12:31:30 -05:00
Lance Edgar f954ee1eb7 Remove unused 'ignore role changes' flag for data change recorder
Datasync consumers (and similar) are welcome to ignore whatever changes
they like.
2016-05-10 16:32:23 -05:00
Lance Edgar f248521a27 Update changelog 2016-05-07 11:59:13 -05:00
Lance Edgar e516d078bd Fix bug when importing new Employee record
New record doesn't have a proper `person` reference yet, so must flush
session to establish that.
2016-05-07 11:57:36 -05:00
Lance Edgar 864dfba6a4 Update changelog 2016-05-06 11:34:43 -05:00
Lance Edgar 4cae697b67 Remove alembic import from db.util module
Also bump the alembic version requirement, to ensure support for
multiple migration bases.
2016-05-05 16:52:55 -05:00
Lance Edgar a648c74e24 Update changelog 2016-05-05 16:28:40 -05:00
Lance Edgar 9cb7ff9068 Make 'tests' a proper subpackage again; add some tests
Trying to make more of an effort here...
2016-05-04 16:30:27 -05:00
Lance Edgar 17bdc68680 Refactor scheduled/worked shift models to share some logic 2016-05-03 21:20:23 -05:00
Lance Edgar 1bed40151d Update changelog 2016-05-03 14:42:21 -05:00
Lance Edgar 457d20862c Fix bug in format_phone_number() function
Need to always return the original if we can't format it.
2016-05-03 14:40:53 -05:00
Lance Edgar f639ff2a7d Update changelog 2016-05-03 10:46:14 -05:00
Lance Edgar 9a26fc0324 Refactor where phone number normalization logic lives
Just so that can be shared more easily.
2016-05-03 10:43:28 -05:00
Lance Edgar 296a96be69 Add --timeout arg support to datasync wait command
Hopefully this works right, we'll see.
2016-05-02 16:57:07 -05:00
Lance Edgar 5a4a86d8f7 Fix line endings for email templates
Er, I guess...
2016-05-02 16:56:44 -05:00
Lance Edgar e3a3361f02 Update changelog 2016-05-02 15:19:17 -05:00
Lance Edgar 038263af98 Add support for 'normalized_number' field in phone importer
Sometimes we have to use this number as part of the import key.
2016-05-02 13:46:23 -05:00
Lance Edgar 4ea53b3b27 Rename ImportSubcommand => OldImportSubcommand
Once that propagates to all projects, we can reclaim `ImportSubcommand`
for the new command.
2016-05-02 12:55:54 -05:00
Lance Edgar 50eab3eac7 Add .gitattributes file to enforce DOS line endings for mail templates 2016-05-01 20:38:00 -05:00
Lance Edgar 63d05dbaf0 Add basic user feedback email template 2016-05-01 20:36:17 -05:00
Lance Edgar 7574134ddf Update changelog 2016-04-29 15:40:56 -05:00
Lance Edgar f7884ab76d Add empty Watcher.process_changes() method for datasync
Just to avoid having to provide that when "consuming self" but not
actually doing anything.
2016-04-29 15:01:15 -05:00
Lance Edgar c12f5ed344 Update changelog 2016-04-28 18:34:18 -05:00
Lance Edgar 6ae5bd11f0 Add ScheduledShift model to schema
Also add some convenience methods to `WorkedShift`, for time sheet display.
2016-04-28 18:13:54 -05:00
Lance Edgar 7883fe1d5e Add time.get_sunday() convenience function 2016-04-28 18:12:28 -05:00
Lance Edgar d805698af0 Add RattailConfig.workdir() convenience method 2016-04-28 18:10:23 -05:00
Lance Edgar 4a72bf6927 Update changelog 2016-04-26 14:29:43 -05:00
Lance Edgar 17eebdee7d Tweak default behavior for importer-based datasync consumer
Add `host_object` kwarg to `process_change()` method; make that and the
`invoke_importer()` method return the (final) local object where
relevant/possible.
2016-04-26 14:27:22 -05:00
Lance Edgar ad9ef92b9e Update changelog 2016-04-26 12:59:50 -05:00
Lance Edgar 8bf65d286d Tweak when we add new data instance to session, to avoid premature flushes 2016-04-26 12:58:42 -05:00
Lance Edgar 9db47cc5b0 Update changelog 2016-04-25 19:48:01 -05:00
Lance Edgar f528e871b1 Add bulk Rattail importer, plus various tweaks
Tweaks are mostly for the sake of a `host_session`, if one is involved.
2016-04-25 19:39:03 -05:00
Lance Edgar d4707a80cc Add WorkedShift data model to schema, importer 2016-04-25 19:37:59 -05:00
Lance Edgar 176fb8e4c1 Update changelog 2016-04-24 17:29:44 -05:00
Lance Edgar 3459876c00 Add invoke_importer() method to datasync import consumers
Also tweak `process_change()` to allow caller to specify host data.
2016-04-23 20:11:35 -05:00
Lance Edgar 0099e54bc1 Fix setup bug in bulk Postgres importer 2016-04-23 16:00:13 -05:00
Lance Edgar cc5840deb4 Add initial begin/rollback/commit abstraction to import handlers
Hopefully lets each handler define local/host behavior as needed.
2016-04-22 18:35:02 -05:00
Lance Edgar 8adc8caf4e Alter make_utc() function to allow returning zone-aware time 2016-04-22 17:20:27 -05:00
Lance Edgar 82c3e173bb Add data kwarg to Importer.cache_instance_data() method
This was needed for a POS transaction importer, so it could auto-filter
local data based on date range which was derived from host data.
2016-04-21 22:39:55 -05:00
Lance Edgar 5c28719f8b Provide method by which importers may prevent create/update/delete
One needn't pass flags on command line to invoke default behavior.
2016-04-21 22:38:49 -05:00
Lance Edgar 295f2d53c4 Add multi-batch change transaction support for datasync consumers
Otherwise it was possible for the rattail transaction to fall out of
sync from consumer, if it was committing more often than us.
2016-04-21 19:26:28 -05:00
Lance Edgar d7cb42a98b Add RattailConfig.production() method
Convenience to differentiate when running in production mode.
2016-04-21 17:51:39 -05:00
Lance Edgar 5db81bfe79 Add --start-date and --end-date args to importer command
Also stash the args in the importer, so extra args are always available.
2016-04-21 17:36:47 -05:00
Lance Edgar a3c4921270 Add base importer and handler for PostgreSQL "bulk copy" importing 2016-04-21 13:41:43 -05:00