This repository has been archived by the owner on Sep 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1743 from 18F/wml-3663-kickback-status
[3663] set kickback status
- Loading branch information
Showing
24 changed files
with
175 additions
and
56 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
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,22 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/18F/e-QIP-prototype/api" | ||
"github.com/18F/e-QIP-prototype/api/admin" | ||
"github.com/18F/e-QIP-prototype/api/cmd" | ||
"github.com/18F/e-QIP-prototype/api/log" | ||
) | ||
|
||
func main() { | ||
logger := &log.Service{Log: log.NewLogger()} | ||
cmd.Command(logger, func(context api.DatabaseService, store api.StorageService, account *api.Account) { | ||
rejector := admin.NewRejecter(context, store) | ||
|
||
rejectErr := rejector.Reject(*account) | ||
if rejectErr != nil { | ||
logger.WarnError("Failed to kickback", rejectErr, api.LogFields{"account": account.Username}) | ||
} else { | ||
logger.Warn("Account kicked back", api.LogFields{"account": account.Username}) | ||
} | ||
}) | ||
} |
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
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
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,18 @@ | ||
|
||
-- +goose Up | ||
-- SQL in section 'Up' is executed when this migration is applied | ||
-- +goose StatementBegin | ||
ALTER TABLE accounts ADD COLUMN status text NOT NULL DEFAULT 'INCOMPLETE'; | ||
UPDATE accounts SET status = 'SUBMITTED' WHERE locked = true; | ||
ALTER TABLE accounts ALTER COLUMN status DROP DEFAULT; | ||
ALTER TABLE accounts DROP COLUMN locked; | ||
-- +goose StatementEnd | ||
|
||
-- +goose Down | ||
-- SQL section 'Down' is executed when this migration is rolled back | ||
-- +goose StatementBegin | ||
ALTER TABLE accounts ADD COLUMN locked bool NOT NULL DEFAULT false; | ||
UPDATE accounts SET locked = true WHERE status = 'SUBMITTED'; | ||
ALTER TABLE accounts ALTER COLUMN locked DROP DEFAULT; | ||
ALTER TABLE accounts DROP COLUMN status; | ||
-- +goose StatementEnd |
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 |
---|---|---|
|
@@ -33,6 +33,7 @@ func TestAccountPersistence(t *testing.T) { | |
Email: "[email protected]", | ||
FormType: "SF86", | ||
FormVersion: "2017-07", | ||
Status: api.StatusIncomplete, | ||
ExternalID: uuid.New().String(), | ||
} | ||
|
||
|
Oops, something went wrong.