App-Dochazka-REST

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

- REST.pm: add some debug messages

0.171  2014-09-17 10:51 CEST
- REST.pm: fix bug 'Can't call method "errstr" on an undefined value' when
  connect_db_pristine can't connect to database; remove debug messages

0.172  2014-09-17 11:13 CEST
- t/001-init.t: bail out of testing if we cannot connect to database

0.173  2014-09-17 14:28 CEST
- REST.pm: expand INSTALLATION section of POD with explanation of how to test database
  connection using 'psql'

0.174  2014-09-24 16:38 CEST
- try to fix UTF-8 bug, but only make it worse

0.175  2014-09-25 09:29 CEST
- Resource.pm: encode response body in UTF-8 before sending it out on the line

0.176  2014-10-14 17:31 CEST
- Dispatch/: add some comments

Changes  view on Meta::CPAN

0.210  2014-10-24 15:33 CEST
- Hackweek Day 5
- implement privhistory resources using new development workflow
- merge 'privhistory/current' and 'privhistory/current/:tsrange' into a
  single resource 'privhistory/current/?:tsrange'
- dispatch/dispatch_Privhistory_Config.pm: put resources in alphabetical
  order; document resources; add more supported methods
- t/dispatch/privhistory: add privhistory tests in new structure
- Dispatch/Privhistory.pm: put targets in order according to their
  corresponding resources; rename _get_nick and _get_eid to _nick and _eid,
  respectively, and expand them to support PUT and DELETE
- Model/Privhistory.pm: add some debug messages

0.211  2014-10-24 22:40 CEST
- Hackweek Day 5, continued
- config/sql/dbinit_Config.pm: add UNIQUE (eid, effective) constraint to
  privhistory table to avoid duplicate entries in a given employee's
  privhistory listing
- dispatch_Message_en.conf: add DISPATCH_PRIVHISTORY_COULD_NOT_SPAWN
- Dispatch/Privhistory.pm: implement support for PUT and DELETE requests in
  _eid and _nick targets

Changes  view on Meta::CPAN

  documentation string

0.236  2014-10-31 21:29 CET
- Build.PL: require Pod::Simple::HTML (needed by 'docu/html' target)
- config/dispatch/: activate 'activity/aid' resource for POST; add '=pod' 
  line at top of documentation string on each resource; rename 'docu' target
  from '_help_post' to '_docu'; add 'docu/html' resource definition; convert
  some remaining documentation from HTML to POD
- Dispatch.pm: add a '_docu_html' target
- Dispatch/Activity.pm: adapt '_aid' target for POST
- Test.pm: expand 'docu_check' routine to cover 'docu/html' resource as well as
  straight 'docu'
- Util.pm: add a 'pod_to_html' conversion routine
- t/dispatch/activity.t: fill in remaining tests necessary to meet minimal
  workflow expectations
- t/dispatch/top.t: add battery of 'docu/html' tests, mostly plagiarized from
  'docu'

0.237  2014-11-01 14:11 CET
- rename Dispatch/Privhistory.pm to Dispatch/Priv.pm to match 'priv' resource

Changes  view on Meta::CPAN

  that attempt to insert intervals that conflict with a lock
- t/model/triggers: add new subdirectory for trigger tests
- t/model/triggers/immutable_id.t: new unit to test triggers that make ID
  fields immutable

0.307  2014-11-26 16:40 CET
- Model/: make 'update' methods return 'DOCHAZKA_ID_MISSING_IN_UPDATE' if id
  property missing
- Test.pm: add new 'gen_$class' multi-purpose routines
- t/model/general/id.t: use 'gen_$class' routines
- t/model/general/reset.t: expand to test 'reset' method in all classes

0.308  2014-11-27 11:11 CET
- Build.PL: require App::Dochazka 0.184 for 'attrs' and 'get' methods
- dbinit_Config.pm: add checks for presence of 'infinity' in tsranges
- Test.pm: bring in 'test_sql_success' and 'test_sql_failure' functions
  so we aren't duplicating them in the units
- t/model/employee.t: cleanup; eliminate some duplicated code (low-hanging
  fruit)
- t/model/general/reset.t: finishing touches
- t/sql/: cleanup

Changes  view on Meta::CPAN


0.310  2014-11-27 22:04 CET
- dbinit_Config.pm: add 'schedule_policy' trigger function to prevent users
  from introducing intervals in time periods when the employee has no or
  ambiguous scheduling
- t/dispatch/interval_lock.t: adapt to the above trigger (ensure testing user
  has a schedule and the schedule is in effect)
- t/: disable a bunch of tests broken by introduction of this trigger

0.311  2014-11-27 23:04 CET
- dbinit_Config.pm: expand no_lock_conflict to handle DELETE as well as INSERT/UPDATE
- t/model/{interval,lock}.t: adapt to current state
- t/model/lock.t: add test confirming that it is no longer possible to delete a
  locked interval

0.312  2014-11-28 11:27 CET
- t/dispatch/interval_lock.t: add some tests simulating: (1) create interval,
  (2) lock it, (3) attempt to update it - interval is locked, (4) attempt to
  delete it - interval is locked
- dbinit_Config.pm: add another trigger and run into problems because I didn't realize PostgreSQL
  executes triggers in alphabetical order

