As part of implementing PAG-1353 we propose an addition to the In Season Catalog Customer Choice HTTP API that will permit the creation of Store Planning Management (SPM) overrides.
Things that the final implementation must permit:
- Create an SPM override-value for a SKU + location combo
- Create an SPM override-value for a CC + location combo
Adam and Jim began adding SPM override capabilities to the Catalog Service. The following example demonstrates how a user would create a a single SPM override associated with a customer choice w/id f9a45623-f427-4405-a6c7-efc7f9ffe776
:
Request:
HTTP POST
/allocation/in-season/allocated-customer-choices/ti-overrides
{
"id": "f9a45623-f427-4405-a6c7-efc7f9ffe776",
"ccOverrides": [
{
"locationId": "01d13476-793b-4220-8a57-00425d6b9af6",
"overrideValue": 24.0,
"overrideFactor": null,
"expirationDate": "2017-06-15",
"effectiveDate": "2017-01-01"
}
]
}
Response:
HTTP 200 OK "TI overrides successfully saved"
Thoughts on this design:
- It is not immediately apparent (to me) how this design would be extended to support SKU + location-level overrides
overrideFactor
can be applied by clients for purposes of effecting a newoverrideValue
- as such, it can be removed from the APIeffectiveDate
can be removed from the API ifoverrideFactor
is removed from the API- It is not clear to me if this design permits clients to remove SPM overrides from locations after they've been created (the PDM states that they expect a planner to nullify an override by setting its expiry date to sometime in the past)
- Unsure if this is a goal: It is not immediately apparent to me how this design could be extended to admit New Store overrides
This proposal addresses items #1
, #2
, #3
and #4
from above - but admits only SPM overrides (does not address #5
):
Request:
HTTP POST
/allocation/in-season/allocated-customer-choices/ti-overrides
{
"level_identifier_type": "CUSTOMER_CHOICE_ID",
"level_identifier_value": "f9a45623-f427-4405-a6c7-efc7f9ffe776",
"location_id": "01d13476-793b-4220-8a57-00425d6b9af6",
"expiry_date": "2016-06-15",
"value": 25.6
}
Response:
HTTP 204 No Content
Request:
HTTP POST
/allocation/in-season/allocated-customer-choices/ti-overrides
{
"level_identifier_type": "SKU_NBR",
"level_identifier_value": "1895510210000",
"location_id": "01d13476-793b-4220-8a57-00425d6b9af6",
"expiry_date": "2016-06-15",
"value": 15
}
Response:
HTTP 204 No Content
Notes:
- "Create SPM" is an idempotent operation; previous override matching location and customer choice id is replaced (note: overrides cannot be deleted, only replaced)
- SKU and CC-level overrides are visible in the In Season Catalog Customer Choice JSON (implementation: TBD)
- Overrides do not have identity (they are subordinate to/embedded within some other HTTP "resource")
- URL handles creation of SPM overrides only (you'll note that there's no way to specify a
version
or that the override relates to a new-location instead of location)
This proposal addresses items #1
, #2
, #3
, #4
, and #5
from above:
Request:
HTTP POST
/allocation/in-season/allocated-customer-choices/ti-overrides
{
"version": "STORE_PLANNING_MANAGEMENT",
"level_identifier_type": "CUSTOMER_CHOICE_ID",
"level_identifier_value": "f9a45623-f427-4405-a6c7-efc7f9ffe776",
"location_identifier_type": "LOCATION_ID",
"location_identifier_value": "01d13476-793b-4220-8a57-00425d6b9af6",
"expiry_date": "2016-06-15",
"value": 25.6
}
Response:
HTTP 204 No Content
Request:
HTTP POST
/allocation/in-season/allocated-customer-choices/ti-overrides
{
"version": "NEW_STORE",
"level_identifier_type": "SKU_NBR",
"level_identifier_value": "1895510210000",
"location_identifier_type": "NEW_LOCATION_ID",
"location_identifier_value": "fdbb9d86-34a8-47d2-b498-b4b5dbac82cc",
"expiry_date": "2016-06-15",
"value": 25.6
}
Response:
HTTP 204 No Content
Notes:
- Permits associating the override with either a new-location or a location (
NEW_LOCATION_ID
orLOCATION_ID
) - Permits different override "verions":
NEW_STORE
andSTORE_PLANNING_MANAGEMENT
@bentona
Nope, that's a typo.
Nope, not strictly necessary. The Business has been using the term "versioned TI" to mean some grouping of TI-calculation-or-override-application-outputs that might have included a "New Store override" or an "SPM override." We should probably get some consensus on this term before codifying it into source code.
I tried to use the fancy word "corollary" after using the fancy word "idempotent" and I failed; the fact that the create-override action is idempotent has nothing to do with the lack of an explicit delete-override function. My bad.
The current implementation would allow a client to create, in bulk, lots of overrides for the same CC - but different stores - in the same HTTP request. I don't think our designs actually show that as a common access pattern, do they?
Anyhow, Daniel and Peter's guidance to us has been: Make lots of little HTTP requests [between services] instead of fewer, larger HTTP requests. I don't have a strategy for creating overrides in bulk - because I don't think we need to create overrides in bulk.
Good question.
A "location" is the name of a thingy that the Store Service gives us.
A "new-location" is a thingy that the Catalog Service gives us.
A location typically corresponds to a store that Gap will do business at - either already, or in the future.
A new-location is a grab-bag of data imported from various places when a store planner initiates the "New Store process" using the tool that C5 LA built, New Store. It includes a copy of some of the information about a location, some information about customer choices, and some copied TI information.
A new-location must be associated with only one location.
There must exist no two new-location associated with the same location.
There may exist a a location that no new-location is associated with.
We could, but I like
level_identifier_type
better.