Domain storytelling system - domain-driven-design

I want to create a website for selling and buying stuff. When a user offers to buy a product and the seller accepts the offer is getting a notification that the product is sold to him and the product's status is changed to sold. How would one visualize this with domain storytelling?
Currently, my story looks like this but I don't like how the notification looks like it comes from the seller but the seller doesn't do anything because the notification is sent automatically and not sent directly by the seller. Same problem for the status of the product.

There are two ready options:
You can view the story as saying that the offer updates the status and sends the notification
You can explicitly model that there's some process (I've seen gear icons used to denote this) watching for accepted offers and updating the status and another (or possibly the same, though beware of multiple changes in one process) process watching for accepted offers and sending the notification

Related

Get Stream Chat: Is it possible to hide message from the customers?

I'd like to add messages that are visible only to our support team, but should be hidden on the customer side.
The opposite should also be possible, how can I send a message from the backend straight to the customer but hide it for our support team?
Tried to search about SYSTEM messages but didn't find anything usable.

setting up nexmo test messaging for classified listings

Here is what I am looking to setup & I'm wondering if it is possible:
I have a classified ads site where people can join the site and then are allowed the ability to email any listing. I would like to add the ability for people to text message listings as well.
Listing owners would add their cell numbers if they would like to be contacted via text message, the site would then allow user to text BUT it would not show real phone numbers, each listing owner would be assigned a nexmo number and if they choose to give out their phone numbers, they can.
Then, I would also like the ability to send out a general broadcast to all users. Is this possible? And, if so, how would I integrate something like this?
Yep all of that is possible with Nexmo you seem to have 3 or 4 separate use cases here so lets break those down:
When your users sign up for your site you'll want to capture their Cell numbers against their account, you might want to use the Nexmo Verify product as part of that signup to ensure you have a correct and valid mobile number.
For users to be able to add listing via text you would need to get a nexmo number for them to send their listing to, that would be one number for the whole site and you could look at the senders number to link the message to an account (from the one you captured at registration) If you don't recognise the sender of a listing message then you'll want to send back some kind of response asking them to register and a link.
For buyers to contact sellers without revealing their numbers this is a very common use case called 'Message (or Call) Proxy' you need to rent a number for each seller (or listing) so you'll need to factor that into your pricing, then you forward any messages sent to the number to the seller, you will also have to implement some logic to handle replies and track state in your application, within SMS there is no concept of a reply so each message has no association with the previous one, this is a bit tricky when you have several conversations going on over the same number.
Finally the 'broadcast' this would just be a case of iterating over the list of numbers you have for your users and sending the message to each one, you will need to ensure that you comply with any regulations around sending of bulk messages in the country you are sending to, more details for that are on the nexmo knowledgebase https://help.nexmo.com/hc/en-us

job queue in nodeJS

I am working on a personal project where I want to automate the TA assignment system. I want to use Node and MongoDB for this. Though I have some idea about MongoDB, I am new to NodeJS. The aim of the projest is to do something like this :
A school administrator submits the course for which he/she wants to hire a TA.
The database is already populated with eligible students(more than two). The fields assoc with each student is [Student ID, Seniorty(sophomore,junior,senior),Course Taken or not, grade,presentStatus(Avlbl/Hired)]
At any point of time, the school admin requests a TA for a course, he gets the most senior eligible student available in the db.
Once the student is assigned, his status is changed to Hired.
I was planning to implement this using a queue. (Storing all the available students in that course in a queue and assigning the TA-ship to the senior student available in the front of the queue). As soon as he/she is assigned a TA, they are removed from the queue and pushed back into the db with the PresentStatus as 'Hired'. The problem I am facing is, I am not able to understand how I should be implementing the functionalities of the queue using NodeJS. During my research about the approach, I found something related to monq and a blog as well where they have discussed implementing it with Kue(backed by Redis instead), however I am still not able to visualize how this idea should be implemented using queues in NodeJS. Any help would be appreciated.
RabbitMQ is an option you are looking for.
You have to create a message sender and message consumer. The consumer will have a corresponding queue. Once the queue is filled with a message, the consumer will grab it and do it's process. In your scenario, it checks the student's status and then change him/her as hired in your database. What your sender does is that it packages a student's information and put it in the consumer's queue. I can imagine what will be happening in your case: a student submits request on his/her side. The node.js api receive it and pack information. Then it sends it to your customer queue. Your customer will process it if it's free. If it's busy, the information will be waiting in the queue. I recommend you to use json for students' information when different components have to communicate.
Here is the official website of RabbitMQ: https://www.rabbitmq.com/getstarted.html
Hope it helps.

subscribe users automatically to the asset publisher liferay

Is there any option to subscribe users automatically to the asset publisher?
I saw this:
message.boards.subscribe.by.default=true
but, I need it for the asset publisher
Thank you!!
message.boards.subscribe.by.default subscribes a user to the message board thread they're answering to - e.g. after they interacted with the message board.
What would be the interaction with AssetPublisher that you're intending to trigger this automatic subscription? There's typically only the author(s) of an asset publisher adding articles, and they don't need to interact with AssetPublisher in order to make other articles appear because AssetPublisher only filters and shows whatever matches the current criteria.
This is a long way to say "no, there's no such property". However, there's Liferay's API, which you can use to codify the criteria for subscription. This will naturally be more effort than setting a property, but it's your only option.

How can Google(gmail) know the flight details before departure

Recently I booked one flight from A --> B ---> C. On the day before departure, I checked with Gmail and it reminded me that the flight from A to B will be delayed for about two hours. Then I got a message from the air company to tell me that they have changed my flight from B to C into another one which is almost two hours later than my original one. It seems Google already knew my 1st flight will be delayed even before the airline company.
I'm curious what's the channel for Google to get the information? I checked with flightaware and nothing about the delay of my flight.
Google gets a lot of data from several channels. To name a few:
gmail
adsense
google crawler
google+
google chrome
google maps
Naturally there are many projects not mentioned here, developed or owned by Google. Since Google is one of the biggest companies in the IT sector, it is no wonder that their database gathered the data earlier than your notification was sent.
From your case one cannot say that Google new about the information earlier, the only thing we know is that they have sent you the notification earlier. It is quite possible that one of the employees of the flight company uses gmail. If so, then his/her mails arrive to Google's server and some automatic analyzers parse the data and then trigger the notification event. If the company was still discussing how they should communicate the delay on gmail, in the meantime Google was analyzing the gathered data and as a result sent you the notification.
You will never know the exact details unless you will start to work for Google, since Google employees will not disclose the inner information of the company to outsiders, outsiders do not have the given information. We can only guess, but we can more-or-less know that the data was gathered by Google.
Events from Gmail
When you get an email about an event like a flight, concert, or restaurant reservation, it's added to your calendar automatically. If you don't want events from Gmail on your calendar, you can delete a single event, or change your settings so that events aren't added automatically.
Note: Events from Gmail aren't available for Government accounts, accounts with data location restrictions, or Google Accounts that don't have Gmail.

Resources