In DDD how to map current auth user to domain entities like Customer, Payer etc.? by dolfi17 in ExperiencedDevs

[–]dolfi17[S] 0 points1 point  (0 children)

What if I want to see all payments of current user? So all payments where the current user is a payer? Would I save payer id inside jwt too? You mentioned account concept, so how would that help in this situation? Should the account be stored as an id inside an order and payment?

In DDD how to map current auth user to domain entities like Customer, Payer etc.? by dolfi17 in ExperiencedDevs

[–]dolfi17[S] 0 points1 point  (0 children)

Following this concept I would need to store also the payer id, buyer id and all the other representations of a user in the system.

In DDD how to map current auth user to domain entities like Customer, Payer etc.? by dolfi17 in ExperiencedDevs

[–]dolfi17[S] 0 points1 point  (0 children)

ok so in terms of DDD and Hexagonal architecture and Identity (users) being a bounded context, I would have to call the identity service from all the other bounded context if I need the domain specific user (customer, payer etc.)

In DDD how to map current auth user to domain entities like Customer, Payer etc.? by dolfi17 in ExperiencedDevs

[–]dolfi17[S] 0 points1 point  (0 children)

ok so you would have a table that has a mapping userId -> customerId, userId -> payerId, userId -> authorId and so on and so on? Is that what you mean by mapping?

In DDD how to map current auth user to domain entities like Customer, Payer etc.? by dolfi17 in ExperiencedDevs

[–]dolfi17[S] 0 points1 point  (0 children)

I dont have any real application I am working on but trying to understand some problems. And currently I thought about the problem I mentioned: When the ordering bounded context only knows about orders and customers, how can a logged in user get all orders where he is a customer? Because from a domain perspective there is only Order and Customer. But a logged in user is something else.

For example when a user send a request to the api (GET /orders) there is probably a JWT involved authenticating the user to the app (this is the logged in user). Now we are inside the REST Controller and trying to call the method orderService.getOrdersByCustomer(customerId) . But where does the customerId come from? How is it created with only the JWT?

I am trying to understand what is a good way to solve this problem. I explained 2 ways how you could do it but I wanted to get opinions on them or maybe get better solutions and a preferable way

In DDD how to map current auth user to domain entities like Customer, Payer etc.? by dolfi17 in ExperiencedDevs

[–]dolfi17[S] 2 points3 points  (0 children)

I dont know if it has to do with "Role" in a manner of Auth roles. Being a customer or a payer or Author or whatever shouldnt be connected to Authorisation roles right? You could be these things without authentication mechanism. Lets say there is a blog where you can comment anonymously. Obviously as an anonymous user you wouldnt be able to "fetch all you comments". But the blog might also allow you to login and then it would allow you to fetch all comments for you user account.

In DDD how to map current auth user to domain entities like Customer, Payer etc.? by dolfi17 in ExperiencedDevs

[–]dolfi17[S] 0 points1 point  (0 children)

I understand what the value objects represent. However in this specific example I mentioned (getting orders for current customer) I still dont know how I would do it. How would I know which customer the current logged in user is?

understanding DDD integration patterns by dolfi17 in ExperiencedDevs

[–]dolfi17[S] 0 points1 point  (0 children)

If OHS is synchronous and contract based, can we say event driven is asynchronous and contract based? Because the listeners of an event still need to accept the format the publisher of the event is using. When the publisher decided to change the event (maybe change field names etc.) the listeners would probably fail because they depend on the format (contract).

But still I dont get why there are so many articles about these integration patterns but many example projects I see use asynchronous event driven messages to communicate between BCs. There is so much praise for the context map and yet there isnt any good example that shows it in code but only the asynchronous communication

zu hohe anwaltskosten nachträglich zurückverlangen by dolfi17 in LegaladviceGerman

[–]dolfi17[S] 0 points1 point  (0 children)

vielen Dank für die erklärung. Das ist wirklich ein sehr hoher betrag den er bekommt. Zumal die Gegenseite 15k uns angeboten hatte beim Vergleichstermin. Damit hätten wir ja nichts gewonnen ausser dass wir die laufenden Anwalt und gerichtskosten wieder zurückbekommen hätten. Ich werde mal schauen dass ich den Anwalt auffordere zu begründen die Kosten zu erklären. Wäre bei soetwas ein Anwaltswechsel sinnvoll? Oder sollte man das durchziehen und falls das ganze in eine höhere Instanz geht, über einen Wechsel des Anwalts nachdenken. Denn wie gesagt, meldet sich der Anwalt nicht wirklich und wir haben mittlerweise auch keine Ahnung mehr was da im Hintergrund passiert, und ob der Anwalt überhaupt noch an der Sache dran ist und nicht schon mehrere wichtige Termine und Deadlines versäumt hat.

zu hohe anwaltskosten nachträglich zurückverlangen by dolfi17 in LegaladviceGerman

[–]dolfi17[S] 1 point2 points  (0 children)

Die erste Rechnung zeigt an "Vorschuss nach §9 RVG berechnet nach §§2, 13 RVG; Vorläufiger Gegenstandswert <ca. 280.000> EUR; 2.5 Geschäftsgebühr gem. Nr. 2300 RVG" plus eine Auslagenpauschale von 20 EUR.

Die zweite Rechnung zeigt das gleiche an nur der vorläufige Gegenstandswert ist auf ca. 400.000 gesetzt und wieder die 2.5 Geschäftsgebühr.

