I want to create an app where professionals will be able to offer services at the prices they want. Users will choose from a predefined list of services and then they will have to enter the price of the chosen service.
I managed to create a list of user’s services that I called “My services” in the app but I don’t know how to make the price specific to each user’s service.
I have tried several methods but I think the relationships are not good.
Here is what I tried:
I created a collection named “prices”
I related it to “services” and called it “the service’s price”
It is better to have price field inside the service collection, unless you want dynamic pricing, which need other fields to identify which one to choose.
If you are in the current scheme, you would need list to access the child collection (price) from parent collection (service) to get the list of prices.
Indeed I want the pricing to be dynamic but I don’t want to add other fields. I tried to set automatic fields (login users & the current service) but It doesn’t work.
And what if I don’t want a list of prices can I still make it possible ? Or maybe I didn’t understand this part of your answer
@Ayoub , Why you created a collection for prices? To select a price from a drop-down? Why you don’t create a number property on the services collection and store the price there and show that property like Yongki mentioned? If you do this in this way you need a list connected to the prices collection and filtered for the current service like Yongki mentioned!
The price of the service is different for each user, for that reason It didn’t work when I create a number property one the services collection. Cause when I did, every users shared the same price.
With that number property on the services collection, How can I make it specific for each user ?
Btw creating a collection for prices seemed to be a good solution cause I want every user to fix his own price to a service but obviously it’s not a good solution
I think we are in the right path. I’m still trying to follow your instructions.
I understand the principle of creating a whole new services for the user cause it’s indeed like a creating a whole new service but I’m really lost right now I think I’m going to need a video
If you are going by users too, the price collection should be related to users collection, so there will be 2 relationship fields, to projects and to users collection.
It is a good practice to use “id” field as a complement field, so when you are doing filtering you can use equal to this “id” field.
There is a list of all services but I wanted to filtrer it and not showing the services already choosen by the user but it doesn’t work. I can’t select the user (current service > user)
It’s me again. As you can see I change my ui a little.
I want to use a button “add” to add a service to my list of selected services. And when a user select a service he goes to page fix the price mendatory and when he fixes the price then the service goes to the list of selected services. And when he clics on a selected services he goes to “fix your price” to update the price.
Add a update current service action to the Add button and for the selected user many to many relationship add logged in user and add a link action for the setting price screen.