Skip to content

Commit

Permalink
Adding comment api
Browse files Browse the repository at this point in the history
  • Loading branch information
maso committed Nov 7, 2017
1 parent 22bf9b6 commit 4ab4ab9
Show file tree
Hide file tree
Showing 6 changed files with 511 additions and 110 deletions.
66 changes: 0 additions & 66 deletions src/Tenant/Views/Comments.php

This file was deleted.

1 change: 1 addition & 0 deletions src/Tenant/Views/Invoices.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@
*/
class Tenant_Views_Invoices
{
// TODO: maso, 2017: adding payment
}
28 changes: 0 additions & 28 deletions src/Tenant/Views/Tickets.php

This file was deleted.

76 changes: 61 additions & 15 deletions src/Tenant/urls.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,48 +133,94 @@
* Comments of ticket
*/
array(
'regex' => '#^/current/ticket/(?P<tecket_id>\d+)/comment/find$#',
'model' => 'Tenant_Views_Ticket',
'method' => 'findComments',
'regex' => '#^/current/ticket/(?P<parentId>\d+)/comment/find$#',
'model' => 'Pluf_Views',
'method' => 'findManyToOne',
'http-method' => 'GET',
'precond' => array(
'Pluf_Precondition::ownerRequired'
),
'params' => array(
'model' => 'Tenant_Comment',
'parent' => 'Tenant_Ticket',
'parentKey' => 'ticket',
'listFilters' => array(
'status',
'type',
'requester'
),
'listDisplay' => array(),
'searchFields' => array(
'subject',
'description'
),
'sortFields' => array(
'id',
'status',
'type',
'modif_dtime',
'creation_dtime'
),
'sortOrder' => array(
'id',
'DESC'
)
)
),
array(
'regex' => '#^/current/ticket/(?P<tecket_id>\d+)/comment/new$#',
'model' => 'Tenant_Views_Ticket',
'method' => 'createComments',
'regex' => '#^/current/ticket/(?P<parentId>\d+)/comment/new$#',
'model' => 'Pluf_Views',
'method' => 'createManyToOne',
'http-method' => 'POST',
'precond' => array(
'Pluf_Precondition::ownerRequired'
),
'params' => array(
'model' => 'Tenant_Comment',
'parent' => 'Tenant_Ticket',
'parentKey' => 'ticket'
)
),
array(
'regex' => '#^/current/ticket/(?P<tecket_id>\d+)/comment/(?P<comment_id>\d+)$#',
'model' => 'Tenant_Views_Ticket',
'method' => 'get',
'regex' => '#^/current/ticket/(?P<parentId>\d+)/comment/(?P<modelId>\d+)$#',
'model' => 'Pluf_Views',
'method' => 'getManyToOne',
'http-method' => 'GET',
'precond' => array(
'Pluf_Precondition::ownerRequired'
),
'params' => array(
'model' => 'Tenant_Comment',
'parent' => 'Tenant_Ticket',
'parentKey' => 'ticket'
)
),
array(
'regex' => '#^/current/ticket/(?P<tecket_id>\d+)/comment/(?P<comment_id>\d+)$#',
'model' => 'Tenant_Views_Ticket',
'method' => 'get',
'regex' => '#^/current/ticket/(?P<parentId>\d+)/comment/(?P<modelId>\d+)$#',
'model' => 'Pluf_Views',
'method' => 'updateManyToOne',
'http-method' => 'POST',
'precond' => array(
'Pluf_Precondition::ownerRequired'
),
'params' => array(
'model' => 'Tenant_Comment',
'parent' => 'Tenant_Ticket',
'parentKey' => 'ticket'
)
),
array(
'regex' => '#^/current/ticket/(?P<tecket_id>\d+)/comment/(?P<comment_id>\d+)$#',
'model' => 'Tenant_Views_Ticket',
'method' => 'get',
'regex' => '#^/current/ticket/(?P<parentId>\d+)/comment/(?P<modelId>\d+)$#',
'model' => 'Pluf_Views',
'method' => 'deleteManyToOne',
'http-method' => 'DELETE',
'precond' => array(
'Pluf_Precondition::ownerRequired'
),
'params' => array(
'model' => 'Tenant_Comment',
'parent' => 'Tenant_Ticket',
'parentKey' => 'ticket'
)
),

Expand Down
Loading

0 comments on commit 4ab4ab9

Please sign in to comment.