From 7ca819fa0416a3567ae6e936da8190a81902d232 Mon Sep 17 00:00:00 2001 From: Dan Anglin Date: Fri, 7 Feb 2020 18:46:21 +0000 Subject: [PATCH] refactor: add structure for start and end dates The start and end dates for employment and education experiences were free-form strings. This commit changes adds a Date struct with Year and Month variables and declares the Duration field as a type Date. The TEX template is updated to reflect the change. The resulting PDF will not change. --- data/cv.json | 70 +++++++++++++++++++++++++++++++++++--------- model.go | 9 ++++-- template/cv.tex.tmpl | 4 +-- 3 files changed, 65 insertions(+), 18 deletions(-) diff --git a/data/cv.json b/data/cv.json index bdf88a8..012a8d1 100644 --- a/data/cv.json +++ b/data/cv.json @@ -89,8 +89,14 @@ "location": "Hatfield, Hertfordshire", "jobTitle": "Platform Automation Engineer", "duration": { - "start": "January, 2017", - "end": "January, 2020" + "start": { + "year": "2017", + "month": "January" + }, + "end": { + "year": "2020", + "month": "January" + } }, "details": [ "I’ve created a Postgres Operator using Go and the Metacontroller which is used to create and manage Patroni PostgreSQL clusters onto production Kubernetes environments.", @@ -108,8 +114,14 @@ "location": "London", "jobTitle": "DevOps Consultant", "duration": { - "start": "March, 2015", - "end": "November, 2016" + "start": { + "year": "2015", + "month": "March" + }, + "end": { + "year": "2016", + "month": "November" + } }, "details": [ "I've built and supported production infrastructure hosted in UKCloud (for public sector projects) and AWS (for commercial projects).", @@ -125,8 +137,14 @@ "location": "Home Office, London", "jobTitle": "DevOps Consultant", "duration": { - "start": "October, 2014", - "end": "March, 2015 " + "start": { + "year": "2014", + "month": "October" + }, + "end": { + "year": "2015", + "month": "March" + } }, "details": [ "I've built and supported new development, CIT and SIT environments for new projects at the Home Office.", @@ -141,8 +159,14 @@ "location": "Worthing", "jobTitle": "Trainee DevOps Consultant", "duration": { - "start": "September, 2014", - "end": "October, 2014" + "start": { + "year": "2014", + "month": "September" + }, + "end": { + "year": "2014", + "month": "October" + } }, "details": [ "I've spent eight weeks in training to become a DevOps Consultant on behalf of QA Consulting.", @@ -157,8 +181,14 @@ "location": "Reading", "jobTitle": "Undergraduate Researcher", "duration": { - "start": "July, 2012", - "end": "September, 2012" + "start": { + "year": "2012", + "month": "July" + }, + "end": { + "year": "2012", + "month": "September" + } }, "details": [ "This was a summer internship where I helped developed an interactive Java application that processes Terahertz signals in order to reveal hidden details behind walls.", @@ -175,8 +205,14 @@ "location": "Reading", "qualification": "MEng (Hons) in Robotics, 2:1", "duration": { - "start": "October, 2009", - "end": "July, 2013" + "start": { + "year": "2009", + "month": "October" + }, + "end": { + "year": "2013", + "month": "July" + } } }, { @@ -184,8 +220,14 @@ "location": "London", "qualification": "A-Levels in Maths, Physics and Product Design", "duration": { - "start": "September, 2007", - "end": "July, 2009" + "start": { + "year": "2007", + "month": "September" + }, + "end": { + "year": "2009", + "month": "July" + } } } ], diff --git a/model.go b/model.go index 5d55ae6..836dda5 100644 --- a/model.go +++ b/model.go @@ -41,6 +41,11 @@ type Experience struct { } type Duration struct { - Start string `json:"start"` - End string `json:"end"` + Start Date `json:"start"` + End Date `json:"end"` +} + +type Date struct { + Year string `json:"year"` + Month string `json:"month"` } diff --git a/template/cv.tex.tmpl b/template/cv.tex.tmpl index 178d357..f007115 100644 --- a/template/cv.tex.tmpl +++ b/template/cv.tex.tmpl @@ -28,7 +28,7 @@ \section{EXPERIENCE} <<- range .Employment>> - \jobsection{<<.Company>>}{<<.Location>>}{<<.JobTitle>>}{<<.Duration.Start>> - <<.Duration.End>>} + \jobsection{<<.Company>>}{<<.Location>>}{<<.JobTitle>>}{<<.Duration.Start.Month>>, <<.Duration.Start.Year>> - <<.Duration.End.Month>>, <<.Duration.End.Year>>} \startitemize <> \item <<.>> @@ -38,7 +38,7 @@ \section{EDUCATION} <> - \jobsection{<<.School>>}{<<.Location>>}{<<.Qualification>>}{<<.Duration.Start>> - <<.Duration.End>>} + \jobsection{<<.School>>}{<<.Location>>}{<<.Qualification>>}{<<.Duration.Start.Month>>, <<.Duration.Start.Year>> - <<.Duration.End.Month>>, <<.Duration.End.Year>>} \startitemize <> \item <<.>>