Is this a textbook design pattern, or did I come up with something new?

I’m getting tired of developing a set of tables in which I came up with an architecture that I was very pleased with! I have never seen it anywhere before, so I would like to know if I just invented the wheel (most likely), or if this is a real innovation.

Here is a description of the problem: I have Employeessomeone who can sign another contract with the company. Each employee can perform different actions, and each type of activity can have a different pay rate, sometimes a fixed amount to complete one action, sometimes an hourly rate, and sometimes at the rate level. There may also be a specific client who especially loves an employee, so when he works with this particular client, he gets a higher rate. And if the speed is not determined, he gets the standard rate of the company.

Do not worry about the details: the main thing is that there are many payment rates that can be determined, each in a rather complicated way. And all payment rates have the following in common:

  • Service type
  • Type of payment scale (transfer: fixed amount / hourly rate / level)
  • Fixed amount (if PayScaleType = FA)
  • Hourly rate (if PayScaleType = HR) - yes, it can be combined into one field, but for reasons that I will not enter, I saved them separately
  • Levels (1-> n relationship with all levels and the amount paid after you have crossed the level threshold)

These payment rates apply to:

  • Default bid
  • Employee level
  • Employee Override Metric (defined for each customer)

, PayRate PayRateTier Linq, 3 , - . . , .

, ? , PayRatePackage, ID. PayRate FK PayRatePackage PayRateTier FK PayRate. DefaultCompanyPayRate FK PayRatePackage, EmployeeRate EmployeeOverrideRate.

- !

( , , , SO, . , , - .)

, , - -, , . - ?:)

+3
2

,

" , . , ".

+6

. ... ...

+5

Source: https://habr.com/ru/post/1712693/


All Articles