aboutsummaryrefslogtreecommitdiffstats
path: root/timetask/fields.go
AgeCommit message (Collapse)Author
2017-06-03Move 'fields.go' to 'project.go'Teddy Wing
Get rid of all the old commented Fields code. It's no longer used and is no longer relevant. Furthermore, since the only thing left in this file is the `Project` struct, rename the file to 'project.go'.
2017-06-03Project: Remove `Time` fieldTeddy Wing
Time spent on a project can be variable from day to day. The time shouldn't be stored on the project, and should no longer be passed in config.toml. Instead it should be a part of `TimeEntry`, which it now is.
2017-06-03Project: Add a TOML tag for the WorkType fieldTeddy Wing
Otherwise the TOML decoder didn't know how to parse it.
2017-06-03Create a new Project typeTeddy Wing
This corresponds to a "project" entry in the new config2.toml file. (See 13c84cd9973458750305c72a919cf921d9b22b04). Instead of decoding generic `interface{}`s as projects from the TOML, make them a real type. The reason why we're using `int`s where we used to use strings is that the new TOML format will have users write IDs directly in the config file, instead of having the program automatically search for those IDs and use them as we had previously designed. Maybe we'll bring that functionality back at some point, but for now it's too bothersome to implement and I don't consider it worth the trouble.
2017-06-03Comment out all the things!Teddy Wing
Half get rid of a lot of code. I don't like and don't want to use our old field types. Get rid of them and the code in 'http.go' that depends on them. Also get rid of the time entry submission code in 'main.go' as that's going to be redone.
2017-03-12Change all `uint` types to `int`Teddy Wing
Because `strings.Itoa` is so much easier to call than `strconv.ParseUint`, and I needed to parse ints into strings to build the URL params in `buildSubmissionParams` (17f4ecc63615e3f3bef21a80f15e7c7b0e0cffa1).
2017-03-12fields.go: Get rid of unused `thingsByName` functionTeddy Wing
Not relevant. See 89f766854443a6f7ae20c330547083fd0e075ba9.
2017-03-12fields.go: Add methods that allow us to extract objects by nameTeddy Wing
We want to be able to get Client, Project, etc. objects given their name. These functions will look through the fields or objects containing a list of the thing looked for and return if if its name matches the search string. Originally had the idea to generalise the body of the function, but had trouble making the types generic. Still on the table for later if we want to deduplicate the code. For now I'm leaving in the repetition because it works and I don't care with this project.
2017-03-12fields.go: Get rid of `IDName`Teddy Wing
Embedding this struct prevented us from correctly unmarshalling data into them. This is because they need to be created like: Client{IDName{ID: , Name: ,}} The fields can't be added in directly. Save ourselves the headache and just manually repeat the fields. So that importing works right.
2017-03-12Make fields named structsTeddy Wing
We'll be needing to refer to these fields as named types, so create types for them and reference them in the config object.