How to depict possible limiting factor/instances in class diagrams?

Hi!

I’ve recently started a comp sci program, and my study group and I are doing one of the intro courses on object oriented programming. One of our current tasks involves making a class diagram for a shirt printing business, but I’m stuck.

In this system, all types of shirts have four “print areas”. However, some (but not all) manufacturers can limit which areas are available (e.g. if their brand logo is in print area 1, the customer can’t choose to print something there). Different print areas are priced differently.

My question: How do I depict a sometimes limiting factor? Not all manufacturers will impose the same limit, and there’s a generic option with no limits and no listed manufacturer at all.

Another similar situation is the relationship between total order price, VAT, and possible discounts - we always have a total order price, to which VAT is always applied. Order total and VAT are directly affected by a discount, but neither are affected if no discount is applied.

I’ve tried connecting (order invoice) - (discount) - (VAT), but that implies that the VAT requires/is only applied if there’s a discount. But if I do (order invoice) - (VAT) - (discount), that looks like the discount is associated with the VAT and not the whole order. And if I just directly connect (VAT) and (discount) to (order invoice), then I have nothing to show that the VAT includes the effect of the discount.

We’ve tried asking our professor and the TAs, but they mostly just disparage us for not already understanding this after two weeks (of almost exclusively independent study). We had one helpful TA last week, but don’t have access to them anymore.

I’ll very much appreciate any and all hints, tips, explanations, or suggestions for reference material that might help clarify this!

You need speclaise the shirt class; also use {} constraint relationship and consider a “rules” class