Planned Order Implementation| Table of Contents | |||||||||||||||
| Environment: Planned Order Domain A set of Bounded Context implemented to support the selection of parts and an order. Notes: This environment will be built and deployed in a Express/Nodejs back end and a MySql Database Using Sequelize ORM
|
|||||||||||||||
| Environment: Planned Order Front End This environment will implemented with a React and React Bootstrap framework. Notes: The Document Object Model in the Browser. Implemented with HTML and scripts
|
|||||||||||||||
{
"Introduction": "This is the specification in a JSON format",
"Assertions": [
{
"BaseAssertion": {
"ActivityType": "RETRIEVAL",
"Description": "Retrieve Customer details for a given Customer ID. Implemented in Customer Entity. Initiated by the Planned Order UI.",
"Specification": "Method:\nGET GetCustomerDetailsForCustomerID\nReturn a single record for a Customer",
"DBID": "13230",
"SpecID": "OE04",
"Name": "Customer",
"Authority": "Sales Manager",
"ImplementationNote": "For the NV environment this is seen as an Entity that shows all Customers. And an SQL query for a CustomerID.\n",
"ModelNote": "This retrieval is used to add the customer address when they make an order.\nThis can be simply tested using PostMan with a customerID. ",
"UINote": "None Automatic",
"Attributes": [
{
"Name": "First Name",
"Type": null,
"Description": "Customer First name",
"ExampleValue": "Mo\n"
},
{
"Name": "Customer Number",
"Type": "STRING",
"Description": "Unique identity for external identification",
"ExampleValue": " PPC342"
},
{
"Name": "Last Name",
"Type": "STRING",
"Description": "Customer last name",
"ExampleValue": " Jones"
},
{
"Name": "Full Address",
"Type": "STRING",
"Description": "Delivery address to support courier delivery.\nValidation: text to identify location.\n",
"ExampleValue": " 1234 Any St., Ohioville, PA"
}
]
}
},
{
"BaseAssertion": {
"ActivityType": "RETRIEVAL",
"Description": "Retrieve details about the Part to support the Planned Order UI. -- An Entity retrieval. -- Initiated from Parts Filter UI",
"Specification": "Method:\nPOST: GetDetailsForPartIDs-\nReturn all parts details for the PartID",
"DBID": "13232",
"SpecID": "OE06",
"Name": "Part (pr)",
"Authority": "Catalog Manager",
"ImplementationNote": "For the NV environment this is seen as an Entity that shows all products. And an assembled SQL query.",
"ModelNote": " Although automatic, the Catalog Manager is responsible for maintining the catalog and this assertion that deliivers it. \nThis is a second retrieval from the Parts Entity (similar to OE18r)\nThis retrieves by PartIDs.\nThis can be simply tested using PostMan with a filter. The filter is provided in the body of the HTTP request.\nThis is used by Planned Order using a PULL connection. ",
"UINote": "None: Automatic.",
"Attributes": [
{
"Name": "productid",
"Type": "UUID",
"Description": "Internal UUID for persistent integrity",
"ExampleValue": "43099&99aj"
},
{
"Name": "categoryId",
"Type": "STRING",
"Description": "Category for filtering.\nVallidation: Must be listed in the Category Entity ",
"ExampleValue": " 3099u75i3"
},
{
"Name": "Part Description(description)",
"Type": "STRING",
"Description": "Semi structured narrative of use of part and installation details.",
"ExampleValue": "A wing mirror that can be fitted to any vehicle."
},
{
"Name": "unitPrice",
"Type": "CURRENCY",
"Description": "Price in CAD.\nValidation: Must be dollar amount.\nValidation: Cannot be set to zero.",
"ExampleValue": " 12.99"
},
{
"Name": "SKU",
"Type": "STRING",
"Description": "Stock Keeping Unit. Identifier, unique within this organization.\nValidation: Must be unique. Integer ascending by datetime.",
"ExampleValue": "3387 "
},
{
"Name": "Name",
"Type": "STRING",
"Description": "Short identifying name to support search and match to physical product.\nValidation: Unique within Products.\n",
"ExampleValue": " "
}
]
}
},
{
"BaseAssertion": {
"ActivityType": "CONFIGURATION",
"Description": "A collection of Planned Part Items for a Customer. Implemented in the UI and used to determine total costs.\n",
"Specification": "The Customer must inspect the Product Catlog in order to determine Product capabilities, fit, and prices. For this Simple example we assume they have a way of inspecting available parts subsetted by category items. ---Customer must decide to add an order item to the Planned Order (they have not comitted to buy yet). They can submit this information to the business rule that automatically determines total costs and shipping. ",
"DBID": "13233",
"SpecID": "OE07",
"Name": "Planned Order",
"Authority": "Customer(Sales)",
"ImplementationNote": "Probably part of the HTML...",
"ModelNote": "This is a list of Products and quantities that a customer intends to order.\n\nFor Assertum this is a complex type and needs some additional finishing of the types concept.\n\nTBD: The frame needs compex types.\n",
"UINote": "Provide the ability to filter the full product catalog by category.",
"Attributes": [
{
"Name": "Product ID",
"Type": "STRING",
"Description": " Populated from the part selected.\nValidation: Must be in the Product list",
"ExampleValue": " PPP23"
},
{
"Name": "Quantity",
"Type": "STRING",
"Description": " Stated by the shopper.\nValidation: Orders over 100 of one part are not allowed.",
"ExampleValue": "6 "
},
{
"Name": "Price",
"Type": "STRING",
"Description": " Populated from the part selected. \nValidation: must be the price in the Product Catalog\nThe unit price of the part when added to cart.",
"ExampleValue": " $41.89"
},
{
"Name": "orderId",
"Type": "STRING",
"Description": "The cart these items belong to. \nValidation: auto generated on creation.",
"ExampleValue": "(*98&88YT"
},
{
"Name": "customerId",
"Type": "UUID",
"Description": "Internal UUID for customer.\nValidation: auto generated on creation.",
"ExampleValue": " (8778J7&*"
},
{
"Name": "Context_UserToken",
"Type": "STRING",
"Description": " A token that controls access to the cubicle and the messages it manages",
"ExampleValue": " 33098&9775"
}
]
}
},
{
"BaseAssertion": {
"ActivityType": "INTENT",
"Description": "Submit the decision to purchase an Order and its Items. ",
"Specification": "Populate the Shipping details from the Customer Record and and the current order from Planned Order.\nThe customer is presented with the full details of the order and committs with an acceptance (contractural).",
"DBID": "13245",
"SpecID": "OE11",
"Name": "Submitted Order",
"Authority": "Customer(Sales)",
"ImplementationNote": "",
"ModelNote": "An interesting assertion. Might be only an emit.\n\nThis is the sales order as it is persisted. It is necessary that the order have automatic business rules applied before it is persisted. This is a business decision. The alternative is that the BR is applied on retrieval. An interesting design point.And this is interesting because it might be modeled with a recursive business rule but the assertion should not emit unless fully populated.If this is customer it is only items and not populated??Once comitted by customer it is persisted. (when received by pu)This is manual because the customer has to inspect it to make the comittment (contractural acceptance).",
"UINote": "",
"Attributes": [
{
"Name": "orderID",
"Type": null,
"Description": "The cart these items belong to.",
"ExampleValue": "example value"
},
{
"Name": "customerID",
"Type": "UUID",
"Description": "Internal UUID for customer",
"ExampleValue": " )76uuyt&*6i"
},
{
"Name": "Unit Price",
"Type": "CURRENCY",
"Description": " Populated from the part selected",
"ExampleValue": " 23.89"
},
{
"Name": "Quantity",
"Type": "INTEGER",
"Description": "Order quantity",
"ExampleValue": " 7"
},
{
"Name": "Shipping Address",
"Type": "STRING",
"Description": "Text from customer record.",
"ExampleValue": " 234 Kansas Drive, Kansas"
},
{
"Name": "Product ID",
"Type": "STRING",
"Description": "Non internal Prodct ID from catalog",
"ExampleValue": " &67t%455uT6%"
}
]
}
},
{
"BaseAssertion": {
"ActivityType": "PERSIST",
"Description": "Retain the Sales Order submitted by the Customer. A Create for the Full Sales Order Aggregate.",
"Specification": "\nMethod: Create aggregate\n\n\nValidate and persist the Sales Order including Order Items.",
"DBID": "13246",
"SpecID": "OE12",
"Name": "Full Sales Order (pu)",
"Authority": "Sales Manager",
"ImplementationNote": "An aggregate to persist the order.",
"ModelNote": "This represents an acceptance by the customer of the offer by the Product organization. A contract is created.\nAs such, its information is Financial, Personal, and an organizatinal Record.\nFrom the Comitted Sales Order OE11.\nThe aggregate record is presented for persistence because the Customer has submitted the Order.\nSome feedback is needed to confirm the order. (not currently shown)\n",
"UINote": "No UI",
"Attributes": [
{
"Name": "CustomerID",
"Type": null,
"Description": "Internal UUID for customer\nValidation: Must be an existing id from Customer Entity",
"ExampleValue": " )76uuyt&*6i"
},
{
"Name": "ShippingAddress",
"Type": "STRING",
"Description": "Text from customer record.\nValidation: Must be deliverable",
"ExampleValue": " 432 Kansas Drive, Kansas City, Kansas"
},
{
"Name": "OrderId",
"Type": "STRING",
"Description": "The customer order these items belong to.\nValidation: Must be a an existing OrderID for all but create.",
"ExampleValue": " (77U77FFdeetS7768(7"
}
]
}
},
{
"BaseAssertion": {
"ActivityType": "RETRIEVAL",
"Description": "Retrieve the set of Parts that satisfy filter criteria, and the details for each\n",
"Specification": "Method: \nPost GetAvailablePartsForFilter\nSelect all parts that match any of the filter items.",
"DBID": "13254",
"SpecID": "OE18r",
"Name": "Available Parts List (pr)",
"Authority": "Catalog Manager",
"ImplementationNote": "This should be implemented in the Parts Entity.\nIt provides a retrieve method, GetAvailablePartsForFilter, to support the client.\nThe method should be exposed in the Parts Service and will be used in the Client to show the parts that meet the filter search criteria.\n- Since this is used by UI the error trapping from the failed response must indicate a reason and re-try suggestions.\n\nIn this implementation this uses a view built on the partscategory table to impelement.",
"ModelNote": " Although automatic, the Sales Manager is responsible for maintining the catalog and this assertion that filters it. \nWarehouse is not included in IMP1.\nAssumption that this is a Part entity, described by the attribute of the assertion.\nThis can be simply tested using PostMan with a filter. The filter is provided in the body of the HTTP request.\nThis is used by Planned Order using a PULL connection. \nThe AM identifies a separate connection for the request but this can be implemented as a simple retrieve.\n\n",
"UINote": "None: Auto\n\n",
"Attributes": [
{
"Name": "PartID",
"Type": "STRING",
"Description": "Interchangable ID",
"ExampleValue": " PPP334"
},
{
"Name": "UnitPrice",
"Type": "STRING",
"Description": "Price as of start of Cart",
"ExampleValue": " $45.00"
},
{
"Name": "ShortDescription",
"Type": "STRING",
"Description": "Short Description by PP",
"ExampleValue": " Brake Pad for Truck"
},
{
"Name": "PartUUID",
"Type": "STRING",
"Description": "EntityID",
"ExampleValue": " part1"
},
{
"Name": "PartName",
"Type": "STRING",
"Description": "-- New Desc -- ",
"ExampleValue": " BrakeMaster"
}
]
}
},
{
"BaseAssertion": {
"ActivityType": "DECISION",
"Description": "A UI Request to find a set of Parts that make up a Filter. Implemented in the UI.\n",
"Specification": "List the shopper, the category, and a category item to be included in a search.",
"DBID": "13255",
"SpecID": "OE19",
"Name": "Parts Filter",
"Authority": "Customer(Sales)",
"ImplementationNote": "Implemented by a list of Categories and Values.\nThis is presented and changed using a multiselect from all categories and values.\n",
"ModelNote": "See the categories Entity for sturcture of possible categories and thier values.This Entity retains the state of the shoppers filter.They adjust the filter ie their set of categories and values until they are ready to ask for the list of available parts. Example: Choose one or more manufacturers from this list (Tesla, Toyota,Ferrari,BMW).\nChoose Vehicle Type from this list (Automobile, MotorCycle, Scooter, Truck, Bus, Van). The input includes information about the categories and their items. (this is not required for the initial demonstration.",
"UINote": "The UI presents a multiselect of all the possible filter values, with an indicator showing those currently selected.\nThe current set of the selected category values is emitted to query the parts and return a filtered parts display.\n\n",
"Attributes": [
{
"Name": "CategoryName",
"Type": "STRING",
"Description": "Identity for which catefory this shopper has identified a search item",
"ExampleValue": "VehicleType"
},
{
"Name": "SelectedCategoryItem",
"Type": "STRING",
"Description": "Value from enumeration of Items for a category",
"ExampleValue": " SUV"
}
]
}
},
{
"BaseAssertion": {
"ActivityType": "RETRIEVAL",
"Description": "Retrieve all the Category and Category Items to support the Planned Order UI",
"Specification": "Mrthod:\nGET GetAllCategoryItems\n- select all rows in the CategoryItem table. ",
"DBID": "13273",
"SpecID": "OE29",
"Name": "Parts Category Items (pr)",
"Authority": "Catalog Manager",
"ImplementationNote": "Implemented by Category Item Entity.\nIt provides a retrieve method, GetAllCategoryItems (with no params), to support the client.\n- Since this is used by UI ,the error trapping from the failed response must indicate a reason and re-try suggestions.",
"ModelNote": "This is used by the Client OE19 Parts Filter to provide choices to search the parts catlog for parts that (for example) are just for Mercedes Trucks.\nThis is the CategoryItems Entity decribed by the attributes of this assertion.\nThis can be simply unit tested using PostMan with a filter. The filter is provided in the body of the HTTP request.\nThis is used by Planned Order in the Client using a PULL connection.",
"UINote": "None: Automatic",
"Attributes": [
{
"Name": " General Comments",
"Type": null,
"Description": " ",
"ExampleValue": "This Frame is included here as a composite. When a part is characterized this way (F150) the part fits an F150."
},
{
"Name": "Category Name",
"Type": "STRING",
"Description": "Name of one of the ways Parts are characterized.",
"ExampleValue": " Vehicle Type"
},
{
"Name": "Category Description",
"Type": "STRING",
"Description": "Details on how this categorization is determined.",
"ExampleValue": "Characeristics like truck bed, number of doors, 2 or 4 wheel, weight"
},
{
"Name": "Category Item Name",
"Type": "STRING",
"Description": "A short identifier for the category item",
"ExampleValue": "Truck"
},
{
"Name": "Category Item Description",
"Type": "STRING",
"Description": "-- New Desc -- ",
"ExampleValue": "Part fits any of the F150 line. "
},
{
"Name": "Category Item Description",
"Type": "STRING",
"Description": "Assistance in deciding if the part fits the individual item choice.",
"ExampleValue": " Has a truck bed, wide wheelbase and low gearing."
}
]
}
},
{
"BaseAssertion": {
"ActivityType": "CALCULATION",
"Description": "A result of the application of the business rule that calculates taxes, shipping, and totals for an order and its items.",
"Specification": "Tax is 5% of the total. Shipping(is taxed) is 10% of the total, or 8% for orders over $1000.",
"DBID": "13287",
"SpecID": "BR02",
"Name": "Order Total Costs",
"Authority": "Sales Manager",
"ImplementationNote": "This business rule serves the UI (as modeled). It is calculated and displayed in the UI but is part of the Order, and would serve as an invariant in th order too.\n\n The order items and quantities are required to calculate this.\nWho Implements this?\nPerhaps the js function is passed to the FE/Client to be used. IE as part of the build.\nCode-wise this module is in both the Client and Server.\nFirst, how to implement in FE?\nThis should be a function in order that takes the orderItems and populates the teotal fields. We know that order is an agregate. We need to define the java record\nTypes does this. How does the no valid data get into the Order aggregate.\nI could write text, leet, js to be placed into the BC ie BinComp. BinComp has to have \nget etc defined.\nLets do this in node. using CoP. First describe orderAggregate as a compex type in AM. Then generate the tables. (I have done this somewhere). Then create the crud methods as endpoints All this should/could be generated\n\nBR02 and Orde ent are combined.\nWhen I am done (acceptatnce) I will have an order entry aggregate that has some validations, an internal BRule. And a 'service' that offers get, update,delete,execute!\nWhich I can use with PMan to add records etc.\nIt can then be added as a service that OrdEnt uses to capture the order.\nThis looks like two weeks work.",
"ModelNote": "This business rule is the responsibility of the Sales Manger.\nThis is currently specified by text. but when implemented a function would automatically calculate the values.\n\n\nThis can be a separate bindable component?\nIs this a Value Item?\nThis is definitely a business rule. But where does this 'reside'? Is it passed to the FE to execute or does each time the items change does the FE ask the aggregate for values?\nA CHALLENGE QUESTION FOR IMPLEMENTATION DESIGN ",
"UINote": "",
"Attributes": [
{
"Name": "Total Ordered Items",
"Type": "CURRENCY",
"Description": "Sum of quantity * unit price",
"ExampleValue": "$5234"
},
{
"Name": "Shipping",
"Type": "STRING",
"Description": "10% (if total is > $1000 - 8%)",
"ExampleValue": " $320"
},
{
"Name": "Total With Shipping",
"Type": "STRING",
"Description": "-- New Desc -- ",
"ExampleValue": " $5789"
},
{
"Name": "Tax",
"Type": "STRING",
"Description": "5%",
"ExampleValue": " $289"
},
{
"Name": "Total Payable",
"Type": "STRING",
"Description": "Items + Shipping + Tax",
"ExampleValue": " $5976"
}
]
}
}
]
}