diff --git a/docker-run.sh b/docker-run.sh
index 0ef8a1e..decf9a6 100755
--- a/docker-run.sh
+++ b/docker-run.sh
@@ -8,7 +8,7 @@ docker rm -f nextcloud
docker run -d --name=nextcloud -p 8080:80 -v "${PWD}:/var/www/html/custom_apps/upschooling" docker.io/nextcloud
docker exec nextcloud chown -R 33 /var/www/html/custom_apps
docker exec nextcloud chmod -R ug+rw /var/www/html/custom_apps
-docker exec --user 33 nextcloud bash -c 'cd /var/www/html/custom_apps/upschooling && make'
+docker exec --user 33 nextcloud bash -c 'cd /var/www/html/custom_apps/upschooling && make composer'
docker exec --user 33 nextcloud php occ maintenance:install --database "sqlite" --admin-user "admin" --admin-pass "admin"
docker exec --user 33 nextcloud php occ config:system:set --value=true --type=boolean debug
docker exec --user 33 nextcloud php occ app:enable --force upschooling
diff --git a/lib/Controller/NoteApiController.php b/lib/Controller/TicketApiController.php
similarity index 91%
rename from lib/Controller/NoteApiController.php
rename to lib/Controller/TicketApiController.php
index 1667bba..d2a9d6f 100644
--- a/lib/Controller/NoteApiController.php
+++ b/lib/Controller/TicketApiController.php
@@ -3,13 +3,13 @@
namespace OCA\UPschooling\Controller;
use OCA\UPschooling\AppInfo\Application;
-use OCA\UPschooling\Service\NoteService;
+use OCA\UPschooling\Service\TicketService;
use OCP\AppFramework\ApiController;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;
-class NoteApiController extends ApiController {
- /** @var NoteService */
+class TicketApiController extends ApiController {
+ /** @var TicketService */
private $service;
/** @var string */
@@ -18,7 +18,7 @@ class NoteApiController extends ApiController {
use Errors;
public function __construct(IRequest $request,
- NoteService $service,
+ TicketService $service,
$userId) {
parent::__construct(Application::APP_ID, $request);
$this->service = $service;
diff --git a/lib/Controller/NoteController.php b/lib/Controller/TicketController.php
similarity index 90%
rename from lib/Controller/NoteController.php
rename to lib/Controller/TicketController.php
index 4c37699..2b3b55f 100644
--- a/lib/Controller/NoteController.php
+++ b/lib/Controller/TicketController.php
@@ -3,13 +3,13 @@
namespace OCA\UPschooling\Controller;
use OCA\UPschooling\AppInfo\Application;
-use OCA\UPschooling\Service\NoteService;
+use OCA\UPschooling\Service\TicketService;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;
-class NoteController extends Controller {
- /** @var NoteService */
+class TicketController extends Controller {
+ /** @var TicketService */
private $service;
/** @var string */
@@ -18,7 +18,7 @@ class NoteController extends Controller {
use Errors;
public function __construct(IRequest $request,
- NoteService $service,
+ TicketService $service,
$userId) {
parent::__construct(Application::APP_ID, $request);
$this->service = $service;
diff --git a/lib/Db/Note.php b/lib/Db/Note.php
deleted file mode 100644
index 36e81a9..0000000
--- a/lib/Db/Note.php
+++ /dev/null
@@ -1,21 +0,0 @@
- $this->id,
- 'title' => $this->title,
- 'content' => $this->content
- ];
- }
-}
diff --git a/lib/Db/Ticket.php b/lib/Db/Ticket.php
new file mode 100644
index 0000000..04c0943
--- /dev/null
+++ b/lib/Db/Ticket.php
@@ -0,0 +1,27 @@
+ $this->id,
+ 'title' => $this->title,
+ 'description' => $this->description,
+ 'helperId' => $this->helperId,
+ 'dueDate' => $this->dueDate,
+ 'status' => $this->status,
+ ];
+ }
+}
diff --git a/lib/Db/NoteMapper.php b/lib/Db/TicketMapper.php
similarity index 85%
rename from lib/Db/NoteMapper.php
rename to lib/Db/TicketMapper.php
index bd3ae2a..1f985b2 100644
--- a/lib/Db/NoteMapper.php
+++ b/lib/Db/TicketMapper.php
@@ -8,19 +8,19 @@ use OCP\AppFramework\Db\QBMapper;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
-class NoteMapper extends QBMapper {
+class TicketMapper extends QBMapper {
public function __construct(IDBConnection $db) {
- parent::__construct($db, 'upschooling', Note::class);
+ parent::__construct($db, 'upschooling', Ticket::class);
}
/**
* @param int $id
* @param string $userId
- * @return Entity|Note
+ * @return Entity|Ticket
* @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException
* @throws DoesNotExistException
*/
- public function find(int $id, string $userId): Note {
+ public function find(int $id, string $userId): Ticket {
/* @var $qb IQueryBuilder */
$qb = $this->db->getQueryBuilder();
$qb->select('*')
diff --git a/lib/Service/NoteService.php b/lib/Service/TicketService.php
similarity index 89%
rename from lib/Service/NoteService.php
rename to lib/Service/TicketService.php
index 8f6e167..b2966f3 100644
--- a/lib/Service/NoteService.php
+++ b/lib/Service/TicketService.php
@@ -7,15 +7,15 @@ use Exception;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
-use OCA\UPschooling\Db\Note;
-use OCA\UPschooling\Db\NoteMapper;
+use OCA\UPschooling\Db\Ticket;
+use OCA\UPschooling\Db\TicketMapper;
-class NoteService {
+class TicketService {
- /** @var NoteMapper */
+ /** @var TicketMapper */
private $mapper;
- public function __construct(NoteMapper $mapper) {
+ public function __construct(TicketMapper $mapper) {
$this->mapper = $mapper;
}
@@ -46,7 +46,7 @@ class NoteService {
}
public function create($title, $content, $userId) {
- $note = new Note();
+ $note = new Ticket();
$note->setTitle($title);
$note->setContent($content);
$note->setUserId($userId);
diff --git a/src/App.vue b/src/App.vue
index dab9b22..b0b223d 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,215 +1,25 @@
-
-
-
-
-
-
- {{ t('upschooling', 'Cancel note creation') }}
-
-
- {{ t('upschooling', 'Delete note') }}
-
-
-
-
-
+
-
-
-
-
-
-
-
-
{{ t('upschooling', 'Create a note to get started') }}
-
+
diff --git a/src/Ticket.vue b/src/Ticket.vue
new file mode 100644
index 0000000..9afe299
--- /dev/null
+++ b/src/Ticket.vue
@@ -0,0 +1,59 @@
+
+
+
+
Ticket "ding"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/KeyValueTable.vue b/src/components/KeyValueTable.vue
new file mode 100644
index 0000000..8b90399
--- /dev/null
+++ b/src/components/KeyValueTable.vue
@@ -0,0 +1,63 @@
+
+
+
+
+ {{ key }} |
+ {{ value }} |
+
+
+
+
+ {{ key }} |
+ {{ value }} |
+
+
+
+
+
+
+
+
diff --git a/tests/Integration/NoteIntegrationTest.php b/tests/Integration/NoteIntegrationTest.php
index 6c71c42..1a73d07 100644
--- a/tests/Integration/NoteIntegrationTest.php
+++ b/tests/Integration/NoteIntegrationTest.php
@@ -7,9 +7,9 @@ use OCP\IRequest;
use PHPUnit\Framework\TestCase;
-use OCA\UPschooling\Db\Note;
-use OCA\UPschooling\Db\NoteMapper;
-use OCA\UPschooling\Controller\NoteController;
+use OCA\UPschooling\Db\Ticket;
+use OCA\UPschooling\Db\TicketMapper;
+use OCA\UPschooling\Controller\TicketController;
class NoteIntegrationTest extends TestCase {
private $controller;
@@ -30,13 +30,13 @@ class NoteIntegrationTest extends TestCase {
return $this->createMock(IRequest::class);
});
- $this->controller = $container->query(NoteController::class);
- $this->mapper = $container->query(NoteMapper::class);
+ $this->controller = $container->query(TicketController::class);
+ $this->mapper = $container->query(TicketMapper::class);
}
public function testUpdate() {
// create a new note that should be updated
- $note = new Note();
+ $note = new Ticket();
$note->setTitle('old_title');
$note->setContent('old_content');
$note->setUserId($this->userId);
@@ -44,7 +44,7 @@ class NoteIntegrationTest extends TestCase {
$id = $this->mapper->insert($note)->getId();
// fromRow does not set the fields as updated
- $updatedNote = Note::fromRow([
+ $updatedNote = Ticket::fromRow([
'id' => $id,
'user_id' => $this->userId
]);
diff --git a/tests/Unit/Controller/NoteApiControllerTest.php b/tests/Unit/Controller/NoteApiControllerTest.php
index 4c13eb6..83318ce 100644
--- a/tests/Unit/Controller/NoteApiControllerTest.php
+++ b/tests/Unit/Controller/NoteApiControllerTest.php
@@ -2,11 +2,11 @@
namespace OCA\UPschooling\Tests\Unit\Controller;
-use OCA\UPschooling\Controller\NoteApiController;
+use OCA\UPschooling\Controller\TicketApiController;
class NoteApiControllerTest extends NoteControllerTest {
public function setUp(): void {
parent::setUp();
- $this->controller = new NoteApiController($this->request, $this->service, $this->userId);
+ $this->controller = new TicketApiController($this->request, $this->service, $this->userId);
}
}
diff --git a/tests/Unit/Controller/NoteControllerTest.php b/tests/Unit/Controller/NoteControllerTest.php
index e96d660..bf4950a 100644
--- a/tests/Unit/Controller/NoteControllerTest.php
+++ b/tests/Unit/Controller/NoteControllerTest.php
@@ -8,8 +8,8 @@ use OCP\AppFramework\Http;
use OCP\IRequest;
use OCA\UPschooling\Service\NoteNotFound;
-use OCA\UPschooling\Service\NoteService;
-use OCA\UPschooling\Controller\NoteController;
+use OCA\UPschooling\Service\TicketService;
+use OCA\UPschooling\Controller\TicketController;
class NoteControllerTest extends TestCase {
protected $controller;
@@ -19,10 +19,10 @@ class NoteControllerTest extends TestCase {
public function setUp(): void {
$this->request = $this->getMockBuilder(IRequest::class)->getMock();
- $this->service = $this->getMockBuilder(NoteService::class)
+ $this->service = $this->getMockBuilder(TicketService::class)
->disableOriginalConstructor()
->getMock();
- $this->controller = new NoteController($this->request, $this->service, $this->userId);
+ $this->controller = new TicketController($this->request, $this->service, $this->userId);
}
public function testUpdate() {
diff --git a/tests/Unit/Service/NoteServiceTest.php b/tests/Unit/Service/NoteServiceTest.php
index 416a079..51af8c5 100644
--- a/tests/Unit/Service/NoteServiceTest.php
+++ b/tests/Unit/Service/NoteServiceTest.php
@@ -7,9 +7,9 @@ use PHPUnit\Framework\TestCase;
use OCP\AppFramework\Db\DoesNotExistException;
-use OCA\UPschooling\Db\Note;
-use OCA\UPschooling\Service\NoteService;
-use OCA\UPschooling\Db\NoteMapper;
+use OCA\UPschooling\Db\Ticket;
+use OCA\UPschooling\Service\TicketService;
+use OCA\UPschooling\Db\TicketMapper;
class NoteServiceTest extends TestCase {
private $service;
@@ -17,15 +17,15 @@ class NoteServiceTest extends TestCase {
private $userId = 'john';
public function setUp(): void {
- $this->mapper = $this->getMockBuilder(NoteMapper::class)
+ $this->mapper = $this->getMockBuilder(TicketMapper::class)
->disableOriginalConstructor()
->getMock();
- $this->service = new NoteService($this->mapper);
+ $this->service = new TicketService($this->mapper);
}
public function testUpdate() {
// the existing note
- $note = Note::fromRow([
+ $note = Ticket::fromRow([
'id' => 3,
'title' => 'yo',
'content' => 'nope'
@@ -36,7 +36,7 @@ class NoteServiceTest extends TestCase {
->will($this->returnValue($note));
// the note when updated
- $updatedNote = Note::fromRow(['id' => 3]);
+ $updatedNote = Ticket::fromRow(['id' => 3]);
$updatedNote->setTitle('title');
$updatedNote->setContent('content');
$this->mapper->expects($this->once())