wyngle/dissect — pull request #13 by pmatsinopoulos (2013-08-24 07:37:21+00:00)
Title: WIP - Demo for parsing acm.txt files

Hmmmm....That is an approach. See the file "parse_acm_spec.rb" file. It does parsing. run on the command line: `rspec spec/parse_acm_spec.rb` and you will see that it identifies order number and order lines.

We can build an object-oriented approach of a family of such parsers. They do not have to be yml supported/configured always. Simple custom parsers per partner.

How does it sound?

Note 1: the sample parser that I have implemented in parse_acm_spec.rb is only a demonstration of the idea. It will not be exactly like that ... will try to follow some good oo principles ... but I think you get the picture.

Note 2: There are some problems with VAT (Φ.Π.Α.) on the ACM order. Does not have the percentage. It has to be calculated. And secondly, does not have the VAT per order line, as we have in on our model. We have to take the percentage and calculate the VAT per order line. But this is acceptable I suppose.

Note 3: On Apollo::Order we have :total as a property. Is it the total including VAT or not?

Note 4: We have transferred the concept of Partner Commission and Member Cashback on the order line level. It makes the system more, but it has a caveat. It does not allow Partner Commissions and Member Cashbacks on the total value of the order. As I can see the total value of the order might not be the sum of the values of the order lines. Because there might be some discounts or surcharges on the total amount / sum of all order lines. E.g. if you order more than 50 Euro you get 2.5% discount. In that case, I suppose that the Partner would like to give commission on the final amount of the order and Wyngle would like to give Cashback on that corresponding amount too. Am I wrong? I think we need some feature tuning here.

Note 5: Probably cont'd from note 4. Is that clear that when Partner declares its commission he is essentially declares commission on order line level? If not, this is what now happens and this is what it has to be communicated to Partner agreement (Terms of Service ?).

P.

P.S. I have written some notes on this Pull Request, but we may need to decompose them and create corresponding issues on other projects.