Almost at the point that postgres source is compiling cleanly.

This commit is contained in:
Simon Brooke 2025-05-23 17:50:10 +01:00
parent 63d12578b8
commit 8baa16e9d3
2 changed files with 49 additions and 23 deletions

View file

@ -23,9 +23,9 @@ To generate the majority of the code, run
**NOTE THAT** currently this relies on development versions of the ADL framework; in order to work for you locally, this requires that you check out the development branches of each of
1. [adl-support](https://github.com/simon-brooke/adl-support/);
2. [adl](https://github.com/simon-brooke/adl); and
3. [lein-adl](https://github.com/simon-brooke/lein-adl)
1. [adl-support](https://git.journeyman.cc/simon/adl-support/);
2. [adl](https://git.journeyman.cc/simon/adl); and
3. [lein-adl](https://git.journeyman.cc/simon/lein-adl)
And, in each repository in the order listed above, run

View file

@ -1,13 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- DOCTYPE application PUBLIC "-//JOURNEYMAN//DTD ADL 1.4.1//EN"
"http://www.journeyman.cc/adl/stable/adl/schemas/adl-1.4.1.dtd" -->
<application xmlns="http://bowyer.journeyman.cc/adl/1.4.1/"
<!-- DOCTYPE application PUBLIC "-//JOURNEYMAN//DTD ADL 1.4.7//EN"
"http://www.journeyman.cc/adl/stable/adl/schemas/adl-1.4.7.dtd" -->
<application xmlns="http://bowyer.journeyman.cc/adl/1.4.7/"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:adl="http://bowyer.journeyman.cc/adl/1.4.1/" name="pastoralist"
xmlns:adl="http://bowyer.journeyman.cc/adl/1.4.7/"
name="pastoralist"
version="0.0.1">
<documentation>A web-app intended to be used by pastoralists in managing
pastures, grazing, and animals.</documentation>
pastures, grazing, and animals.
TODO: If this is intended to share data between systems -- as it must, if
for example, it is tracking the movement of animals between holdings --
then
1. Keys must include a unique identifier of the instance on which they
were created, as serial identifiers will not be unique across machines;
2. It had better implement [ActivityPub](https://www.w3.org/TR/activitypub/).
</documentation>
<entity name="holding" magnitude="7" volatility="1">
<documentation>All holdings used to the system</documentation>
@ -28,7 +38,7 @@ version="0.0.1">
<property size="128" type="string" name="name" distinct="user"/>
<property type="list" name="pastures" entity="pasture"/>
<property type="list" name="animals" entity="animal"/>
<property type="link" name="users" entity="user">
<property type="link" name="user-accounts" entity="user-account">
<documentation>A user is a person authorised to see data on a holding.
Some users (e.g. vets, farm secretaries) may be authorised to see data
on many holdings.</documentation>
@ -71,7 +81,7 @@ version="0.0.1">
<property name="subdivision-of" type="entity" entity="pasture"/>
<property name="is-active" type="boolean" default="true">
<documentation>Records are not normally deleted from this system because
of historical data integrity; we may want to trace the history of an
of historical data integrity; we may want to trace the history of a
pasture even after pasture boundaries have been changed.
Indeed, if we treat subdivisions as pastures (which would be quite sensible),
@ -110,6 +120,7 @@ version="0.0.1">
</property>
<property name="name" type="string" size="64" distinct="user"/>
<property name="gender" type="entity" entity="gender" required="true"/>
<property name="neutered" type="boolean" default="false"/>
<property name="species" type="entity" entity="species" required="true"/>
<property name="breed" type="entity" entity="breed"/>
<property name="is-pedigree" type="boolean" default="false"/>
@ -119,20 +130,41 @@ version="0.0.1">
<entity name="gender" magnitude="1" volatility="10">
<key>
<property name="gender" type="string" size="8" distinct="all" immutable="true"/>
<property name="gender" type="string" size="8" distinct="all" immutable="true">
<documentation>
Not confident of this. It might be better to store a single character (or even
boolean), because for i18n reasons storing a natural language token is going
to make data from different systems non-comparable.
</documentation>
</property>
</key>
</entity>
<entity name="species" magnitude="2" volatility="5">
<key>
<property name="species" type="string" size="32" distinct="all" immutable="true"/>
<property name="species" type="string" size="32" distinct="all" immutable="true">
<documentation>
Store scientific/latin name for species. TODO: 32 characters may not be enough.
</documentation>
</property>
</key>
</entity>
<entity name="breed" magnitude="1" volatility="10">
<key>
<property name="breed" type="string" size="32" distinct="all" immutable="true"/>
<property required="true" type="integer" name="id"
column="id" immutable="true" distinct="system">
<generator action="native"/>
</property>
</key>
<property name="breed" type="string" size="32" distinct="all" immutable="true">
<documentation>
Is there a canonical name for a breed? Is a Texan 'Galloway' the same breed
as a Galloway 'Galloway'? What even is a breed? Should we store details of
a breed society or other body which adjudicates membership of the breed?
</documentation>
</property>
<property name="species" type="entity" entity="species"/>
</entity>
@ -144,7 +176,7 @@ version="0.0.1">
</property>
</key>
<property name="type" type="entity" entity="event-type"></property>
<property name="actor" type="entity" entity="user" required="true" immutable="true">
<property name="actor" type="entity" entity="user-account" required="true" immutable="true">
<documentation>The user who recorded this event.</documentation>
</property>
<promperty name="date" type="timestamp" required="true" default="now()"/>
@ -165,7 +197,7 @@ version="0.0.1">
<generator action="native"/>
</property>
</key>
<property name="summary" type="string" size="80"/>
<property name="summary" type="string" size="80" distinct="user"/>
<property name="description" type="text"/>
<property name="n-holdings" type="integer" default="1">
<documentation>
@ -191,7 +223,7 @@ version="0.0.1">
</property>
</entity>
<entity name="user" magnitude="6" volatility="3">
<entity name="user-account" magnitude="6" volatility="3">
<key>
<property required="true" type="string" name="username" size="32"
column="username" immutable="true" distinct="all"/>
@ -201,19 +233,13 @@ version="0.0.1">
<prompt prompt="fullname" locale="en_GB.UTF-8"/>
</property>
<property name="avatar" type="image" size="256">
<documentation>An image of the canvasser, so that other members of their
team can recognise them.</documentation>
<prompt prompt="Avatar" locale="en_GB.UTF-8"/>
</property>
<property name="bio" type="text">
<documentation>Information the canvasser supplies about themselves; an introduction.</documentation>
<documentation>Information the user supplies about themselves; an introduction.</documentation>
<prompt prompt="Bio" locale="en_GB.UTF-8"/>
</property>
<property type="string" name="phone" column="phone" size="16"
distinct="user">
<documentation>Does a canvasser record need a phone field? There is a phone
field on the elector record. I suppose, for under-16 canvassers, there may
be no elector record.</documentation>
<prompt prompt="phone" locale="en_GB.UTF-8"/>
</property>
<property type="string" name="email" column="email" size="128"