summaryrefslogtreecommitdiffstats
path: root/internal (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Method to format an EngagementStrategy for renderingMatthew Lemon2024-02-121-0/+8
| | | | | The objective is to render a link to the ES in the Operations table. Only the start year and end year are required for it to make sense.
* Operations list shows ESs for each entityMatthew Lemon2024-02-122-16/+27
| | | | | | | | | | This was about two hours of learning, and getting confused - and it needs to be refactored. We need to be able to generate the list of EPs for the Operation also. At the moment this only prints the object representation. More work to be done writing a method that gives us the id and textual representation for the link in the table.
* wip: mating EPs with OperationsMatthew Lemon2024-02-122-2/+36
|
* Adds an operations html templateMatthew Lemon2024-02-111-1/+3
| | | | | Does not contain any dynamic data at this point, i.e. does not actually list the operations from the database - just dummy data at this point.
* Have added a listAll handler for new operation modelMatthew Lemon2024-02-111-5/+38
| | | | | | | This is the first attempt at querying a table with a foreign key relation and returning the result to be used in Go code. Learned quite a bit! Including getting a null pointer error because I forgot to initialise the sql.DB in the application structure.
* Started the Operation modelMatthew Lemon2024-02-111-0/+16
|
* Implements Latest() organisation model methodMatthew Lemon2024-02-101-0/+30
| | | | And puts the list in plain text on the home page.
* Adds the Get handler for organisation model and fixesMatthew Lemon2024-02-102-1/+24
| | | | | Also fixes the NotAuthorised response I was mistakenly getting when it should have been a 404.
* Have added Insert handler for Organisation modelMatthew Lemon2024-02-101-1/+13
| | | | | | This is a straight forward wrapper around INSERT. Also added a clientError into a new helpers.go file.
* Adds the Organisations modelMatthew Lemon2024-02-091-0/+29
We have separation of concerns: the model is initalised and passed into the app struct, therefore our database logic will not be tied to our handlers. Our model, with its methods, is nicely encapsulated. We can initialise it and pass it to our handlers as a dependency. We can in future create an interface to mock the OrganisationModel object to be used in unit testing. We can also switch databases (theoretically) but providing a -dsn command-line flag.