I have two questions about class diagrams I will use the below as an example,
Question 1: Do we use foreign keys in the fact table in a class diagram like we do when creating entity relation diagrams so below the field customerid is also a property/field in the order class.
Question 2: In the methods section of the class diagram do we show the constructor and getters/setters methods.
UML lets you decide what you want to show or not:
Regarding the operation compartment (aka "method section", in UML a "method" is called "operation"), we represent indeed the relevant operations. The getters and setters can be represented. You can also showw a constructor by preceeding its name with «Create»
. But you don't have to show all the methods, if it doesn't help to better understand the design.
P.S: You didn't ask, but if you're in DB modelling, you may also think about documenting table triggers in the operation compartment.