| 1 | package Net::Journyx::Subcode; | ||
| 2 | use Moose; | ||
| 3 | extends 'Net::Journyx::Code'; | ||
| 4 | |||
| 5 | use constant jx_record_class => 'SubcodeRecord'; | ||
| 6 | use constant jx_meta => { | ||
| 7 | defaults => 'getDefaultSubcode', | ||
| 8 | load => 'getSubcode', | ||
| 9 | update => { | ||
| 10 | operation => 'modifySubcode', | ||
| 11 | leading => 'id', | ||
| 12 | leading_argname => 'id', | ||
| 13 | record_argname => 'rec', | ||
| 14 | }, | ||
| 15 | create => { | ||
| 16 | operation => 'addFullSubcode', | ||
| 17 | # According to WSDL file addSubcode takes 'name' and CodeRecord has pretty_name column, | ||
| 18 | # but we get the following error: | ||
| 19 | # There are problems with 1 columns in your record: | ||
| 20 | # The column codes_tasks.pname is not allowed to have the null value. [] | ||
| 21 | # | ||
| 22 | # Let's disable quick create | ||
| 23 | # quick => { | ||
| 24 | # operation => 'addSubcode', | ||
| 25 | # columns => [qw(pretty_name)], | ||
| 26 | # rewrite => { pretty_name => 'name' }, | ||
| 27 | # } | ||
| 28 | }, | ||
| 29 | delete => { | ||
| 30 | operation => 'removeSubcode', | ||
| 31 | leading => 'id', | ||
| 32 | leading_argname => 'id', | ||
| 33 | }, | ||
| 34 | }; | ||
| 35 | |||
| 36 | 1; |