From bbf6daf6cae996bfe6f0a535acf6490fed38dcab Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Mon, 11 Jun 2018 19:07:38 +0100 Subject: [PATCH] #47, #48, #49, #50: MY MONSTER IT LIVES Most of the forms of the admin user interface render and sort-of work. It needs polish - but it's a huge leap forward! --- resources/sql/queries.auto.sql | 6 +- .../templates/auto/application-index.html | 70 +- .../auto/form-addresses-Address.html | 70 +- .../auto/form-canvassers-Canvasser.html | 84 +- .../auto/form-districts-District.html | 70 +- .../auto/form-dwellings-Dwelling.html | 70 +- .../templates/auto/form-electors-Elector.html | 70 +- .../form-followupactions-Followupaction.html | 84 +- .../templates/auto/form-issues-Issue.html | 70 +- resources/templates/auto/form-roles-Role.html | 89 +- resources/templates/auto/form-teams-Team.html | 70 +- .../templates/auto/form-visits-Visit.html | 84 +- .../auto/list-addresses-Addresses.html | 109 +- .../auto/list-canvassers-Canvassers.html | 113 +- .../auto/list-districts-Districts.html | 99 +- .../auto/list-dwellings-Dwellings.html | 101 +- .../auto/list-electors-Electors.html | 107 +- .../list-followupactions-Followupactions.html | 107 +- .../templates/auto/list-issues-Issues.html | 101 +- .../templates/auto/list-roles-Roles.html | 99 +- .../templates/auto/list-teams-Teams.html | 105 +- .../templates/auto/list-visits-Visits.html | 103 +- .../templates/base-authenticated copy.html | 79 + .../{base-unauthenticated.html => base.html} | 3 +- src/clj/youyesyet/handler.clj | 10 +- src/clj/youyesyet/routes/auto.clj | 134 +- src/clj/youyesyet/routes/auto_json.clj | 1653 +++++++++++++++++ src/clj/youyesyet/routes/auto_json_routes.clj | 1035 ----------- src/clj/youyesyet/routes/manual.clj | 2 +- youyesyet.adl.xml | 3 + youyesyet.canonical.adl.xml | 5 +- 31 files changed, 3430 insertions(+), 1375 deletions(-) create mode 100644 resources/templates/base-authenticated copy.html rename resources/templates/{base-unauthenticated.html => base.html} (96%) create mode 100644 src/clj/youyesyet/routes/auto_json.clj delete mode 100644 src/clj/youyesyet/routes/auto_json_routes.clj diff --git a/resources/sql/queries.auto.sql b/resources/sql/queries.auto.sql index 0dd7351..16e3b9f 100644 --- a/resources/sql/queries.auto.sql +++ b/resources/sql/queries.auto.sql @@ -1,6 +1,6 @@ -- File queries.sql -- autogenerated by adl.to-hugsql-queries at --- 2018-06-11T00:58:48.917Z +-- 2018-06-11T15:50:04.238Z -- See [Application Description Language](https://github.com/simon-brooke/adl). @@ -495,8 +495,8 @@ ORDER BY canvassers.username, -- :doc links all existing canvasser records related to a given role SELECT * FROM canvassers -WHERE canvassers.roles = link_canvassers_roles.canvasser_id - AND link_canvassers_roles.role_id = :id +WHERE canvassers.roles = link_canvassers_.canvasser_id + AND link_canvassers_.role_id = :id ORDER BY canvassers.username, canvassers.fullname, canvassers.email, diff --git a/resources/templates/auto/application-index.html b/resources/templates/auto/application-index.html index ace787c..6311cdf 100644 --- a/resources/templates/auto/application-index.html +++ b/resources/templates/auto/application-index.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -202,3 +219,50 @@ Followupmethod
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/form-addresses-Address.html b/resources/templates/auto/form-addresses-Address.html index b07e39b..3fbf3ab 100644 --- a/resources/templates/auto/form-addresses-Address.html +++ b/resources/templates/auto/form-addresses-Address.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -230,3 +247,50 @@ To delete this addresses record
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/form-canvassers-Canvasser.html b/resources/templates/auto/form-canvassers-Canvasser.html index 97cbc37..8a975b9 100644 --- a/resources/templates/auto/form-canvassers-Canvasser.html +++ b/resources/templates/auto/form-canvassers-Canvasser.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -74,7 +91,12 @@ elector_id address_id {% ifwritable canvassers address_id %} - +
+ + +
{% else %} {% ifreadable canvassers address_id%} @@ -210,7 +232,12 @@ elector_id address_id {% ifwritable canvassers address_id %} - +
+ + +
{% else %} {% ifreadable canvassers address_id%} @@ -315,3 +342,50 @@ To delete this canvassers record
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/form-districts-District.html b/resources/templates/auto/form-districts-District.html index a70e74b..6755daa 100644 --- a/resources/templates/auto/form-districts-District.html +++ b/resources/templates/auto/form-districts-District.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -80,3 +97,50 @@ To delete this districts record
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/form-dwellings-Dwelling.html b/resources/templates/auto/form-dwellings-Dwelling.html index ea520e7..ab82225 100644 --- a/resources/templates/auto/form-dwellings-Dwelling.html +++ b/resources/templates/auto/form-dwellings-Dwelling.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -118,3 +135,50 @@ To delete this dwellings record
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/form-electors-Elector.html b/resources/templates/auto/form-electors-Elector.html index 7b0b158..099cd53 100644 --- a/resources/templates/auto/form-electors-Elector.html +++ b/resources/templates/auto/form-electors-Elector.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -210,3 +227,50 @@ To delete this electors record
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/form-followupactions-Followupaction.html b/resources/templates/auto/form-followupactions-Followupaction.html index 8143647..a82cce8 100644 --- a/resources/templates/auto/form-followupactions-Followupaction.html +++ b/resources/templates/auto/form-followupactions-Followupaction.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -46,7 +63,12 @@ request_id actor {% ifwritable followupactions actor %} - +
+ + +
{% else %} {% ifreadable followupactions actor%} @@ -135,7 +157,12 @@ request_id actor {% ifwritable followupactions actor %} - +
+ + +
{% else %} {% ifreadable followupactions actor%} @@ -202,3 +229,50 @@ To delete this followupactions record
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/form-issues-Issue.html b/resources/templates/auto/form-issues-Issue.html index 7bec673..1a33953 100644 --- a/resources/templates/auto/form-issues-Issue.html +++ b/resources/templates/auto/form-issues-Issue.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -121,3 +138,50 @@ To delete this issues record
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/form-roles-Role.html b/resources/templates/auto/form-roles-Role.html index 029740f..1d20938 100644 --- a/resources/templates/auto/form-roles-Role.html +++ b/resources/templates/auto/form-roles-Role.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -64,6 +81,25 @@ name {% endifreadable %} {% endifwritable %}

+

+ +{% ifwritable roles members %} +

+ + +
+{% else %} +{% ifreadable roles members%} + +{{record.members}} + +{% endifreadable %} +{% endifwritable %} +

