-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
57 changed files
with
2,611 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[Description of commits made] | ||
|
||
**Related issue:** [issue (e.g. #1)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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 | ||
|
@@ -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: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.