Changes  view on Meta::CPAN

- implement new resources:
  - GET employee/eid/:eid/minimal
  - GET employee/nick/:nick/minimal
  - GET employee/sec_id/:sec_id/minimal
- t/dispatch/employee.t: add some basic test cases for the new
  GET employee/.../minimal resources
- t/: adapt test suite to App::Dochazka::Common rename

0.470  2015-07-23 14:50 CEST
- t/dispatch/employee.t: disable tests that broke when employees were allowed to modify their email address
- t/201-LDAP.t: expanded tests
- ResourceDefs.pm: add employee/nick/:nick/ldap resource
- LDAP.pm: make ldap_search() look up a property; implement populate_employee()
- Dispatch.pm: add handler_get_employee_ldap() for GET employee/nick/:nick/ldap
- Auth.pm: populate certain employee attributes from LDAP upon successful LDAP autocreate
- REST_Config.pm: default value for DOCHAZKA_LDAP_POPULATE_MATRIX
- Build.PL: require App::Dochazka::Common 0.191 for "set()" method
- Dispatch.pm: increase granularity of employee/.../minimal ACL check
- No longer auto-generate Makefile.PL

0.471  2015-07-23 16:55 CEST

Changes  view on Meta::CPAN

- Util/Date.pm: implement calculate_hours() function
- Model/Activity.pm: implement code_by_aid() function
- Improve interval/summary/eid/:eid/:tsrange handling

0.516 2016-01-09 20:42 CET
- cleanup: merge Utils::Date into Utils::Holiday
- cleanup: move REST::Util::Holiday to REST::Holiday
- cleanup: refrain from using the /a modifier
- Component_Config.pm: enclose siteparam template in HTML 4.0
- doc: improve comments in Util.pm
- doc: expand documentation of genreport resource
- Model/Interval.pm: simplify interval summary data structure
- Dispatch.pm: require 'source', 'acl' properties for insert only
- t/dispatch/interval_lock.t: add interval/summary tests
- Implement feature "Component class: add validations property" (#54)
  - sql/component_Config.pm: add validations to SQL statements
  - sql/dbinit_Config.pm: add validations to components table
  - REST.pm->reset_db: add validations to SQL_COMPONENT_INSERT
  - Model/Component.pm: add validations property
  - t/dispatch/component.t: add validations property
  - Build.PL: require App::Dochazka::Common 0.199 for component validations

Changes  view on Meta::CPAN

- ResourceDefs: fix permissions on schedule/eid/:eid/?:ts
- Fillup: produce 100% schedule fulfillment without clobbering
- Fillup: return just scheduled intervals if clobber is true
- Model/Shared: make canonicalize_tsrange() fail on empty tsranges
- fillup: get conflicting intervals list in chronological order

0.553 2017-10-25 23:37 CEST
- WISHLIST: add "GET ldap/info"
- Dispatch: implement POST interval/scheduled
- Shared.pm: rip out dead code
- t/fillup.t: expand test coverage of Fillup
- Fix {priv,schedule}_change_during_range, {priv,sched}history_at_timestamp

0.554 2017-10-31 14:31 CET
- Fillup: return different code when dry_run is set
- tests: add 'interval/scheduled' coverage to t/dispatch/fillup.t
- Fillup: fix success and failure messages
- dbinit_Config: disallow modification of root supervisor field

0.555 2017-11-02 20:23 CET
- Model/Shared: introduce DOCHAZKA_SQL_TRACE to control SQL debugging info

ext/helpers/docgen.plx  view on Meta::CPAN

}

sub print_usage {
    print "Usage: perl bin/docgen.plx\n";
    print "(must be run from within App::Dochazka::REST distribution)\n";
}

sub print_documentation {
    my ( $fh, $resource ) = @_;

    my %no_expand_map = map { ( $_ => '' ) } @Web::MREST::InitRouter::non_expandable_properties;
    my $r = $resources->{$resource};

    print $fh "\n", "=head2 C<< $resource >>", "\n\n"; 
    
    # get allowed methods
    #
    my @am;
    foreach my $prop ( keys %$r ) {
        next if exists $no_expand_map{ $prop };
        push @am, $prop;
    }   

    print $fh $r->{'description'}, "\n";
    print $fh "=over\n\n";
    print $fh "Allowed methods: " . join( ', ', sort( @am ) ) . "\n\n";
    my $docs = $r->{'documentation'};
    $docs =~ s/=pod\n\n//;
    print $fh $docs, "\n";
    print $fh "\n=back\n";

lib/App/Dochazka/REST/Model/Schedule.pm  view on Meta::CPAN


=item * no overlapping entries are entered

=item * all the entries fall within a single 168-hour period

=item * all the times are evenly divisible by five minutes

=back

#
# FIXME: expand the trigger to check for "closed-open" C<< [ ..., ... ) >> tsrange
#

If the schedule is successfully inserted into C<schedintvls>, the next step is
to "translate", or convert, the individual intervals (expressed as tsrange
values) into the four-key hashes described in L<Schedules in the database>,
assemble the JSON string, and insert a new row in C<schedules>. 

To facilitate this conversion, a stored procedure C<translate_schedintvl> was
developed.



( run in 2.105 seconds using v1.01-cache-2.11-cpan-5b529ec07f3 )