Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I am trying to figure out a way to implement og action for an e-commerce site. Action would be like "Buy a Product" but usually people buys multiple products at a time by Adding different items to Cart. I do not want to show as "Jack bought xx, Jack bought yy,etc.." instead I would like to have an action like "complete purchase" where purchase is an object that might have multiple items. Any idea appreciated.
I do not want to show as "Jack bought xx, Jack bought yy,etc.."
Why not? You could suppress the feed story that publishing an action creates for all but the first one, and multiple actions of the same type should “fold” nicely when they are displayed on the user’s timeline, like “John Doe bought Foobar and 16 other Products at …”
Your other option would be to make purchase your object that the action is taken upon (as you already said), and then have custom properties for this object, which “link” it to other items of the type product. But AFAIK the number of these custom properties can not be dynamic, so you’d have to agree on a maximum number of products a purchase can contain before, which is probably not so nice. But you could set up purchase as an object that links to a page of your own that displays all products bought, and have the purchase object only contain the first (cheapest/most expensive/…) X of those as custom properties.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 months ago.
Improve this question
I have list of tasks and I want to automatically assign them between a list of staff members.
Each staff member has a different capacity for how many tasks they can do and I want the automatic allocation of tasks to take into account each staff member's max capacity.
I also want the allocation to take into account the order in which staff members are listed to facilitate task allocation on a first-come-first-served basis.
So far I've been able to evenly distribute the tasks, and where tasks cannot be evenly distributed, have prioritised staff members by order, however, I've not been able to take max capacity into account.
Here is a link to my Google Sheet:
https://docs.google.com/spreadsheets/d/1pr87yOdt0MS7rJ09NKqDMjwNi_UGi5reqqLGQjR8TuY/edit?usp=sharing
Note: the cells containing formulas have been highlighted in Cyan for easy reference.
Do you know how to solve this problem?
You can try with this: I first created a kind of "rounds" finding in each number of tasks assigned who would be able to work resulting in a table like this:
Then I wrapped it in a query selecting Col2 (only the names), where they weren't empty, and limiting the amount to the count of tasks in E2:E:
Let me know if this works for you, of this is what you meant. Here you have the formula in F2:
=QUERY(LAMBDA(name,num,qt,MAKEARRAY(qt*MAX(num),2,LAMBDA(r,c,LAMBDA(round,ind,IF(c=1,round,IF(INDEX(num,ind,1)>=round,INDEX(name,ind),"")))(ROUNDUP(r/qt,0),MOD(r-1,qt)+1))))(FILTER(Availability!A2:A,Availability!A2:A<>""),FILTER(Availability!C2:C, Availability!A2:A<>""),COUNTA(FILTER(Availability!A2:A,Availability!A2:A<>""))),"Select Col2 where Col2 <>'' limit "&COUNTA(E2:E))
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
What is the best way to manage preferences for appointments in database? In my scenario a patient can send multiple preferences (slots) for appointments to a practitioner. The practitioner will approve the most feasible slot according to his/her availability.
How can I design a ERD so that I can allow different no. of preferences to different patients, e.g. patient A can send only 2 preferences based upon its pricing plan and patient B can send 5 preferences based upon its pricing plan.
It seems like you need a pivot table. It would need to have patient_id, practitioner_id, and preferred_time. The patient would create records in this table. When a practitioner approved a preferred_time, the data could be copied into this appointment table you are showing and expanded.
You can then add a hasMany preferred_time relationship to the patient model, and use that to interact with the data.
Any combination of patient and practitioner could have zero, one, or many preferred times at any given time.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I currently have 3 table and I am unsure if they should be merged or not. They do have similar fields, and a supplier would need to login at some point or another, and even clients
User
Username
Password
Name
Surname
Mobile
Telephone
Email
Client
Name
Telephone
Email
Fax
VatNo
Supplier
Name
Telephone
Email
Fax
VATNo
LastRefreshDate
OpeningHoursId
Can somebody give me a suggestion as he best way to go forward.
The tables should probably not be merged. However, that's a judgement call based on guesses about what the tables mean.
It looks like clients and suppliers can be corporate entities (VAT numbers, for example), but users should be individuals rather than collective accounts. You may well have a list of users associated with a given supplier; similarly, you may well have a list of users associated with a given client. In some circumstances, a supplier may also be a client. You would need a User ID number in the Users table; you would need a Client ID number in the Clients table and a Supplier ID number in the Suppliers table. You would have simple mapping tables to list the Users associated with a Client and another to list the Users associated with the Suppliers.
However, a lot depends on whether the guesses I've made (plausible ones, but nonetheless guesses) are remotely on target.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Hey Everyone my system is selling kits for each kit it compose of different products all of them are downloaded files. my problem is where would i place the products of each kit.
Sample KIT1 compose of game1, game2, game3, game4
PRODUCT TABLE
PRODUCTID: 1 SKU: NAME:Kit100
where would I Place game1, game2, game3, game4
According to what you just said,
You want a KIT table
You want a PRODUCT table
And to link them together, you need a KIT_ITEM or KIT_PRODUCT table to itemize the individual items/products within each Kit.
To be honest I'd name the top-level entity the customer buys (you called it a Kit) as a Product, and I'd name the parts as Components.
Products in normal business English, are individually purchasable.
You could also make a KIT_PRODUCT which is made up of 0..* "component" Products.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I really need help to make a decision.
I'm working on a real estate online directory.
People can add their property in several categories like apartment, land, shop ... and each category has its features that some of them are shared between categories like City but some others are unique or shared between 2 or 3 categories like "number of rooms".
So i have three solution :
keep shared features in one table and put others in an other table in meta_key - meta_value format like tagging system.(seem reasonable)
Put all features in one table.(dirty)
Put each category in separate table (this is worst idea).
The site will serve too many searches. but most of them are based on shared features.
which solution looks better?
Why wouldn't you just create a table of the properties and then tie them together in a table like so:
Categoryid | PropertyID
Also making both columns a composite unique identifier will prevent from duplicate occuring with the table. This allows you to create unlimited properties and assign them to any category.