diff --git a/acme/db/nosql/order.go b/acme/db/nosql/order.go index 6408cd00..5ba54790 100644 --- a/acme/db/nosql/order.go +++ b/acme/db/nosql/order.go @@ -84,9 +84,8 @@ func (db *DB) GetOrder(id string) (*types.Order, error) { return o, nil } -// newOrder returns a new Order type. -func newOrder(db nosql.DB, ops OrderOptions) (*order, error) { - id, err := randID() +func (db *DB) CreateOrder(ctx context.Context, o *types.Order) error { + o.ID, err := randID() if err != nil { return nil, err } @@ -112,7 +111,7 @@ func newOrder(db nosql.DB, ops OrderOptions) (*order, error) { naf = nbf.Add(ops.defaultDuration) } - o := &order{ + dbo := &dbOrder{ ID: id, AccountID: ops.AccountID, Created: now, @@ -123,7 +122,7 @@ func newOrder(db nosql.DB, ops OrderOptions) (*order, error) { NotAfter: naf, Authorizations: authzs, } - if err := o.save(db, nil); err != nil { + if err := db.saveDBOrder(dbo, nil); err != nil { return nil, err } @@ -135,6 +134,10 @@ func newOrder(db nosql.DB, ops OrderOptions) (*order, error) { return o, nil } +// newOrder returns a new Order type. +func newOrder(db nosql.DB, ops OrderOptions) (*order, error) { +} + type orderIDsByAccount struct{} // addOrderID adds an order ID to a users index of in progress order IDs. diff --git a/acme/types/order.go b/acme/types/order.go index f14dc0bb..7e472204 100644 --- a/acme/types/order.go +++ b/acme/types/order.go @@ -18,6 +18,7 @@ type Order struct { Finalize string `json:"finalize"` Certificate string `json:"certificate,omitempty"` ID string `json:"-"` + ProvisionerID string `json:"-"` } // ToLog enables response logging.