Skip to content

Commit

Permalink
Merge 8ba174b into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
alvintangz authored May 21, 2021
2 parents 82d1c6c + 8ba174b commit 1576418
Show file tree
Hide file tree
Showing 57 changed files with 2,611 additions and 18 deletions.
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Bug
about: Report a bug
title: 'Bug: [Short description]'
labels: bug
assignees: alvintangz

---

## Prerequisites

* [ ] I searched to see if the issue already exists.
* [ ] Are you running the latest version?

## Description

[Description of the bug]

## Steps to Reproduce

1. [First Step]
2. [Second Step]
3. [and so on...]

## Expected behaviour

[What you expected to happen]

## Actual behaviour

[What actually happened]

## Screenshots

[If applicable, add screenshots to help explain your problem]
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Feature request
about: Suggest an idea for this project
title: 'Feature: [Short description]'
labels: enhancement
assignees: alvintangz

---

## Prerequisites

* [ ] I searched to see if the issue already exists.
* [ ] Are you running the latest version?

## Description of the problem

[Description of the problem]

## Potential Solutions

[Add potential solutions here]

## Screenshots

[If applicable, add screenshots to help explain your problem]
3 changes: 3 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Description of commits made]

**Related issue:** [issue (e.g. #1)]
12 changes: 11 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ jobs:
ref: main
token: ${{ secrets.ADMIN_ACCESS_TOKEN }}

- name: Configure Git user
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
- name: Merge main into stable branch
uses: devmasx/[email protected]
with:
Expand Down Expand Up @@ -73,7 +78,7 @@ jobs:
git add .
git status
if [ -n "$(git status --porcelain)" ]; then
git commit -m ':memo: Auto generated docs in `docs/${{ github.event.inputs.version }}`.'
git commit -m 'docs: Auto generated CLI docs in `docs/${{ github.event.inputs.version }}`.'
git push
fi
Expand All @@ -96,6 +101,11 @@ jobs:
fetch-depth: 0
token: ${{ secrets.ADMIN_ACCESS_TOKEN }}

- name: Configure Git user
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
- name: Merge stable into main branch
uses: devmasx/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ jobs:
git add .
git status
if [ -n "$(git status --porcelain)" ]; then
git commit -m ':memo: Auto generated docs in `docs/source`.'
git commit -m 'docs: Auto generated CLI docs in `docs/source`.'
git push
fi
9 changes: 4 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ changelog:
sort: asc
filters:
exclude:
- '\bdocs?\b'
- '\btests?\b'
- '\bworkflows?\b'
- '\bactions?\b'
- '\bREADME\b'
- '^docs'
- '^test'
- '^ci'
- '^Merge'
- Merge pull request
- Merge branch
release:
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,20 @@
<br/>

<div align="center">
<a href="https://github.com/Vaccine-Hunters-Canada/VaxFinder-admin-cli/releases">
<img src="https://img.shields.io/github/v/release/Vaccine-Hunters-Canada/VaxFinder-admin-cli?include_prereleases" alt="Latest Release" />
</a>
<a href="https://golang.org/dl/">
<img src="https://img.shields.io/github/go-mod/go-version/Vaccine-Hunters-Canada/VaxFinder-admin-cli" alt="Go v1.15">
<img src="https://img.shields.io/github/go-mod/go-version/Vaccine-Hunters-Canada/VaxFinder-admin-cli" alt="Go v1.15" />
</a>
<a href="https://goreportcard.com/report/github.com/Vaccine-Hunters-Canada/VaxFinder-admin-cli">
<img src="https://goreportcard.com/badge/github.com/Vaccine-Hunters-Canada/VaxFinder-admin-cli" alt="Go Report Card">
<img src="https://goreportcard.com/badge/github.com/Vaccine-Hunters-Canada/VaxFinder-admin-cli" alt="Go Report Card" />
</a>
<a href="https://github.com/Vaccine-Hunters-Canada/VaxFinder-admin-cli/actions/workflows/test.yml">
<img src="https://img.shields.io/github/workflow/status/Vaccine-Hunters-Canada/VaxFinder-admin-cli/Go%20Test/main?label=Tests&logo=github" alt="Tests" />
</a>
<a href="https://github.com/Vaccine-Hunters-Canada/VaxFinder-admin-cli/actions/workflows/docs.yml">
<img src="https://img.shields.io/github/workflow/status/Vaccine-Hunters-Canada/VaxFinder-admin-cli/CLI%20Docs%20(main)?label=Build%20Docs&logo=github" alt="Build Docs" />
</a>
<a href="https://discord.com/channels/822486436837326908/832366009091358731">
<img src="https://img.shields.io/badge/-%23vax--ui--backend-7389D8?logo=discord&logoColor=ffffff&labelColor=6A7EC2" alt="Discord: #vax-ui-backend" />
Expand Down
2 changes: 1 addition & 1 deletion cmd/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var addressListCmd = &cobra.Command{
RunE: list.CmdRunE,
}

// Command: `vf-admin address add <id>`
// Command: `vf-admin address add`
var addressAddCmd = &cobra.Command{
Use: "add",
Short: "Add a new address",
Expand Down
117 changes: 117 additions & 0 deletions cmd/location.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
package cmd

import (
"vf-admin/internal/cmdrun/location/add"
"vf-admin/internal/cmdrun/location/get"
"vf-admin/internal/cmdrun/location/list"
"vf-admin/internal/cmdrun/location/remove"
"vf-admin/internal/cmdrun/location/update"

"github.com/MakeNowJust/heredoc"
"github.com/spf13/cobra"
)

// Command: `vf-admin location`
var locationCmd = &cobra.Command{
Use: "location",
Short: "Manage locations",
}

// Command: `vf-admin location get <id>`
var locationGetCmd = &cobra.Command{
Use: "get",
Short: "Retrieve a location with a specified id",
Example: heredoc.Doc(`
# Get the location with id 1.
$ vf-admin location get 1
`),
Args: cobra.ExactArgs(1),
RunE: get.CmdRunE,
}

// Command: `vf-admin location list`
var locationListCmd = &cobra.Command{
Use: "list",
Short: "Retrieve a list of locations",
Args: cobra.ExactArgs(0),
Run: list.CmdRun,
}

// Command: `vf-admin location add <id>`
var locationAddCmd = &cobra.Command{
Use: "add",
Short: "Add a new location",
Example: heredoc.Doc(`
# Add a new active location with name "Guelph Hospital", postal code "N1E 4J4", website URL "http://www.gghorg.ca/", phone "(519) 822-5350", notes "Please call ahead to make an appointment.", tags "Guelph, Appointment", organization id 23 and address id 352.
$ vf-admin location add --active 1 --name "Guelph Hospital" --postcode "N1E4J4" --url "http://www.gghorg.ca" --phone "(519) 822-5350" --notes "Please call ahead to make an appointment." --tags "Guelph, Appointment" --organization 23 --address 352
`),
Args: cobra.ExactArgs(0),
RunE: add.CmdRunE,
}

// Command: `vf-admin location update <id>`
var locationUpdateCmd = &cobra.Command{
Use: "update",
Short: "Update a location with a specified id",
Example: heredoc.Doc(`
# Update the location with id 15 to be active, have name "Guelph Hospital", postal code "N1E 4J4", website URL "http://www.gghorg.ca/", phone "(519) 822-5350", notes "Please call ahead to make an appointment.", tags "Guelph, Appointment", organization id 23 and address id 352.
$ vf-admin location update 15 --active 1 --name "Guelph Hospital" --postcode "N1E4J4" --url "http://www.gghorg.ca" --phone "(519) 822-5350" --notes "Please call ahead to make an appointment." --tags "Guelph, Appointment" --organization 23 --address 352
`),
Args: cobra.ExactArgs(1),
RunE: update.CmdRunE,
}

// Command: `vf-admin location remove <id>`
var locationRemoveCmd = &cobra.Command{
Use: "remove",
Short: "Remove a location with a specified id",
Example: heredoc.Doc(`
# Remove the location with id 8.
$ vf-admin location remove 8
`),
Args: cobra.ExactArgs(1),
RunE: remove.CmdRunE,
}

func init() {
RootCmd.AddCommand(locationCmd)

// Get command
locationCmd.AddCommand(locationGetCmd)

// List command
locationCmd.AddCommand(locationListCmd)

// Add command
locationAddCmd.Flags().String("name", "", "name of location")
_ = locationAddCmd.MarkFlagRequired("name")
locationAddCmd.Flags().Int("active", 1, "is this location active? 1 or 0")
_ = locationAddCmd.MarkFlagRequired("active")
locationAddCmd.Flags().String("postcode", "", "postal code of location")
locationAddCmd.Flags().String("phone", "", "phone number of location")
locationAddCmd.Flags().String("notes", "", "notes about location")
locationAddCmd.Flags().String("url", "", "website URL of location")
locationAddCmd.Flags().String("tags", "", "search tags of location")
locationAddCmd.Flags().Int("organization", 0, "id of organization running location")
locationAddCmd.Flags().Int("address", 0, "id of address of location")

locationCmd.AddCommand(locationAddCmd)

// // Update command
locationUpdateCmd.Flags().String("name", "", "name of location")
_ = locationUpdateCmd.MarkFlagRequired("name")
locationUpdateCmd.Flags().Int("active", 1, "is this location active? 1 or 0")
_ = locationUpdateCmd.MarkFlagRequired("active")
locationUpdateCmd.Flags().String("postcode", "", "postal code of location")
locationUpdateCmd.Flags().String("phone", "", "phone number of location")
locationUpdateCmd.Flags().String("notes", "", "notes about location")
locationUpdateCmd.Flags().String("url", "", "website URL of location")
locationUpdateCmd.Flags().String("tags", "", "search tags of location")
locationUpdateCmd.Flags().Int("organization", 0, "id of organization running location")
locationUpdateCmd.Flags().Int("address", 0, "id of address of location")

locationCmd.AddCommand(locationUpdateCmd)

// Remove command
locationCmd.AddCommand(locationRemoveCmd)
}
2 changes: 1 addition & 1 deletion cmd/organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var organizationListCmd = &cobra.Command{
RunE: list.CmdRunE,
}

// Command: `vf-admin organization add <id>`
// Command: `vf-admin organization add`
var organizationAddCmd = &cobra.Command{
Use: "add",
Short: "Add a new organization",
Expand Down
2 changes: 1 addition & 1 deletion cmd/requirement.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var requirementListCmd = &cobra.Command{
Run: list.CmdRun,
}

// Command: `vf-admin requirement add <id>`
// Command: `vf-admin requirement add`
var requirementAddCmd = &cobra.Command{
Use: "add",
Short: "Add a new requirement",
Expand Down
Loading

0 comments on commit 1576418

Please sign in to comment.