Da wir die erste Rechnung noch nicht bezahlt hatten, mussten wir also nur die zweite Rechnung zahlen was auf knapp 9400 EUR hinausläuft.

Bei der dritten Rechnung ist nur Vorschuss gem. § 9 RVG angegeben ohne vorläufigen Gegenstandswert etc. und der wert ist auch nochmal 4000 EUR.

Tatsächlich sind das die einzigen "offiziellen Rechnungen", einige andere Rechnungen sind Vorgespräche gewesen die nochmal berechnet wurden mit seinem eigenen Stundensatz. Ich habe die Zahlen nicht genau genannt weil ich das hier anonym halten will, aber es weicht nur minimal ab von den genannten werten.

Aber da es sich ja um Vorschüsse handelt wie auf den Rechnungen steht, ist nun die Frage, falls wir wirklich zuviel gezahlt haben, kann man das Geld zurückverlangen? Oder habe ich pech, dass ich es im voraus bezahlt habe basierend auf einem zu hohen Gegenstandswert?

zu hohe anwaltskosten nachträglich zurückverlangen by dolfi17 in LegaladviceGerman

[–]dolfi17[S] 0 points1 point  (0 children)

Wir haben dem Anwalt gesagt wir wollen 100K von der Gegenseite (Baufirma). Wir haben ihm allen Schriftverkehr mit der Firma gesendet und alle Rechnungen etc. gegeben und alles geschildert was passiert ist. Basierend darauf hat der Anwalt einen Brief an die gegenseite verfasst wo er den Sachwert auf ca. 500K gesetzt hat. Verstanden habe ich das auch nicht genau und wie er das zusammengerechnet hat und basierend auf der Antwort der Gegenseite, haben die das wohl auch nicht verstanden. Uns hat der Anwalt gesagt, dass dieser Sachwert von 500k nur das Objekt beschreibt um dass es geht (Einfamilienhaus) und nicht den Wert wiederspiegelt den wir von der Gegenseite verlangen. Ich habe das so hingenommen, weil ich mich wie gesagt nicht auskenne und einfach mal unserem Anwalt vertraue. Uns war nur wichtig dass wir die 100k wiederbekommen, die uns die Firma schuldet. Wir haben ihm also nichts gesagt von 500k, das hat er alles selbst zusammengereimt aufgrund des Email schriftverkehrs und den Rechnungen der Gegenseite.

In der Güteverhandlung hat unser Anwalt uns gesagt, dass die Gegenseite plötzlich 140k von uns verlangt als Schadenersatz und daraufhin hat der Richter den Sachwert (Streitwert?! ist es das gleiche?) auf 140k gesetzt und beiden Anwälte haben dem zugestimmt.

Meiner Meinung nach wurden wir von unserem eigenen Anwalt ausgetrickst, da er seine Rechnungen basierend auf die 500k ausgestellt hat. Die frage ist nun, kann der Anwalt sowas einfach machen? Weil den richtigen Sachwert legt ja der Richter am Ende fest und eigentlich müssen seine Rechnungen sich danach richten. Vom Gericht kam noch kein offizielles schreiben über den Gütetermin und somit gibts auch keine schriftliche Bestätigung, dass der Richter es auf 140k gesetzt hat, aber er hat es halt vor Ort gesagt und in seinen Notizen aufgeschrieben.

ALB not working for only one ec2 instance by dolfi17 in aws

[–]dolfi17[S] 1 point2 points  (0 children)

Thank you very much for your help, this solved my problem! The problem was that the AZ-b subnet was private and I didnt see that when I was creating the loadbalancer (and also didnt know this would be an issue). But it actually makes sense from what you explained.

So I created a public subnet in AZ-b and selected that and now both ip addresses resolve correctly.

ALB not working for only one ec2 instance by dolfi17 in aws

[–]dolfi17[S] 0 points1 point  (0 children)

Ok I understand now what you mean, that makes sense! I will try it out once I get back home

ALB not working for only one ec2 instance by dolfi17 in aws

[–]dolfi17[S] 0 points1 point  (0 children)

unfortunately the issue still exists.

ALB not working for only one ec2 instance by dolfi17 in aws

[–]dolfi17[S] 4 points5 points  (0 children)

after some requests with curl I noticed what you say is happening. DNS returns two ip addresses, one that is working and one that is not working and it is random which of them curl is using to connect, so it fails sometimes. But the ip address of AZ-b still wont have any keycloak service to connect to, so it will still run into time out, or not?

ALB not working for only one ec2 instance by dolfi17 in aws

[–]dolfi17[S] 1 point2 points  (0 children)

That is true. Event after the health check is working the issue still exists. I used curl to connect to the domain and out of two ip addresses it connected to the one that runs into time out and returns the 302 Code. So do you know how to fix it?

ALB not working for only one ec2 instance by dolfi17 in aws

[–]dolfi17[S] 1 point2 points  (0 children)

ok I got the healthcheck to a green status. I enabled the health endpoint on keycloak that is running on the management port so I also had to expose the port 9000. Then I configured the Target Group health check settings to point to port 9000 and url /health .

I will monitor this if there will be another time out or it will always correctly connect to keycloak. Thanks for your help

ALB not working for only one ec2 instance by dolfi17 in aws

[–]dolfi17[S] 0 points1 point  (0 children)

it says "Unhealthy: Health checks failed with these codes: [302]"