{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/form-teams-Team.html b/resources/templates/auto/form-teams-Team.html index f81dbc7..e08105f 100644 --- a/resources/templates/auto/form-teams-Team.html +++ b/resources/templates/auto/form-teams-Team.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -193,3 +210,50 @@ To delete this teams record
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/form-visits-Visit.html b/resources/templates/auto/form-visits-Visit.html index 8b6c093..2c1ea30 100644 --- a/resources/templates/auto/form-visits-Visit.html +++ b/resources/templates/auto/form-visits-Visit.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -27,7 +44,12 @@ id address_id {% ifwritable visits address_id %} - +
+ + +
{% else %} {% ifreadable visits address_id%} @@ -88,7 +110,12 @@ id address_id {% ifwritable visits address_id %} - +
+ + +
{% else %} {% ifreadable visits address_id%} @@ -146,3 +173,50 @@ To delete this visits record
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/list-addresses-Addresses.html b/resources/templates/auto/list-addresses-Addresses.html index 0a62aa0..70aa63e 100644 --- a/resources/templates/auto/list-addresses-Addresses.html +++ b/resources/templates/auto/list-addresses-Addresses.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -37,25 +54,28 @@ longitude - + - + - + - + - + - + - + + + + @@ -84,32 +104,69 @@ longitude {{ record.longitude }} - + View {% endfor %} - - -{% if offset > 0 %} + -{% endif %} - + +
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/list-canvassers-Canvassers.html b/resources/templates/auto/list-canvassers-Canvassers.html index 1b78cb8..98c8b4a 100644 --- a/resources/templates/auto/list-canvassers-Canvassers.html +++ b/resources/templates/auto/list-canvassers-Canvassers.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -43,31 +60,34 @@ authorised - + - + - + - + - + - + - + - + - + + + + @@ -102,32 +122,69 @@ authorised {{ record.authorised }} - + View {% endfor %} - - -{% if offset > 0 %} + -{% endif %} - + +
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/list-districts-Districts.html b/resources/templates/auto/list-districts-Districts.html index 9b41182..3349092 100644 --- a/resources/templates/auto/list-districts-Districts.html +++ b/resources/templates/auto/list-districts-Districts.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -22,10 +39,13 @@ name - + - + + + + @@ -39,32 +59,69 @@ name {{ record.name }} - + View {% endfor %} - - -{% if offset > 0 %} + -{% endif %} - + +
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/list-dwellings-Dwellings.html b/resources/templates/auto/list-dwellings-Dwellings.html index c8e5600..7f39626 100644 --- a/resources/templates/auto/list-dwellings-Dwellings.html +++ b/resources/templates/auto/list-dwellings-Dwellings.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -25,13 +42,16 @@ sub-address - + - + - + + + + @@ -48,32 +68,69 @@ sub-address {{ record.sub-address }} - + View {% endfor %} - - -{% if offset > 0 %} + -{% endif %} - + +
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/list-electors-Electors.html b/resources/templates/auto/list-electors-Electors.html index ea6102b..da7d082 100644 --- a/resources/templates/auto/list-electors-Electors.html +++ b/resources/templates/auto/list-electors-Electors.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -34,22 +51,25 @@ gender - + - + - + - + - + - + + + + @@ -75,32 +95,69 @@ gender {{ record.gender }} - + View {% endfor %} - - -{% if offset > 0 %} + -{% endif %} - + +
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/list-followupactions-Followupactions.html b/resources/templates/auto/list-followupactions-Followupactions.html index d6ad6fb..6c587e6 100644 --- a/resources/templates/auto/list-followupactions-Followupactions.html +++ b/resources/templates/auto/list-followupactions-Followupactions.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -34,22 +51,25 @@ closed - + - + - + - + - + - + + + + @@ -75,32 +95,69 @@ closed {{ record.closed }} - + View {% endfor %} - - -{% if offset > 0 %} + -{% endif %} - + +
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/list-issues-Issues.html b/resources/templates/auto/list-issues-Issues.html index f72dafb..d1c9e43 100644 --- a/resources/templates/auto/list-issues-Issues.html +++ b/resources/templates/auto/list-issues-Issues.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -25,13 +42,16 @@ current - + - + - + + + + @@ -48,32 +68,69 @@ current {{ record.current }} - + View {% endfor %} - - -{% if offset > 0 %} + -{% endif %} - + +
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/list-roles-Roles.html b/resources/templates/auto/list-roles-Roles.html index 65b7e89..720443f 100644 --- a/resources/templates/auto/list-roles-Roles.html +++ b/resources/templates/auto/list-roles-Roles.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -22,10 +39,13 @@ name - + - + + + + @@ -39,32 +59,69 @@ name {{ record.name }} - + View {% endfor %} - - -{% if offset > 0 %} + -{% endif %} - + +
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/list-teams-Teams.html b/resources/templates/auto/list-teams-Teams.html index a9b805f..d3b6c19 100644 --- a/resources/templates/auto/list-teams-Teams.html +++ b/resources/templates/auto/list-teams-Teams.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -31,19 +48,22 @@ longitude - + - + - + - + - + + + + @@ -66,32 +86,69 @@ longitude {{ record.longitude }} - + View {% endfor %} - - -{% if offset > 0 %} + -{% endif %} - + +
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/auto/list-visits-Visits.html b/resources/templates/auto/list-visits-Visits.html index 7faee46..fd26cb1 100644 --- a/resources/templates/auto/list-visits-Visits.html +++ b/resources/templates/auto/list-visits-Visits.html @@ -1,7 +1,24 @@ -{% extends "templates/base.html" %} - - +{% block head %} + + + + + + + + + + + + + +{{site-title}}: {{title}} + + +{% endblock %} {% block content %}
@@ -28,16 +45,19 @@ date - + - + - + - + + + + @@ -57,32 +77,69 @@ date {{ record.date }} - + View {% endfor %} - - -{% if offset > 0 %} + -{% endif %} - + +
{% endblock %} +{% block foot %} + + + + + + A project of the + + +Radical Independence Campaign + + || + Version {{version}} + + + + +Built with + +LuminusWeb + + || + + + Powered by + +Clojure + + || + + +Find me/fork me on + +Github + + || + + +Licensed under the + +GNU General Public License version 2.0 + + + + + +{% endblock %} \ No newline at end of file diff --git a/resources/templates/base-authenticated copy.html b/resources/templates/base-authenticated copy.html new file mode 100644 index 0000000..22af08a --- /dev/null +++ b/resources/templates/base-authenticated copy.html @@ -0,0 +1,79 @@ + + + + + + + + + + {{title}} + + + {% block whole-page %} + {% block top %} +
+ + +

+ {{title}} +

+
+ {% endblock %} +
+ +
+ {% block content %} + {% endblock %} +
+ +
+ {% block foot %} + + {% endblock %} + {% endblock %} + + {% block extra-script %} + {% endblock %} + + + + + + diff --git a/resources/templates/base-unauthenticated.html b/resources/templates/base.html similarity index 96% rename from resources/templates/base-unauthenticated.html rename to resources/templates/base.html index 4e41c8f..cfb278f 100644 --- a/resources/templates/base-unauthenticated.html +++ b/resources/templates/base.html @@ -1,5 +1,6 @@ - + diff --git a/src/clj/youyesyet/handler.clj b/src/clj/youyesyet/handler.clj index 789564f..40f95cf 100644 --- a/src/clj/youyesyet/handler.clj +++ b/src/clj/youyesyet/handler.clj @@ -6,7 +6,8 @@ [youyesyet.routes.authenticated :refer [authenticated-routes]] [youyesyet.routes.home :refer [home-routes]] [youyesyet.routes.oauth :refer [oauth-routes]] - [youyesyet.routes.auto-json-routes :refer [auto-rest-routes]] + [youyesyet.routes.auto-json :refer [auto-rest-routes]] + [youyesyet.routes.auto :refer [auto-selmer-routes]] [compojure.route :as route] [youyesyet.env :refer [defaults]] [mount.core :as mount] @@ -67,6 +68,9 @@ (-> #'auto-rest-routes (wrap-routes middleware/wrap-csrf) (wrap-routes middleware/wrap-formats)) + (-> #'auto-selmer-routes + (wrap-routes middleware/wrap-csrf) + (wrap-routes middleware/wrap-formats)) #'oauth-routes #'authenticated-routes (route/not-found @@ -75,5 +79,5 @@ :title "page not found"}))))) -(def app #'app-routes) - ;;(middleware/wrap-base #'app-routes)) +(def app ;; #'app-routes) + (middleware/wrap-base #'app-routes)) diff --git a/src/clj/youyesyet/routes/auto.clj b/src/clj/youyesyet/routes/auto.clj index b1951c3..3781e1d 100644 --- a/src/clj/youyesyet/routes/auto.clj +++ b/src/clj/youyesyet/routes/auto.clj @@ -1,6 +1,6 @@ (ns youyesyet.routes.auto - "User interface routes for Youyesyet auto-generated by [Application Description Language framework](https://github.com/simon-brooke/adl) at 20180610T214425.631Z" + "User interface routes for Youyesyet auto-generated by [Application Description Language framework](https://github.com/simon-brooke/adl) at 20180611T180322.460Z" (:require [noir.response :as nresponse] [noir.util.route :as route] @@ -8,6 +8,7 @@ [ring.util.http-response :as response] [clojure.java.io :as io] [hugsql.core :as hugsql] + [youyesyet.layout :as l] [youyesyet.db.core :as db] [youyesyet.routes.manual :as m])) @@ -19,13 +20,13 @@ n (str "auto/" n))) -(def resolve-template (memoise raw-resolve-template)) +(def resolve-template (memoize raw-resolve-template)) (defn index [r] - (layout/render - (resolve-template "application-index") + (l/render + (resolve-template "application-index.html") {:title "Administrative menu"})) (defn @@ -33,16 +34,18 @@ [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "list-electors-Electors.html") - {:title "Electors", :params p, :records (db/search-elector p)}))) + {:title "Electors", + :params p, + :records (db/search-strings-elector p)}))) (defn form-electors-Elector [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "form-electors-Elector.html") {:title "Elector", :params p, :record (db/get-elector p)}))) @@ -51,16 +54,18 @@ [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "list-genders-Genders.html") - {:title "Genders", :params p, :records (db/search-gender p)}))) + {:title "Genders", + :params p, + :records (db/search-strings-gender p)}))) (defn form-genders-Gender [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "form-genders-Gender.html") {:title "Gender", :params p, :record (db/get-gender p)}))) @@ -69,16 +74,18 @@ [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "list-dwellings-Dwellings.html") - {:title "Dwellings", :params p, :records (db/search-dwelling p)}))) + {:title "Dwellings", + :params p, + :records (db/search-strings-dwelling p)}))) (defn form-dwellings-Dwelling [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "form-dwellings-Dwelling.html") {:title "Dwelling", :params p, :record (db/get-dwelling p)}))) @@ -87,16 +94,18 @@ [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "list-addresses-Addresses.html") - {:title "Addresses", :params p, :records (db/search-address p)}))) + {:title "Addresses", + :params p, + :records (db/search-strings-address p)}))) (defn form-addresses-Address [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "form-addresses-Address.html") {:title "Address", :params p, :record (db/get-address p)}))) @@ -105,16 +114,16 @@ [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "list-visits-Visits.html") - {:title "Visits", :params p, :records (db/search-visit p)}))) + {:title "Visits", :params p, :records (db/search-strings-visit p)}))) (defn form-visits-Visit [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "form-visits-Visit.html") {:title "Visit", :params p, :record (db/get-visit p)}))) @@ -123,18 +132,18 @@ [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "list-authorities-Authorities.html") {:title "Authorities", :params p, - :records (db/search-authority p)}))) + :records (db/search-strings-authority p)}))) (defn form-authorities-Authority [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "form-authorities-Authority.html") {:title "Authority", :params p, :record (db/get-authority p)}))) @@ -143,16 +152,16 @@ [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "list-issues-Issues.html") - {:title "Issues", :params p, :records (db/search-issue p)}))) + {:title "Issues", :params p, :records (db/search-strings-issue p)}))) (defn form-issues-Issue [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "form-issues-Issue.html") {:title "Issue", :params p, :record (db/get-issue p)}))) @@ -161,16 +170,18 @@ [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "list-intentions-Intentions.html") - {:title "Intentions", :params p, :records (db/search-intention p)}))) + {:title "Intentions", + :params p, + :records (db/search-strings-intention p)}))) (defn form-intentions-Intention [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "form-intentions-Intention.html") {:title "Intention", :params p, :record (db/get-intention p)}))) @@ -179,16 +190,18 @@ [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "list-canvassers-Canvassers.html") - {:title "Canvassers", :params p, :records (db/search-canvasser p)}))) + {:title "Canvassers", + :params p, + :records (db/search-strings-canvasser p)}))) (defn form-canvassers-Canvasser [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "form-canvassers-Canvasser.html") {:title "Canvasser", :params p, :record (db/get-canvasser p)}))) @@ -197,18 +210,18 @@ [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "list-followuprequests-Followuprequests.html") {:title "Followuprequests", :params p, - :records (db/search-followuprequest p)}))) + :records (db/search-strings-followuprequest p)}))) (defn form-followuprequests-Followuprequest [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "form-followuprequests-Followuprequest.html") {:title "Followuprequest", :params p, @@ -219,16 +232,16 @@ [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "list-roles-Roles.html") - {:title "Roles", :params p, :records (db/search-role p)}))) + {:title "Roles", :params p, :records (db/search-strings-role p)}))) (defn form-roles-Role [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "form-roles-Role.html") {:title "Role", :params p, :record (db/get-role p)}))) @@ -237,16 +250,16 @@ [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "list-teams-Teams.html") - {:title "Teams", :params p, :records (db/search-team p)}))) + {:title "Teams", :params p, :records (db/search-strings-team p)}))) (defn form-teams-Team [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "form-teams-Team.html") {:title "Team", :params p, :record (db/get-team p)}))) @@ -255,16 +268,18 @@ [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "list-districts-Districts.html") - {:title "Districts", :params p, :records (db/search-district p)}))) + {:title "Districts", + :params p, + :records (db/search-strings-district p)}))) (defn form-districts-District [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "form-districts-District.html") {:title "District", :params p, :record (db/get-district p)}))) @@ -273,18 +288,18 @@ [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "list-followupactions-Followupactions.html") {:title "Followupactions", :params p, - :records (db/search-followupaction p)}))) + :records (db/search-strings-followupaction p)}))) (defn form-followupactions-Followupaction [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "form-followupactions-Followupaction.html") {:title "Followupaction", :params p, @@ -295,16 +310,18 @@ [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "list-options-Options.html") - {:title "Options", :params p, :records (db/search-option p)}))) + {:title "Options", + :params p, + :records (db/search-strings-option p)}))) (defn form-options-Option [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "form-options-Option.html") {:title "Option", :params p, :record (db/get-option p)}))) @@ -313,18 +330,18 @@ [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "list-followupmethods-Followupmethods.html") {:title "Followupmethods", :params p, - :records (db/search-followupmethod p)}))) + :records (db/search-strings-followupmethod p)}))) (defn form-followupmethods-Followupmethod [r] (let [p (:form-params r)] - (layout/render + (l/render (resolve-template "form-followupmethods-Followupmethod.html") {:title "Followupmethod", :params p, @@ -334,14 +351,21 @@ raw-resolve-handler "Prefer the manually-written version of the handler with name `n`, if it exists, to the automatically generated one" [n] - (let - [s (symbol (str "m." n))] - (if (bound? s) (eval s) (eval (symbol n))))) + (try + (eval (symbol (str "youyesyet" ".routes.manual/" n))) + (catch + Exception + _ + (eval (symbol (str "youyesyet" ".routes.auto/" n)))))) (def resolve-handler (memoize raw-resolve-handler)) (defroutes auto-selmer-routes + (GET + "/index" + request + (route/restricted (apply (resolve-handler "index") (list request)))) (GET "/form-addresses-Address" request diff --git a/src/clj/youyesyet/routes/auto_json.clj b/src/clj/youyesyet/routes/auto_json.clj new file mode 100644 index 0000000..9426c90 --- /dev/null +++ b/src/clj/youyesyet/routes/auto_json.clj @@ -0,0 +1,1653 @@ +(ns + youyesyet.routes.auto-json + "JSON routes for youyesyet auto-generated by [Application Description Language framework](https://github.com/simon-brooke/adl) at 20180611T180321.339Z" + (:require + [noir.response :as nresponse] + [noir.util.route :as route] + [compojure.core :refer [defroutes GET POST]] + [ring.util.http-response :as response] + [clojure.java.io :as io] + [hugsql.core :as hugsql] + [youyesyet.db.core :as db])) + + +(declare + create-address! + create-authority! + create-canvasser! + create-district! + create-dwelling! + create-elector! + create-followupaction! + create-followupmethod! + create-followuprequest! + create-gender! + create-intention! + create-issue! + create-issueexpertise! + create-option! + create-role! + create-rolemembership! + create-team! + create-teammembership! + create-teamorganisership! + create-visit! + delete-address! + delete-authority! + delete-canvasser! + delete-district! + delete-dwelling! + delete-elector! + delete-followupaction! + delete-followupmethod! + delete-followuprequest! + delete-gender! + delete-intention! + delete-issue! + delete-issueexpertise! + delete-option! + delete-role! + delete-rolemembership! + delete-team! + delete-teammembership! + delete-teamorganisership! + delete-visit! + get-address + get-authority + get-canvasser + get-canvasser-by-username + get-district + get-dwelling + get-elector + get-followupaction + get-followupmethod + get-followuprequest + get-gender + get-intention + get-issue + get-issueexpertise + get-option + get-role + get-rolemembership + get-team + get-teammembership + get-teamorganisership + get-visit + list-addresses + list-addresses-by-district + list-authorities + list-canvassers + list-canvassers-by-address + list-canvassers-by-authority + list-canvassers-by-elector + list-canvassers-by-role + list-districts + list-dwellings + list-dwellings-by-address + list-electors + list-electors-by-dwelling + list-electors-by-gender + list-followupactions + list-followupactions-by-canvasser + list-followupactions-by-followuprequest + list-followupmethods + list-followuprequests + list-followuprequests-by-elector + list-followuprequests-by-followupmethod + list-followuprequests-by-issue + list-followuprequests-by-visit + list-genders + list-intentions + list-intentions-by-elector + list-intentions-by-option + list-intentions-by-visit + list-issueexpertise + list-issueexpertise-by-canvasser + list-issueexpertise-by-followupmethod + list-issueexpertise-by-issue + list-issues + list-options + list-rolememberships + list-rolememberships-by-canvasser + list-rolememberships-by-role + list-roles + list-roles-by-canvasser + list-teammemberships + list-teammemberships-by-canvasser + list-teammemberships-by-team + list-teamorganiserships + list-teamorganiserships-by-canvasser + list-teamorganiserships-by-team + list-teams + list-teams-by-canvasser + list-teams-by-district + list-visits + list-visits-by-address + list-visits-by-canvasser + search-strings-address + search-strings-authority + search-strings-canvasser + search-strings-district + search-strings-dwelling + search-strings-elector + search-strings-followupaction + search-strings-followupmethod + search-strings-followuprequest + search-strings-gender + search-strings-intention + search-strings-issue + search-strings-issueexpertise + search-strings-option + search-strings-role + search-strings-rolemembership + search-strings-team + search-strings-teammembership + search-strings-teamorganisership + search-strings-visit + update-address! + update-canvasser! + update-district! + update-dwelling! + update-elector! + update-followupaction! + update-followuprequest! + update-intention! + update-issue! + update-issueexpertise! + update-role! + update-rolemembership! + update-team! + update-teammembership! + update-teamorganisership! + update-visit!) + + +(defroutes + auto-rest-routes + (POST + "/json/auto/create-address" + request + (route/restricted (create-address! request))) + (POST + "/json/auto/create-authority" + request + (route/restricted (create-authority! request))) + (POST + "/json/auto/create-canvasser" + request + (route/restricted (create-canvasser! request))) + (POST + "/json/auto/create-district" + request + (route/restricted (create-district! request))) + (POST + "/json/auto/create-dwelling" + request + (route/restricted (create-dwelling! request))) + (POST + "/json/auto/create-elector" + request + (route/restricted (create-elector! request))) + (POST + "/json/auto/create-followupaction" + request + (route/restricted (create-followupaction! request))) + (POST + "/json/auto/create-followupmethod" + request + (route/restricted (create-followupmethod! request))) + (POST + "/json/auto/create-followuprequest" + request + (route/restricted (create-followuprequest! request))) + (POST + "/json/auto/create-gender" + request + (route/restricted (create-gender! request))) + (POST + "/json/auto/create-intention" + request + (route/restricted (create-intention! request))) + (POST + "/json/auto/create-issue" + request + (route/restricted (create-issue! request))) + (POST + "/json/auto/create-issueexpertise" + request + (route/restricted (create-issueexpertise! request))) + (POST + "/json/auto/create-option" + request + (route/restricted (create-option! request))) + (POST + "/json/auto/create-role" + request + (route/restricted (create-role! request))) + (POST + "/json/auto/create-rolemembership" + request + (route/restricted (create-rolemembership! request))) + (POST + "/json/auto/create-team" + request + (route/restricted (create-team! request))) + (POST + "/json/auto/create-teammembership" + request + (route/restricted (create-teammembership! request))) + (POST + "/json/auto/create-teamorganisership" + request + (route/restricted (create-teamorganisership! request))) + (POST + "/json/auto/create-visit" + request + (route/restricted (create-visit! request))) + (POST + "/json/auto/delete-address" + request + (route/restricted (delete-address! request))) + (POST + "/json/auto/delete-authority" + request + (route/restricted (delete-authority! request))) + (POST + "/json/auto/delete-canvasser" + request + (route/restricted (delete-canvasser! request))) + (POST + "/json/auto/delete-district" + request + (route/restricted (delete-district! request))) + (POST + "/json/auto/delete-dwelling" + request + (route/restricted (delete-dwelling! request))) + (POST + "/json/auto/delete-elector" + request + (route/restricted (delete-elector! request))) + (POST + "/json/auto/delete-followupaction" + request + (route/restricted (delete-followupaction! request))) + (POST + "/json/auto/delete-followupmethod" + request + (route/restricted (delete-followupmethod! request))) + (POST + "/json/auto/delete-followuprequest" + request + (route/restricted (delete-followuprequest! request))) + (POST + "/json/auto/delete-gender" + request + (route/restricted (delete-gender! request))) + (POST + "/json/auto/delete-intention" + request + (route/restricted (delete-intention! request))) + (POST + "/json/auto/delete-issue" + request + (route/restricted (delete-issue! request))) + (POST + "/json/auto/delete-issueexpertise" + request + (route/restricted (delete-issueexpertise! request))) + (POST + "/json/auto/delete-option" + request + (route/restricted (delete-option! request))) + (POST + "/json/auto/delete-role" + request + (route/restricted (delete-role! request))) + (POST + "/json/auto/delete-rolemembership" + request + (route/restricted (delete-rolemembership! request))) + (POST + "/json/auto/delete-team" + request + (route/restricted (delete-team! request))) + (POST + "/json/auto/delete-teammembership" + request + (route/restricted (delete-teammembership! request))) + (POST + "/json/auto/delete-teamorganisership" + request + (route/restricted (delete-teamorganisership! request))) + (POST + "/json/auto/delete-visit" + request + (route/restricted (delete-visit! request))) + (POST + "/json/auto/get-address" + request + (route/restricted (get-address request))) + (POST + "/json/auto/get-authority" + request + (route/restricted (get-authority request))) + (POST + "/json/auto/get-canvasser" + request + (route/restricted (get-canvasser request))) + (POST + "/json/auto/get-canvasser-by-username" + request + (route/restricted (get-canvasser-by-username request))) + (POST + "/json/auto/get-district" + request + (route/restricted (get-district request))) + (POST + "/json/auto/get-dwelling" + request + (route/restricted (get-dwelling request))) + (POST + "/json/auto/get-elector" + request + (route/restricted (get-elector request))) + (POST + "/json/auto/get-followupaction" + request + (route/restricted (get-followupaction request))) + (POST + "/json/auto/get-followupmethod" + request + (route/restricted (get-followupmethod request))) + (POST + "/json/auto/get-followuprequest" + request + (route/restricted (get-followuprequest request))) + (POST + "/json/auto/get-gender" + request + (route/restricted (get-gender request))) + (POST + "/json/auto/get-intention" + request + (route/restricted (get-intention request))) + (POST + "/json/auto/get-issue" + request + (route/restricted (get-issue request))) + (POST + "/json/auto/get-issueexpertise" + request + (route/restricted (get-issueexpertise request))) + (POST + "/json/auto/get-option" + request + (route/restricted (get-option request))) + (POST + "/json/auto/get-role" + request + (route/restricted (get-role request))) + (POST + "/json/auto/get-rolemembership" + request + (route/restricted (get-rolemembership request))) + (POST + "/json/auto/get-team" + request + (route/restricted (get-team request))) + (POST + "/json/auto/get-teammembership" + request + (route/restricted (get-teammembership request))) + (POST + "/json/auto/get-teamorganisership" + request + (route/restricted (get-teamorganisership request))) + (POST + "/json/auto/get-visit" + request + (route/restricted (get-visit request))) + (GET + "/json/auto/list-addresses" + request + (route/restricted (list-addresses request))) + (GET + "/json/auto/list-addresses-by-district" + request + (route/restricted (list-addresses-by-district request))) + (GET + "/json/auto/list-authorities" + request + (route/restricted (list-authorities request))) + (GET + "/json/auto/list-canvassers" + request + (route/restricted (list-canvassers request))) + (GET + "/json/auto/list-canvassers-by-address" + request + (route/restricted (list-canvassers-by-address request))) + (GET + "/json/auto/list-canvassers-by-authority" + request + (route/restricted (list-canvassers-by-authority request))) + (GET + "/json/auto/list-canvassers-by-elector" + request + (route/restricted (list-canvassers-by-elector request))) + (GET + "/json/auto/list-canvassers-by-role" + request + (route/restricted (list-canvassers-by-role request))) + (GET + "/json/auto/list-districts" + request + (route/restricted (list-districts request))) + (GET + "/json/auto/list-dwellings" + request + (route/restricted (list-dwellings request))) + (GET + "/json/auto/list-dwellings-by-address" + request + (route/restricted (list-dwellings-by-address request))) + (GET + "/json/auto/list-electors" + request + (route/restricted (list-electors request))) + (GET + "/json/auto/list-electors-by-dwelling" + request + (route/restricted (list-electors-by-dwelling request))) + (GET + "/json/auto/list-electors-by-gender" + request + (route/restricted (list-electors-by-gender request))) + (GET + "/json/auto/list-followupactions" + request + (route/restricted (list-followupactions request))) + (GET + "/json/auto/list-followupactions-by-canvasser" + request + (route/restricted (list-followupactions-by-canvasser request))) + (GET + "/json/auto/list-followupactions-by-followuprequest" + request + (route/restricted (list-followupactions-by-followuprequest request))) + (GET + "/json/auto/list-followupmethods" + request + (route/restricted (list-followupmethods request))) + (GET + "/json/auto/list-followuprequests" + request + (route/restricted (list-followuprequests request))) + (GET + "/json/auto/list-followuprequests-by-elector" + request + (route/restricted (list-followuprequests-by-elector request))) + (GET + "/json/auto/list-followuprequests-by-followupmethod" + request + (route/restricted (list-followuprequests-by-followupmethod request))) + (GET + "/json/auto/list-followuprequests-by-issue" + request + (route/restricted (list-followuprequests-by-issue request))) + (GET + "/json/auto/list-followuprequests-by-visit" + request + (route/restricted (list-followuprequests-by-visit request))) + (GET + "/json/auto/list-genders" + request + (route/restricted (list-genders request))) + (GET + "/json/auto/list-intentions" + request + (route/restricted (list-intentions request))) + (GET + "/json/auto/list-intentions-by-elector" + request + (route/restricted (list-intentions-by-elector request))) + (GET + "/json/auto/list-intentions-by-option" + request + (route/restricted (list-intentions-by-option request))) + (GET + "/json/auto/list-intentions-by-visit" + request + (route/restricted (list-intentions-by-visit request))) + (GET + "/json/auto/list-issueexpertise" + request + (route/restricted (list-issueexpertise request))) + (GET + "/json/auto/list-issueexpertise-by-canvasser" + request + (route/restricted (list-issueexpertise-by-canvasser request))) + (GET + "/json/auto/list-issueexpertise-by-followupmethod" + request + (route/restricted (list-issueexpertise-by-followupmethod request))) + (GET + "/json/auto/list-issueexpertise-by-issue" + request + (route/restricted (list-issueexpertise-by-issue request))) + (GET + "/json/auto/list-issues" + request + (route/restricted (list-issues request))) + (GET + "/json/auto/list-options" + request + (route/restricted (list-options request))) + (GET + "/json/auto/list-rolememberships" + request + (route/restricted (list-rolememberships request))) + (GET + "/json/auto/list-rolememberships-by-canvasser" + request + (route/restricted (list-rolememberships-by-canvasser request))) + (GET + "/json/auto/list-rolememberships-by-role" + request + (route/restricted (list-rolememberships-by-role request))) + (GET + "/json/auto/list-roles" + request + (route/restricted (list-roles request))) + (GET + "/json/auto/list-roles-by-canvasser" + request + (route/restricted (list-roles-by-canvasser request))) + (GET + "/json/auto/list-teammemberships" + request + (route/restricted (list-teammemberships request))) + (GET + "/json/auto/list-teammemberships-by-canvasser" + request + (route/restricted (list-teammemberships-by-canvasser request))) + (GET + "/json/auto/list-teammemberships-by-team" + request + (route/restricted (list-teammemberships-by-team request))) + (GET + "/json/auto/list-teamorganiserships" + request + (route/restricted (list-teamorganiserships request))) + (GET + "/json/auto/list-teamorganiserships-by-canvasser" + request + (route/restricted (list-teamorganiserships-by-canvasser request))) + (GET + "/json/auto/list-teamorganiserships-by-team" + request + (route/restricted (list-teamorganiserships-by-team request))) + (GET + "/json/auto/list-teams" + request + (route/restricted (list-teams request))) + (GET + "/json/auto/list-teams-by-canvasser" + request + (route/restricted (list-teams-by-canvasser request))) + (GET + "/json/auto/list-teams-by-district" + request + (route/restricted (list-teams-by-district request))) + (GET + "/json/auto/list-visits" + request + (route/restricted (list-visits request))) + (GET + "/json/auto/list-visits-by-address" + request + (route/restricted (list-visits-by-address request))) + (GET + "/json/auto/list-visits-by-canvasser" + request + (route/restricted (list-visits-by-canvasser request))) + (GET + "/json/auto/search-strings-address" + request + (route/restricted (search-strings-address request))) + (GET + "/json/auto/search-strings-authority" + request + (route/restricted (search-strings-authority request))) + (GET + "/json/auto/search-strings-canvasser" + request + (route/restricted (search-strings-canvasser request))) + (GET + "/json/auto/search-strings-district" + request + (route/restricted (search-strings-district request))) + (GET + "/json/auto/search-strings-dwelling" + request + (route/restricted (search-strings-dwelling request))) + (GET + "/json/auto/search-strings-elector" + request + (route/restricted (search-strings-elector request))) + (GET + "/json/auto/search-strings-followupaction" + request + (route/restricted (search-strings-followupaction request))) + (GET + "/json/auto/search-strings-followupmethod" + request + (route/restricted (search-strings-followupmethod request))) + (GET + "/json/auto/search-strings-followuprequest" + request + (route/restricted (search-strings-followuprequest request))) + (GET + "/json/auto/search-strings-gender" + request + (route/restricted (search-strings-gender request))) + (GET + "/json/auto/search-strings-intention" + request + (route/restricted (search-strings-intention request))) + (GET + "/json/auto/search-strings-issue" + request + (route/restricted (search-strings-issue request))) + (GET + "/json/auto/search-strings-issueexpertise" + request + (route/restricted (search-strings-issueexpertise request))) + (GET + "/json/auto/search-strings-option" + request + (route/restricted (search-strings-option request))) + (GET + "/json/auto/search-strings-role" + request + (route/restricted (search-strings-role request))) + (GET + "/json/auto/search-strings-rolemembership" + request + (route/restricted (search-strings-rolemembership request))) + (GET + "/json/auto/search-strings-team" + request + (route/restricted (search-strings-team request))) + (GET + "/json/auto/search-strings-teammembership" + request + (route/restricted (search-strings-teammembership request))) + (GET + "/json/auto/search-strings-teamorganisership" + request + (route/restricted (search-strings-teamorganisership request))) + (GET + "/json/auto/search-strings-visit" + request + (route/restricted (search-strings-visit request))) + (POST + "/json/auto/update-address" + request + (route/restricted (update-address! request))) + (POST + "/json/auto/update-canvasser" + request + (route/restricted (update-canvasser! request))) + (POST + "/json/auto/update-district" + request + (route/restricted (update-district! request))) + (POST + "/json/auto/update-dwelling" + request + (route/restricted (update-dwelling! request))) + (POST + "/json/auto/update-elector" + request + (route/restricted (update-elector! request))) + (POST + "/json/auto/update-followupaction" + request + (route/restricted (update-followupaction! request))) + (POST + "/json/auto/update-followuprequest" + request + (route/restricted (update-followuprequest! request))) + (POST + "/json/auto/update-intention" + request + (route/restricted (update-intention! request))) + (POST + "/json/auto/update-issue" + request + (route/restricted (update-issue! request))) + (POST + "/json/auto/update-issueexpertise" + request + (route/restricted (update-issueexpertise! request))) + (POST + "/json/auto/update-role" + request + (route/restricted (update-role! request))) + (POST + "/json/auto/update-rolemembership" + request + (route/restricted (update-rolemembership! request))) + (POST + "/json/auto/update-team" + request + (route/restricted (update-team! request))) + (POST + "/json/auto/update-teammembership" + request + (route/restricted (update-teammembership! request))) + (POST + "/json/auto/update-teamorganisership" + request + (route/restricted (update-teamorganisership! request))) + (POST + "/json/auto/update-visit" + request + (route/restricted (update-visit! request)))) + + +(defn + create-address! + "Auto-generated method to insert one record to the `addresses` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-address! params))) + +(defn + create-authority! + "Auto-generated method to insert one record to the `authorities` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-authority! params))) + +(defn + create-canvasser! + "Auto-generated method to insert one record to the `canvassers` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-canvasser! params))) + +(defn + create-district! + "Auto-generated method to insert one record to the `districts` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-district! params))) + +(defn + create-dwelling! + "Auto-generated method to insert one record to the `dwellings` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-dwelling! params))) + +(defn + create-elector! + "Auto-generated method to insert one record to the `electors` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-elector! params))) + +(defn + create-followupaction! + "Auto-generated method to insert one record to the `followupactions` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-followupaction! params))) + +(defn + create-followupmethod! + "Auto-generated method to insert one record to the `followupmethods` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-followupmethod! params))) + +(defn + create-followuprequest! + "Auto-generated method to insert one record to the `followuprequests` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-followuprequest! params))) + +(defn + create-gender! + "Auto-generated method to insert one record to the `genders` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-gender! params))) + +(defn + create-intention! + "Auto-generated method to insert one record to the `intentions` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-intention! params))) + +(defn + create-issue! + "Auto-generated method to insert one record to the `issues` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-issue! params))) + +(defn + create-issueexpertise! + "Auto-generated method to insert one record to the `issueexpertise` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-issueexpertise! params))) + +(defn + create-option! + "Auto-generated method to insert one record to the `options` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-option! params))) + +(defn + create-role! + "Auto-generated method to insert one record to the `roles` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-role! params))) + +(defn + create-rolemembership! + "Auto-generated method to insert one record to the `rolememberships` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-rolemembership! params))) + +(defn + create-team! + "Auto-generated method to insert one record to the `teams` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-team! params))) + +(defn + create-teammembership! + "Auto-generated method to insert one record to the `teammemberships` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-teammembership! params))) + +(defn + create-teamorganisership! + "Auto-generated method to insert one record to the `teamorganiserships` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-teamorganisership! params))) + +(defn + create-visit! + "Auto-generated method to insert one record to the `visits` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the keys `nil` identifying the record created." + [{:keys [params]}] + (do (db/create-visit! params))) + +(defn + delete-address! + "Auto-generated method to delete one record from the `addresses` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-address! params)) + (response/found "/")) + +(defn + delete-authority! + "Auto-generated method to delete one record from the `authorities` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-authority! params)) + (response/found "/")) + +(defn + delete-canvasser! + "Auto-generated method to delete one record from the `canvassers` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-canvasser! params)) + (response/found "/")) + +(defn + delete-district! + "Auto-generated method to delete one record from the `districts` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-district! params)) + (response/found "/")) + +(defn + delete-dwelling! + "Auto-generated method to delete one record from the `dwellings` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-dwelling! params)) + (response/found "/")) + +(defn + delete-elector! + "Auto-generated method to delete one record from the `electors` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-elector! params)) + (response/found "/")) + +(defn + delete-followupaction! + "Auto-generated method to delete one record from the `followupactions` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-followupaction! params)) + (response/found "/")) + +(defn + delete-followupmethod! + "Auto-generated method to delete one record from the `followupmethods` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-followupmethod! params)) + (response/found "/")) + +(defn + delete-followuprequest! + "Auto-generated method to delete one record from the `followuprequests` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-followuprequest! params)) + (response/found "/")) + +(defn + delete-gender! + "Auto-generated method to delete one record from the `genders` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-gender! params)) + (response/found "/")) + +(defn + delete-intention! + "Auto-generated method to delete one record from the `intentions` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-intention! params)) + (response/found "/")) + +(defn + delete-issue! + "Auto-generated method to delete one record from the `issues` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-issue! params)) + (response/found "/")) + +(defn + delete-issueexpertise! + "Auto-generated method to delete one record from the `issueexpertise` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-issueexpertise! params)) + (response/found "/")) + +(defn + delete-option! + "Auto-generated method to delete one record from the `options` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-option! params)) + (response/found "/")) + +(defn + delete-role! + "Auto-generated method to delete one record from the `roles` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-role! params)) + (response/found "/")) + +(defn + delete-rolemembership! + "Auto-generated method to delete one record from the `rolememberships` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-rolemembership! params)) + (response/found "/")) + +(defn + delete-team! + "Auto-generated method to delete one record from the `teams` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-team! params)) + (response/found "/")) + +(defn + delete-teammembership! + "Auto-generated method to delete one record from the `teammemberships` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-teammembership! params)) + (response/found "/")) + +(defn + delete-teamorganisership! + "Auto-generated method to delete one record from the `teamorganiserships` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-teamorganisership! params)) + (response/found "/")) + +(defn + delete-visit! + "Auto-generated method to delete one record from the `visits` table. Expects the following key(s) to be present in `params`: ``." + [{:keys [params]}] + (do (db/delete-visit! params)) + (response/found "/")) + +(defn + get-address + "Auto-generated method to select one record from the `addresses` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-address params))) + +(defn + get-authority + "Auto-generated method to select one record from the `authorities` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-authority params))) + +(defn + get-canvasser + "Auto-generated method to select one record from the `canvassers` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-canvasser params))) + +(defn + get-canvasser-by-username + "Auto-generated method to select one record from the `canvassers` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-canvasser-by-username params))) + +(defn + get-district + "Auto-generated method to select one record from the `districts` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-district params))) + +(defn + get-dwelling + "Auto-generated method to select one record from the `dwellings` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-dwelling params))) + +(defn + get-elector + "Auto-generated method to select one record from the `electors` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-elector params))) + +(defn + get-followupaction + "Auto-generated method to select one record from the `followupactions` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-followupaction params))) + +(defn + get-followupmethod + "Auto-generated method to select one record from the `followupmethods` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-followupmethod params))) + +(defn + get-followuprequest + "Auto-generated method to select one record from the `followuprequests` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-followuprequest params))) + +(defn + get-gender + "Auto-generated method to select one record from the `genders` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-gender params))) + +(defn + get-intention + "Auto-generated method to select one record from the `intentions` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-intention params))) + +(defn + get-issue + "Auto-generated method to select one record from the `issues` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-issue params))) + +(defn + get-issueexpertise + "Auto-generated method to select one record from the `issueexpertise` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-issueexpertise params))) + +(defn + get-option + "Auto-generated method to select one record from the `options` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-option params))) + +(defn + get-role + "Auto-generated method to select one record from the `roles` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-role params))) + +(defn + get-rolemembership + "Auto-generated method to select one record from the `rolememberships` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-rolemembership params))) + +(defn + get-team + "Auto-generated method to select one record from the `teams` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-team params))) + +(defn + get-teammembership + "Auto-generated method to select one record from the `teammemberships` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-teammembership params))) + +(defn + get-teamorganisership + "Auto-generated method to select one record from the `teamorganiserships` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-teamorganisership params))) + +(defn + get-visit + "Auto-generated method to select one record from the `visits` table. Expects the following key(s) to be present in `params`: `nil`. Returns a map containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/get-visit params))) + +(defn + list-addresses + "Auto-generated method to select all records from the `addresses` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-addresses params))) + +(defn + list-addresses-by-district + [{:keys [params]}] + (do (db/list-addresses-by-district params))) + +(defn + list-authorities + "Auto-generated method to select all records from the `authorities` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-authorities params))) + +(defn + list-canvassers + "Auto-generated method to select all records from the `canvassers` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-canvassers params))) + +(defn + list-canvassers-by-address + [{:keys [params]}] + (do (db/list-canvassers-by-address params))) + +(defn + list-canvassers-by-authority + [{:keys [params]}] + (do (db/list-canvassers-by-authority params))) + +(defn + list-canvassers-by-elector + [{:keys [params]}] + (do (db/list-canvassers-by-elector params))) + +(defn + list-canvassers-by-role + [{:keys [params]}] + (do (db/list-canvassers-by-role params))) + +(defn + list-districts + "Auto-generated method to select all records from the `districts` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-districts params))) + +(defn + list-dwellings + "Auto-generated method to select all records from the `dwellings` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-dwellings params))) + +(defn + list-dwellings-by-address + [{:keys [params]}] + (do (db/list-dwellings-by-address params))) + +(defn + list-electors + "Auto-generated method to select all records from the `electors` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-electors params))) + +(defn + list-electors-by-dwelling + [{:keys [params]}] + (do (db/list-electors-by-dwelling params))) + +(defn + list-electors-by-gender + [{:keys [params]}] + (do (db/list-electors-by-gender params))) + +(defn + list-followupactions + "Auto-generated method to select all records from the `followupactions` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-followupactions params))) + +(defn + list-followupactions-by-canvasser + [{:keys [params]}] + (do (db/list-followupactions-by-canvasser params))) + +(defn + list-followupactions-by-followuprequest + [{:keys [params]}] + (do (db/list-followupactions-by-followuprequest params))) + +(defn + list-followupmethods + "Auto-generated method to select all records from the `followupmethods` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-followupmethods params))) + +(defn + list-followuprequests + "Auto-generated method to select all records from the `followuprequests` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-followuprequests params))) + +(defn + list-followuprequests-by-elector + [{:keys [params]}] + (do (db/list-followuprequests-by-elector params))) + +(defn + list-followuprequests-by-followupmethod + [{:keys [params]}] + (do (db/list-followuprequests-by-followupmethod params))) + +(defn + list-followuprequests-by-issue + [{:keys [params]}] + (do (db/list-followuprequests-by-issue params))) + +(defn + list-followuprequests-by-visit + [{:keys [params]}] + (do (db/list-followuprequests-by-visit params))) + +(defn + list-genders + "Auto-generated method to select all records from the `genders` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-genders params))) + +(defn + list-intentions + "Auto-generated method to select all records from the `intentions` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-intentions params))) + +(defn + list-intentions-by-elector + [{:keys [params]}] + (do (db/list-intentions-by-elector params))) + +(defn + list-intentions-by-option + [{:keys [params]}] + (do (db/list-intentions-by-option params))) + +(defn + list-intentions-by-visit + [{:keys [params]}] + (do (db/list-intentions-by-visit params))) + +(defn + list-issueexpertise + "Auto-generated method to select all records from the `issueexpertise` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-issueexpertise params))) + +(defn + list-issueexpertise-by-canvasser + [{:keys [params]}] + (do (db/list-issueexpertise-by-canvasser params))) + +(defn + list-issueexpertise-by-followupmethod + [{:keys [params]}] + (do (db/list-issueexpertise-by-followupmethod params))) + +(defn + list-issueexpertise-by-issue + [{:keys [params]}] + (do (db/list-issueexpertise-by-issue params))) + +(defn + list-issues + "Auto-generated method to select all records from the `issues` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-issues params))) + +(defn + list-options + "Auto-generated method to select all records from the `options` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-options params))) + +(defn + list-rolememberships + "Auto-generated method to select all records from the `rolememberships` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-rolememberships params))) + +(defn + list-rolememberships-by-canvasser + [{:keys [params]}] + (do (db/list-rolememberships-by-canvasser params))) + +(defn + list-rolememberships-by-role + [{:keys [params]}] + (do (db/list-rolememberships-by-role params))) + +(defn + list-roles + "Auto-generated method to select all records from the `roles` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-roles params))) + +(defn + list-roles-by-canvasser + [{:keys [params]}] + (do (db/list-roles-by-canvasser params))) + +(defn + list-teammemberships + "Auto-generated method to select all records from the `teammemberships` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-teammemberships params))) + +(defn + list-teammemberships-by-canvasser + [{:keys [params]}] + (do (db/list-teammemberships-by-canvasser params))) + +(defn + list-teammemberships-by-team + [{:keys [params]}] + (do (db/list-teammemberships-by-team params))) + +(defn + list-teamorganiserships + "Auto-generated method to select all records from the `teamorganiserships` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-teamorganiserships params))) + +(defn + list-teamorganiserships-by-canvasser + [{:keys [params]}] + (do (db/list-teamorganiserships-by-canvasser params))) + +(defn + list-teamorganiserships-by-team + [{:keys [params]}] + (do (db/list-teamorganiserships-by-team params))) + +(defn + list-teams + "Auto-generated method to select all records from the `teams` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-teams params))) + +(defn + list-teams-by-canvasser + [{:keys [params]}] + (do (db/list-teams-by-canvasser params))) + +(defn + list-teams-by-district + [{:keys [params]}] + (do (db/list-teams-by-district params))) + +(defn + list-visits + "Auto-generated method to select all records from the `visits` table. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/list-visits params))) + +(defn + list-visits-by-address + [{:keys [params]}] + (do (db/list-visits-by-address params))) + +(defn + list-visits-by-canvasser + [{:keys [params]}] + (do (db/list-visits-by-canvasser params))) + +(defn + search-strings-address + "Auto-generated method to select all records from the `addresses` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-address params))) + +(defn + search-strings-authority + "Auto-generated method to select all records from the `authorities` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-authority params))) + +(defn + search-strings-canvasser + "Auto-generated method to select all records from the `canvassers` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-canvasser params))) + +(defn + search-strings-district + "Auto-generated method to select all records from the `districts` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-district params))) + +(defn + search-strings-dwelling + "Auto-generated method to select all records from the `dwellings` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-dwelling params))) + +(defn + search-strings-elector + "Auto-generated method to select all records from the `electors` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-elector params))) + +(defn + search-strings-followupaction + "Auto-generated method to select all records from the `followupactions` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-followupaction params))) + +(defn + search-strings-followupmethod + "Auto-generated method to select all records from the `followupmethods` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-followupmethod params))) + +(defn + search-strings-followuprequest + "Auto-generated method to select all records from the `followuprequests` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-followuprequest params))) + +(defn + search-strings-gender + "Auto-generated method to select all records from the `genders` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-gender params))) + +(defn + search-strings-intention + "Auto-generated method to select all records from the `intentions` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-intention params))) + +(defn + search-strings-issue + "Auto-generated method to select all records from the `issues` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-issue params))) + +(defn + search-strings-issueexpertise + "Auto-generated method to select all records from the `issueexpertise` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-issueexpertise params))) + +(defn + search-strings-option + "Auto-generated method to select all records from the `options` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-option params))) + +(defn + search-strings-role + "Auto-generated method to select all records from the `roles` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-role params))) + +(defn + search-strings-rolemembership + "Auto-generated method to select all records from the `rolememberships` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-rolemembership params))) + +(defn + search-strings-team + "Auto-generated method to select all records from the `teams` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-team params))) + +(defn + search-strings-teammembership + "Auto-generated method to select all records from the `teammemberships` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-teammembership params))) + +(defn + search-strings-teamorganisership + "Auto-generated method to select all records from the `teamorganiserships` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-teamorganisership params))) + +(defn + search-strings-visit + "Auto-generated method to select all records from the `visits` table with any text field matching the value of the key `:pattern` which should be in the request. If the keys `(:limit :offset)` are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: `(nil)`." + [{:keys [params]}] + (do (db/search-strings-visit params))) + +(defn + update-address! + "Auto-generated method to update one record in the `addresses` table. Expects the following key(s) to be present in `params`: `(nil)`." + [{:keys [params]}] + (do (db/update-address! params)) + (response/found "/")) + +(defn + update-canvasser! + "Auto-generated method to update one record in the `canvassers` table. Expects the following key(s) to be present in `params`: `(nil)`." + [{:keys [params]}] + (do (db/update-canvasser! params)) + (response/found "/")) + +(defn + update-district! + "Auto-generated method to update one record in the `districts` table. Expects the following key(s) to be present in `params`: `(nil)`." + [{:keys [params]}] + (do (db/update-district! params)) + (response/found "/")) + +(defn + update-dwelling! + "Auto-generated method to update one record in the `dwellings` table. Expects the following key(s) to be present in `params`: `(nil)`." + [{:keys [params]}] + (do (db/update-dwelling! params)) + (response/found "/")) + +(defn + update-elector! + "Auto-generated method to update one record in the `electors` table. Expects the following key(s) to be present in `params`: `(nil)`." + [{:keys [params]}] + (do (db/update-elector! params)) + (response/found "/")) + +(defn + update-followupaction! + "Auto-generated method to update one record in the `followupactions` table. Expects the following key(s) to be present in `params`: `(nil)`." + [{:keys [params]}] + (do (db/update-followupaction! params)) + (response/found "/")) + +(defn + update-followuprequest! + "Auto-generated method to update one record in the `followuprequests` table. Expects the following key(s) to be present in `params`: `(nil)`." + [{:keys [params]}] + (do (db/update-followuprequest! params)) + (response/found "/")) + +(defn + update-intention! + "Auto-generated method to update one record in the `intentions` table. Expects the following key(s) to be present in `params`: `(nil)`." + [{:keys [params]}] + (do (db/update-intention! params)) + (response/found "/")) + +(defn + update-issue! + "Auto-generated method to update one record in the `issues` table. Expects the following key(s) to be present in `params`: `(nil)`." + [{:keys [params]}] + (do (db/update-issue! params)) + (response/found "/")) + +(defn + update-issueexpertise! + "Auto-generated method to update one record in the `issueexpertise` table. Expects the following key(s) to be present in `params`: `(nil)`." + [{:keys [params]}] + (do (db/update-issueexpertise! params)) + (response/found "/")) + +(defn + update-role! + "Auto-generated method to update one record in the `roles` table. Expects the following key(s) to be present in `params`: `(nil)`." + [{:keys [params]}] + (do (db/update-role! params)) + (response/found "/")) + +(defn + update-rolemembership! + "Auto-generated method to update one record in the `rolememberships` table. Expects the following key(s) to be present in `params`: `(nil)`." + [{:keys [params]}] + (do (db/update-rolemembership! params)) + (response/found "/")) + +(defn + update-team! + "Auto-generated method to update one record in the `teams` table. Expects the following key(s) to be present in `params`: `(nil)`." + [{:keys [params]}] + (do (db/update-team! params)) + (response/found "/")) + +(defn + update-teammembership! + "Auto-generated method to update one record in the `teammemberships` table. Expects the following key(s) to be present in `params`: `(nil)`." + [{:keys [params]}] + (do (db/update-teammembership! params)) + (response/found "/")) + +(defn + update-teamorganisership! + "Auto-generated method to update one record in the `teamorganiserships` table. Expects the following key(s) to be present in `params`: `(nil)`." + [{:keys [params]}] + (do (db/update-teamorganisership! params)) + (response/found "/")) + +(defn + update-visit! + "Auto-generated method to update one record in the `visits` table. Expects the following key(s) to be present in `params`: `(nil)`." + [{:keys [params]}] + (do (db/update-visit! params)) + (response/found "/")) + diff --git a/src/clj/youyesyet/routes/auto_json_routes.clj b/src/clj/youyesyet/routes/auto_json_routes.clj deleted file mode 100644 index 64efb8f..0000000 --- a/src/clj/youyesyet/routes/auto_json_routes.clj +++ /dev/null @@ -1,1035 +0,0 @@ -(ns - youyesyet.routes.auto-json-routes - (require - [noir.response :as nresponse] - [noir.util.route :as route] - [compojure.core :refer [defroutes GET POST]] - [ring.util.http-response :as response] - [clojure.java.io :as io] - [hugsql.core :as hugsql] - [youyesyet.db.core :as db])) - - -(declare - create-address - create-authority - create-canvasser - create-district - create-elector - create-followupaction - create-followupmethod - create-followuprequest - create-intention - create-issue - create-issueexpertise - create-option - create-role - create-rolemembership - create-schema-migration - create-team - create-teammembership - create-teamorganisership - create-visit - delete-address - delete-authority - delete-canvasser - delete-district - delete-elector - delete-followupaction - delete-followupmethod - delete-followuprequest - delete-issue - delete-option - delete-visit - get-address - get-authority - get-canvasser - get-district - get-elector - get-followupaction - get-followupmethod - get-followuprequest - get-issue - get-option - get-visit - list-addresses - list-addresses-by-district - list-authorities - list-canvassers - list-canvassers-by-address - list-canvassers-by-authoritie - list-canvassers-by-elector - list-districts - list-electors - list-electors-by-address - list-followupactions - list-followupactions-by-canvasser - list-followupactions-by-followuprequest - list-followupmethods - list-followuprequests - list-followuprequests-by-elector - list-followuprequests-by-followupmethod - list-followuprequests-by-issue - list-followuprequests-by-visit - list-intentions-electors-by-option - list-intentions-electors-by-visit - list-intentions-options-by-elector - list-intentions-options-by-visit - list-intentions-visits-by-elector - list-intentions-visits-by-option - list-issueexpertise-canvassers-by-followupmethod - list-issueexpertise-canvassers-by-issue - list-issueexpertise-followupmethods-by-canvasser - list-issueexpertise-followupmethods-by-issue - list-issueexpertise-issues-by-canvasser - list-issueexpertise-issues-by-followupmethod - list-issues - list-options - list-rolememberships-canvassers-by-role - list-rolememberships-roles-by-canvasser - list-roles - list-schemamigrations - list-teammemberships-canvassers-by-team - list-teammemberships-teams-by-canvasser - list-teamorganiserships-canvassers-by-team - list-teamorganiserships-teams-by-canvasser - list-teams - list-teams-by-district - list-visits - list-visits-by-address - list-visits-by-canvasser - update-address - update-canvasser - update-district - update-elector - update-followupaction - update-followuprequest - update-issue - update-visit) - - -(defroutes - auto-rest-routes - (POST "/json/auto/create-address" request (create-address request)) - (POST - "/json/auto/create-authority" - request - (create-authority request)) - (POST - "/json/auto/create-canvasser" - request - (create-canvasser request)) - (POST "/json/auto/create-district" request (create-district request)) - (POST "/json/auto/create-elector" request (create-elector request)) - (POST - "/json/auto/create-followupaction" - request - (create-followupaction request)) - (POST - "/json/auto/create-followupmethod" - request - (create-followupmethod request)) - (POST - "/json/auto/create-followuprequest" - request - (create-followuprequest request)) - (POST - "/json/auto/create-intention" - request - (create-intention request)) - (POST "/json/auto/create-issue" request (create-issue request)) - (POST - "/json/auto/create-issueexpertise" - request - (create-issueexpertise request)) - (POST "/json/auto/create-option" request (create-option request)) - (POST "/json/auto/create-role" request (create-role request)) - (POST - "/json/auto/create-rolemembership" - request - (create-rolemembership request)) - (POST - "/json/auto/create-schema-migration" - request - (create-schema-migration request)) - (POST "/json/auto/create-team" request (create-team request)) - (POST - "/json/auto/create-teammembership" - request - (create-teammembership request)) - (POST - "/json/auto/create-teamorganisership" - request - (create-teamorganisership request)) - (POST "/json/auto/create-visit" request (create-visit request)) - (POST "/json/auto/delete-address" request (delete-address request)) - (POST - "/json/auto/delete-authority" - request - (delete-authority request)) - (POST - "/json/auto/delete-canvasser" - request - (delete-canvasser request)) - (POST "/json/auto/delete-district" request (delete-district request)) - (POST "/json/auto/delete-elector" request (delete-elector request)) - (POST - "/json/auto/delete-followupaction" - request - (delete-followupaction request)) - (POST - "/json/auto/delete-followupmethod" - request - (delete-followupmethod request)) - (POST - "/json/auto/delete-followuprequest" - request - (delete-followuprequest request)) - (POST "/json/auto/delete-issue" request (delete-issue request)) - (POST "/json/auto/delete-option" request (delete-option request)) - (POST "/json/auto/delete-visit" request (delete-visit request)) - (POST "/json/auto/get-address" request (get-address request)) - (POST "/json/auto/get-authority" request (get-authority request)) - (POST "/json/auto/get-canvasser" request (get-canvasser request)) - (POST "/json/auto/get-district" request (get-district request)) - (POST "/json/auto/get-elector" request (get-elector request)) - (POST - "/json/auto/get-followupaction" - request - (get-followupaction request)) - (POST - "/json/auto/get-followupmethod" - request - (get-followupmethod request)) - (POST - "/json/auto/get-followuprequest" - request - (get-followuprequest request)) - (POST "/json/auto/get-issue" request (get-issue request)) - (POST "/json/auto/get-option" request (get-option request)) - (POST "/json/auto/get-visit" request (get-visit request)) - (GET "/json/auto/list-addresses" request (list-addresses request)) - (GET - "/json/auto/list-addresses-by-district" - request - (list-addresses-by-district request)) - (GET "/json/auto/list-authorities" request (list-authorities request)) - (GET "/json/auto/list-canvassers" request (list-canvassers request)) - (GET - "/json/auto/list-canvassers-by-address" - request - (list-canvassers-by-address request)) - (GET - "/json/auto/list-canvassers-by-authoritie" - request - (list-canvassers-by-authoritie request)) - (GET - "/json/auto/list-canvassers-by-elector" - request - (list-canvassers-by-elector request)) - (GET "/json/auto/list-districts" request (list-districts request)) - (GET "/json/auto/list-electors" request (list-electors request)) - (GET - "/json/auto/list-electors-by-address" - request - (list-electors-by-address request)) - (GET - "/json/auto/list-followupactions" - request - (list-followupactions request)) - (GET - "/json/auto/list-followupactions-by-canvasser" - request - (list-followupactions-by-canvasser request)) - (GET - "/json/auto/list-followupactions-by-followuprequest" - request - (list-followupactions-by-followuprequest request)) - (GET - "/json/auto/list-followupmethods" - request - (list-followupmethods request)) - (GET - "/json/auto/list-followuprequests" - request - (list-followuprequests request)) - (GET - "/json/auto/list-followuprequests-by-elector" - request - (list-followuprequests-by-elector request)) - (GET - "/json/auto/list-followuprequests-by-followupmethod" - request - (list-followuprequests-by-followupmethod request)) - (GET - "/json/auto/list-followuprequests-by-issue" - request - (list-followuprequests-by-issue request)) - (GET - "/json/auto/list-followuprequests-by-visit" - request - (list-followuprequests-by-visit request)) - (GET - "/json/auto/list-intentions-electors-by-option" - request - (list-intentions-electors-by-option request)) - (GET - "/json/auto/list-intentions-electors-by-visit" - request - (list-intentions-electors-by-visit request)) - (GET - "/json/auto/list-intentions-options-by-elector" - request - (list-intentions-options-by-elector request)) - (GET - "/json/auto/list-intentions-options-by-visit" - request - (list-intentions-options-by-visit request)) - (GET - "/json/auto/list-intentions-visits-by-elector" - request - (list-intentions-visits-by-elector request)) - (GET - "/json/auto/list-intentions-visits-by-option" - request - (list-intentions-visits-by-option request)) - (GET - "/json/auto/list-issueexpertise-canvassers-by-followupmethod" - request - (list-issueexpertise-canvassers-by-followupmethod request)) - (GET - "/json/auto/list-issueexpertise-canvassers-by-issue" - request - (list-issueexpertise-canvassers-by-issue request)) - (GET - "/json/auto/list-issueexpertise-followupmethods-by-canvasser" - request - (list-issueexpertise-followupmethods-by-canvasser request)) - (GET - "/json/auto/list-issueexpertise-followupmethods-by-issue" - request - (list-issueexpertise-followupmethods-by-issue request)) - (GET - "/json/auto/list-issueexpertise-issues-by-canvasser" - request - (list-issueexpertise-issues-by-canvasser request)) - (GET - "/json/auto/list-issueexpertise-issues-by-followupmethod" - request - (list-issueexpertise-issues-by-followupmethod request)) - (GET "/json/auto/list-issues" request (list-issues request)) - (GET "/json/auto/list-options" request (list-options request)) - (GET - "/json/auto/list-rolememberships-canvassers-by-role" - request - (list-rolememberships-canvassers-by-role request)) - (GET - "/json/auto/list-rolememberships-roles-by-canvasser" - request - (list-rolememberships-roles-by-canvasser request)) - (GET "/json/auto/list-roles" request (list-roles request)) - (GET - "/json/auto/list-schemamigrations" - request - (list-schemamigrations request)) - (GET - "/json/auto/list-teammemberships-canvassers-by-team" - request - (list-teammemberships-canvassers-by-team request)) - (GET - "/json/auto/list-teammemberships-teams-by-canvasser" - request - (list-teammemberships-teams-by-canvasser request)) - (GET - "/json/auto/list-teamorganiserships-canvassers-by-team" - request - (list-teamorganiserships-canvassers-by-team request)) - (GET - "/json/auto/list-teamorganiserships-teams-by-canvasser" - request - (list-teamorganiserships-teams-by-canvasser request)) - (GET "/json/auto/list-teams" request (list-teams request)) - (GET - "/json/auto/list-teams-by-district" - request - (list-teams-by-district request)) - (GET "/json/auto/list-visits" request (list-visits request)) - (GET - "/json/auto/list-visits-by-address" - request - (list-visits-by-address request)) - (GET - "/json/auto/list-visits-by-canvasser" - request - (list-visits-by-canvasser request)) - (POST "/json/auto/update-address" request (update-address request)) - (POST - "/json/auto/update-canvasser" - request - (update-canvasser request)) - (POST "/json/auto/update-district" request (update-district request)) - (POST "/json/auto/update-elector" request (update-elector request)) - (POST - "/json/auto/update-followupaction" - request - (update-followupaction request)) - (POST - "/json/auto/update-followuprequest" - request - (update-followuprequest request)) - (POST "/json/auto/update-issue" request (update-issue request)) - (POST "/json/auto/update-visit" request (update-visit request))) - - -(defn - create-address - "Auto-generated method to insert one record to the addresses table. Expects the following key(s) to be present in `params`: (:id :address :postcode :phone :district_id :latitude :longitude). Returns a map containing the keys (:id) identifying the record created." - [{:keys [params]}] - (do (db/create-address! params))) - - -(defn - create-authority - "Auto-generated method to insert one record to the authorities table. Expects the following key(s) to be present in `params`: (:id). Returns a map containing the keys (:id) identifying the record created." - [{:keys [params]}] - (do (db/create-authority! params))) - - -(defn - create-canvasser - "Auto-generated method to insert one record to the canvassers table. Expects the following key(s) to be present in `params`: (:id :username :fullname :elector_id :address_id :phone :email :authority_id :authorised). Returns a map containing the keys (:id) identifying the record created." - [{:keys [params]}] - (do (db/create-canvasser! params))) - - -(defn - create-district - "Auto-generated method to insert one record to the districts table. Expects the following key(s) to be present in `params`: (:id :name). Returns a map containing the keys (:id) identifying the record created." - [{:keys [params]}] - (do (db/create-district! params))) - - -(defn - create-elector - "Auto-generated method to insert one record to the electors table. Expects the following key(s) to be present in `params`: (:id :name :address_id :phone :email). Returns a map containing the keys (:id) identifying the record created." - [{:keys [params]}] - (do (db/create-elector! params))) - - -(defn - create-followupaction - "Auto-generated method to insert one record to the followupactions table. Expects the following key(s) to be present in `params`: (:id :request_id :actor :date :notes :closed). Returns a map containing the keys (:id) identifying the record created." - [{:keys [params]}] - (do (db/create-followupaction! params))) - - -(defn - create-followupmethod - "Auto-generated method to insert one record to the followupmethods table. Expects the following key(s) to be present in `params`: (:id). Returns a map containing the keys (:id) identifying the record created." - [{:keys [params]}] - (do (db/create-followupmethod! params))) - - -(defn - create-followuprequest - "Auto-generated method to insert one record to the followuprequests table. Expects the following key(s) to be present in `params`: (:id :elector_id :visit_id :issue_id :method_id). Returns a map containing the keys (:id) identifying the record created." - [{:keys [params]}] - (do (db/create-followuprequest! params))) - - -(defn - create-intention - "Auto-generated method to insert one record to the intentions table. Expects the following key(s) to be present in `params`: (:visit_id :elector_id :option_id). Returns a map containing the keys nil identifying the record created." - [{:keys [params]}] - (do (db/create-intention! params))) - - -(defn - create-issue - "Auto-generated method to insert one record to the issues table. Expects the following key(s) to be present in `params`: (:id :url). Returns a map containing the keys (:id) identifying the record created." - [{:keys [params]}] - (do (db/create-issue! params))) - - -(defn - create-issueexpertise - "Auto-generated method to insert one record to the issueexpertise table. Expects the following key(s) to be present in `params`: (:canvasser_id :issue_id :method_id). Returns a map containing the keys nil identifying the record created." - [{:keys [params]}] - (do (db/create-issueexpertise! params))) - - -(defn - create-option - "Auto-generated method to insert one record to the options table. Expects the following key(s) to be present in `params`: (:id). Returns a map containing the keys (:id) identifying the record created." - [{:keys [params]}] - (do (db/create-option! params))) - - -(defn - create-role - "Auto-generated method to insert one record to the roles table. Expects the following key(s) to be present in `params`: (:id :name). Returns a map containing the keys nil identifying the record created." - [{:keys [params]}] - (do (db/create-role! params))) - - -(defn - create-rolemembership - "Auto-generated method to insert one record to the rolememberships table. Expects the following key(s) to be present in `params`: (:role_id :canvasser_id). Returns a map containing the keys nil identifying the record created." - [{:keys [params]}] - (do (db/create-rolemembership! params))) - - -(defn - create-schema-migration - "Auto-generated method to insert one record to the schema_migrations table. Expects the following key(s) to be present in `params`: (:id). Returns a map containing the keys nil identifying the record created." - [{:keys [params]}] - (do (db/create-schema-migration! params))) - - -(defn - create-team - "Auto-generated method to insert one record to the teams table. Expects the following key(s) to be present in `params`: (:id :name :district_id :latitude :longitude). Returns a map containing the keys nil identifying the record created." - [{:keys [params]}] - (do (db/create-team! params))) - - -(defn - create-teammembership - "Auto-generated method to insert one record to the teammemberships table. Expects the following key(s) to be present in `params`: (:team_id :canvasser_id). Returns a map containing the keys nil identifying the record created." - [{:keys [params]}] - (do (db/create-teammembership! params))) - - -(defn - create-teamorganisership - "Auto-generated method to insert one record to the teamorganiserships table. Expects the following key(s) to be present in `params`: (:team_id :canvasser_id). Returns a map containing the keys nil identifying the record created." - [{:keys [params]}] - (do (db/create-teamorganisership! params))) - - -(defn - create-visit - "Auto-generated method to insert one record to the visits table. Expects the following key(s) to be present in `params`: (:id :address_id :canvasser_id :date). Returns a map containing the keys (:id) identifying the record created." - [{:keys [params]}] - (do (db/create-visit! params))) - - -(defn - delete-address - "Auto-generated method to delete one record from the addresses table. Expects the following key(s) to be present in `params`: (:id)." - [{:keys [params]}] - (do (db/delete-address! params)) - (response/found "/")) - - -(defn - delete-authority - "Auto-generated method to delete one record from the authorities table. Expects the following key(s) to be present in `params`: (:id)." - [{:keys [params]}] - (do (db/delete-authority! params)) - (response/found "/")) - - -(defn - delete-canvasser - "Auto-generated method to delete one record from the canvassers table. Expects the following key(s) to be present in `params`: (:id)." - [{:keys [params]}] - (do (db/delete-canvasser! params)) - (response/found "/")) - - -(defn - delete-district - "Auto-generated method to delete one record from the districts table. Expects the following key(s) to be present in `params`: (:id)." - [{:keys [params]}] - (do (db/delete-district! params)) - (response/found "/")) - - -(defn - delete-elector - "Auto-generated method to delete one record from the electors table. Expects the following key(s) to be present in `params`: (:id)." - [{:keys [params]}] - (do (db/delete-elector! params)) - (response/found "/")) - - -(defn - delete-followupaction - "Auto-generated method to delete one record from the followupactions table. Expects the following key(s) to be present in `params`: (:id)." - [{:keys [params]}] - (do (db/delete-followupaction! params)) - (response/found "/")) - - -(defn - delete-followupmethod - "Auto-generated method to delete one record from the followupmethods table. Expects the following key(s) to be present in `params`: (:id)." - [{:keys [params]}] - (do (db/delete-followupmethod! params)) - (response/found "/")) - - -(defn - delete-followuprequest - "Auto-generated method to delete one record from the followuprequests table. Expects the following key(s) to be present in `params`: (:id)." - [{:keys [params]}] - (do (db/delete-followuprequest! params)) - (response/found "/")) - - -(defn - delete-issue - "Auto-generated method to delete one record from the issues table. Expects the following key(s) to be present in `params`: (:id)." - [{:keys [params]}] - (do (db/delete-issue! params)) - (response/found "/")) - - -(defn - delete-option - "Auto-generated method to delete one record from the options table. Expects the following key(s) to be present in `params`: (:id)." - [{:keys [params]}] - (do (db/delete-option! params)) - (response/found "/")) - - -(defn - delete-visit - "Auto-generated method to delete one record from the visits table. Expects the following key(s) to be present in `params`: (:id)." - [{:keys [params]}] - (do (db/delete-visit! params)) - (response/found "/")) - - -(defn - get-address - "Auto-generated method to select one record from the addresses table. Expects the following key(s) to be present in `params`: (:id). Returns a map containing the following keys: (:address :district_id :id :latitude :longitude :phone :postcode)." - [{:keys [params]}] - (do (db/get-address params))) - - -(defn - get-authority - "Auto-generated method to select one record from the authorities table. Expects the following key(s) to be present in `params`: (:id). Returns a map containing the following keys: (:id)." - [{:keys [params]}] - (do (db/get-authority params))) - - -(defn - get-canvasser - "Auto-generated method to select one record from the canvassers table. Expects the following key(s) to be present in `params`: (:id). Returns a map containing the following keys: (:address_id :authorised :authority_id :elector_id :email :fullname :id :phone :username)." - [{:keys [params]}] - (do (db/get-canvasser params))) - - -(defn - get-district - "Auto-generated method to select one record from the districts table. Expects the following key(s) to be present in `params`: (:id). Returns a map containing the following keys: (:id :name)." - [{:keys [params]}] - (do (db/get-district params))) - - -(defn - get-elector - "Auto-generated method to select one record from the electors table. Expects the following key(s) to be present in `params`: (:id). Returns a map containing the following keys: (:address_id :email :id :name :phone)." - [{:keys [params]}] - (do (db/get-elector params))) - - -(defn - get-followupaction - "Auto-generated method to select one record from the followupactions table. Expects the following key(s) to be present in `params`: (:id). Returns a map containing the following keys: (:actor :closed :date :id :notes :request_id)." - [{:keys [params]}] - (do (db/get-followupaction params))) - - -(defn - get-followupmethod - "Auto-generated method to select one record from the followupmethods table. Expects the following key(s) to be present in `params`: (:id). Returns a map containing the following keys: (:id)." - [{:keys [params]}] - (do (db/get-followupmethod params))) - - -(defn - get-followuprequest - "Auto-generated method to select one record from the followuprequests table. Expects the following key(s) to be present in `params`: (:id). Returns a map containing the following keys: (:elector_id :id :issue_id :method_id :visit_id)." - [{:keys [params]}] - (do (db/get-followuprequest params))) - - -(defn - get-issue - "Auto-generated method to select one record from the issues table. Expects the following key(s) to be present in `params`: (:id). Returns a map containing the following keys: (:id :url)." - [{:keys [params]}] - (do (db/get-issue params))) - - -(defn - get-option - "Auto-generated method to select one record from the options table. Expects the following key(s) to be present in `params`: (:id). Returns a map containing the following keys: (:id)." - [{:keys [params]}] - (do (db/get-option params))) - - -(defn - get-visit - "Auto-generated method to select one record from the visits table. Expects the following key(s) to be present in `params`: (:id). Returns a map containing the following keys: (:address_id :canvasser_id :date :id)." - [{:keys [params]}] - (do (db/get-visit params))) - - -(defn - list-addresses - "Auto-generated method to select all records from the addresses table. If the keys (:limit :offset) are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: (:address :district_id :id :latitude :longitude :phone :postcode)." - [{:keys [params]}] - (do (db/list-addresses params))) - - -(defn - list-addresses-by-district - [{:keys [params]}] - (do (db/list-addresses-by-district params))) - - -(defn - list-authorities - "Auto-generated method to select all records from the authorities table. If the keys (:limit :offset) are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: (:id)." - [{:keys [params]}] - (do (db/list-authorities params))) - - -(defn - list-canvassers - "Auto-generated method to select all records from the canvassers table. If the keys (:limit :offset) are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: (:address_id :authorised :authority_id :elector_id :email :fullname :id :phone :username)." - [{:keys [params]}] - (do (db/list-canvassers params))) - - -(defn - list-canvassers-by-address - [{:keys [params]}] - (do (db/list-canvassers-by-address params))) - - -(defn - list-canvassers-by-authoritie - [{:keys [params]}] - (do (db/list-canvassers-by-authoritie params))) - - -(defn - list-canvassers-by-elector - [{:keys [params]}] - (do (db/list-canvassers-by-elector params))) - - -(defn - list-districts - "Auto-generated method to select all records from the districts table. If the keys (:limit :offset) are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: (:id :name)." - [{:keys [params]}] - (do (db/list-districts params))) - - -(defn - list-electors - "Auto-generated method to select all records from the electors table. If the keys (:limit :offset) are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: (:address_id :email :id :name :phone)." - [{:keys [params]}] - (do (db/list-electors params))) - - -(defn - list-electors-by-address - [{:keys [params]}] - (do (db/list-electors-by-address params))) - - -(defn - list-followupactions - "Auto-generated method to select all records from the followupactions table. If the keys (:limit :offset) are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: (:actor :closed :date :id :notes :request_id)." - [{:keys [params]}] - (do (db/list-followupactions params))) - - -(defn - list-followupactions-by-canvasser - [{:keys [params]}] - (do (db/list-followupactions-by-canvasser params))) - - -(defn - list-followupactions-by-followuprequest - [{:keys [params]}] - (do (db/list-followupactions-by-followuprequest params))) - - -(defn - list-followupmethods - "Auto-generated method to select all records from the followupmethods table. If the keys (:limit :offset) are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: (:id)." - [{:keys [params]}] - (do (db/list-followupmethods params))) - - -(defn - list-followuprequests - "Auto-generated method to select all records from the followuprequests table. If the keys (:limit :offset) are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: (:elector_id :id :issue_id :method_id :visit_id)." - [{:keys [params]}] - (do (db/list-followuprequests params))) - - -(defn - list-followuprequests-by-elector - [{:keys [params]}] - (do (db/list-followuprequests-by-elector params))) - - -(defn - list-followuprequests-by-followupmethod - [{:keys [params]}] - (do (db/list-followuprequests-by-followupmethod params))) - - -(defn - list-followuprequests-by-issue - [{:keys [params]}] - (do (db/list-followuprequests-by-issue params))) - - -(defn - list-followuprequests-by-visit - [{:keys [params]}] - (do (db/list-followuprequests-by-visit params))) - - -(defn - list-intentions-electors-by-option - [{:keys [params]}] - (do (db/list-intentions-electors-by-option params))) - - -(defn - list-intentions-electors-by-visit - [{:keys [params]}] - (do (db/list-intentions-electors-by-visit params))) - - -(defn - list-intentions-options-by-elector - [{:keys [params]}] - (do (db/list-intentions-options-by-elector params))) - - -(defn - list-intentions-options-by-visit - [{:keys [params]}] - (do (db/list-intentions-options-by-visit params))) - - -(defn - list-intentions-visits-by-elector - [{:keys [params]}] - (do (db/list-intentions-visits-by-elector params))) - - -(defn - list-intentions-visits-by-option - [{:keys [params]}] - (do (db/list-intentions-visits-by-option params))) - - -(defn - list-issueexpertise-canvassers-by-followupmethod - [{:keys [params]}] - (do (db/list-issueexpertise-canvassers-by-followupmethod params))) - - -(defn - list-issueexpertise-canvassers-by-issue - [{:keys [params]}] - (do (db/list-issueexpertise-canvassers-by-issue params))) - - -(defn - list-issueexpertise-followupmethods-by-canvasser - [{:keys [params]}] - (do (db/list-issueexpertise-followupmethods-by-canvasser params))) - - -(defn - list-issueexpertise-followupmethods-by-issue - [{:keys [params]}] - (do (db/list-issueexpertise-followupmethods-by-issue params))) - - -(defn - list-issueexpertise-issues-by-canvasser - [{:keys [params]}] - (do (db/list-issueexpertise-issues-by-canvasser params))) - - -(defn - list-issueexpertise-issues-by-followupmethod - [{:keys [params]}] - (do (db/list-issueexpertise-issues-by-followupmethod params))) - - -(defn - list-issues - "Auto-generated method to select all records from the issues table. If the keys (:limit :offset) are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: (:id :url)." - [{:keys [params]}] - (do (db/list-issues params))) - - -(defn - list-options - "Auto-generated method to select all records from the options table. If the keys (:limit :offset) are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: (:id)." - [{:keys [params]}] - (do (db/list-options params))) - - -(defn - list-rolememberships-canvassers-by-role - [{:keys [params]}] - (do (db/list-rolememberships-canvassers-by-role params))) - - -(defn - list-rolememberships-roles-by-canvasser - [{:keys [params]}] - (do (db/list-rolememberships-roles-by-canvasser params))) - - -(defn - list-roles - "Auto-generated method to select all records from the roles table. If the keys (:limit :offset) are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: (:id :name)." - [{:keys [params]}] - (do (db/list-roles params))) - - -(defn - list-schemamigrations - "Auto-generated method to select all records from the schema_migrations table. If the keys (:limit :offset) are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: (:id)." - [{:keys [params]}] - (do (db/list-schema_migrations params))) - - -(defn - list-teammemberships-canvassers-by-team - [{:keys [params]}] - (do (db/list-teammemberships-canvassers-by-team params))) - - -(defn - list-teammemberships-teams-by-canvasser - [{:keys [params]}] - (do (db/list-teammemberships-teams-by-canvasser params))) - - -(defn - list-teamorganiserships-canvassers-by-team - [{:keys [params]}] - (do (db/list-teamorganiserships-canvassers-by-team params))) - - -(defn - list-teamorganiserships-teams-by-canvasser - [{:keys [params]}] - (do (db/list-teamorganiserships-teams-by-canvasser params))) - - -(defn - list-teams - "Auto-generated method to select all records from the teams table. If the keys (:limit :offset) are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: (:district_id :id :latitude :longitude :name)." - [{:keys [params]}] - (do (db/list-teams params))) - - -(defn - list-teams-by-district - [{:keys [params]}] - (do (db/list-teams-by-district params))) - - -(defn - list-visits - "Auto-generated method to select all records from the visits table. If the keys (:limit :offset) are present in the request then they will be used to page through the data. Returns a sequence of maps each containing the following keys: (:address_id :canvasser_id :date :id)." - [{:keys [params]}] - (do (db/list-visits params))) - - -(defn - list-visits-by-address - [{:keys [params]}] - (do (db/list-visits-by-address params))) - - -(defn - list-visits-by-canvasser - [{:keys [params]}] - (do (db/list-visits-by-canvasser params))) - - -(defn - update-address - "Auto-generated method to update one record in the addresses table. Expects the following key(s) to be present in `params`: (:address :district_id :id :latitude :longitude :phone :postcode)." - [{:keys [params]}] - (do (db/update-address! params)) - (response/found "/")) - - -(defn - update-canvasser - "Auto-generated method to update one record in the canvassers table. Expects the following key(s) to be present in `params`: (:address_id :authorised :authority_id :elector_id :email :fullname :id :phone :username)." - [{:keys [params]}] - (do (db/update-canvasser! params)) - (response/found "/")) - - -(defn - update-district - "Auto-generated method to update one record in the districts table. Expects the following key(s) to be present in `params`: (:id :name)." - [{:keys [params]}] - (do (db/update-district! params)) - (response/found "/")) - - -(defn - update-elector - "Auto-generated method to update one record in the electors table. Expects the following key(s) to be present in `params`: (:address_id :email :id :name :phone)." - [{:keys [params]}] - (do (db/update-elector! params)) - (response/found "/")) - - -(defn - update-followupaction - "Auto-generated method to update one record in the followupactions table. Expects the following key(s) to be present in `params`: (:actor :closed :date :id :notes :request_id)." - [{:keys [params]}] - (do (db/update-followupaction! params)) - (response/found "/")) - - -(defn - update-followuprequest - "Auto-generated method to update one record in the followuprequests table. Expects the following key(s) to be present in `params`: (:elector_id :id :issue_id :method_id :visit_id)." - [{:keys [params]}] - (do (db/update-followuprequest! params)) - (response/found "/")) - - -(defn - update-issue - "Auto-generated method to update one record in the issues table. Expects the following key(s) to be present in `params`: (:id :url)." - [{:keys [params]}] - (do (db/update-issue! params)) - (response/found "/")) - - -(defn - update-visit - "Auto-generated method to update one record in the visits table. Expects the following key(s) to be present in `params`: (:address_id :canvasser_id :date :id)." - [{:keys [params]}] - (do (db/update-visit! params)) - (response/found "/")) - - diff --git a/src/clj/youyesyet/routes/manual.clj b/src/clj/youyesyet/routes/manual.clj index 1da2e3e..bf3cf46 100644 --- a/src/clj/youyesyet/routes/manual.clj +++ b/src/clj/youyesyet/routes/manual.clj @@ -1,5 +1,5 @@ (ns - youyesyet.routes.auto + youyesyet.routes.manual "Manual overrides for auto-generated routes" (:require [noir.response :as nresponse] diff --git a/youyesyet.adl.xml b/youyesyet.adl.xml index de657b5..52a6aef 100644 --- a/youyesyet.adl.xml +++ b/youyesyet.adl.xml @@ -323,6 +323,9 @@ + + +
diff --git a/youyesyet.canonical.adl.xml b/youyesyet.canonical.adl.xml index 8fb571f..62a75e9 100644 --- a/youyesyet.canonical.adl.xml +++ b/youyesyet.canonical.adl.xml @@ -414,8 +414,11 @@ + + + -
+