How do you work with the status of the order?



  • The architectural issue is bigger. There's the nature of the Order, he has a status - completed, assembled, created, etc. There is the essence of the Order. Both are presented in the OBD tables. How am I supposed to limit my job in a code of order? Hard-coded constants don't want to, but you're gonna have to do a status sample to, like, get down to 1c.



  • The question is, what framework do you want to discuss architecture? In the PLO paradigm? Or a reflex OBD architecture? If it's the first one, it's a code like this:

    public class DeliveredOrderCollectionTest
    {
        private DataContext storage;
    
    [SetUp]
    public void setUp()
    {
        this.storage = new DataStorage();
    }
    
    [Test]
    public void Get_Order_collection_test()
    {
        IEnumerable<Order> orders = this.storage.Get<IEnumerable<Order>>();
    
        Assert.IsNotNull(orders);
        Assert.AreEqual(0, orders.Count());
    }
    
    [Test]
    public void Get_FormedOrder_collection_test()
    {
        IEnumerable<FormedOrder> formedOrders = this.storage.Get<IEnumerable<FormedOrder>>();
    
        Assert.IsNotNull(formedOrders);
        Assert.AreEqual(0, formedOrders.Count());
    }
    
    [Test]
    public void Get_DeliveredOrder_collection_test()
    {
        IEnumerable<DeliveredOrder> deliveredOrders = this.storage.Get<IEnumerable<DeliveredOrder>>();
    
        Assert.IsNotNull(deliveredOrders);
        Assert.AreEqual(0, deliveredOrders.Count());
    }
    

    }

    If the business logic (using primary records), the order status can be clearly compared with the issuance of these primary documents as the order is processed:

    • The client threw the goods in the basket and pressed the button to put "formed"
    • Discharge The bank has a record of the client's fee-paid.
    • The consignment has been transferred according to Consignment "formed"
    • Delivery delivered the order according to consignment note The courier is "directed."
    • Courier returned the client-signed Transport consignment note - "delivered."

    Accordingly, we have records of these primary documents in the system (base) compared with the original order.


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2