what should I label this UI property group selection - user-interface

In my application my users can generate statements, monthly and weekly. I've recently been
asked to allow the users the capability to associate a customer with either weekly or monthly
but not both, to a customer. This then leads to...if a user selects a weekly customer and runs a monthly
statement, he or she, should be prompted that customer's statement cannot be generated and why.
My question: In the UI of the customer screen when editing a customer, should I label the choice option(s) as
Select the customer Statement
Frequency [ monthly or weekly]?
Select the customer Statement Type [
monthly or weekly]?
What giudelines do you follow to assist you when making such decisions?
Thanks

I would suggest using Statement Frequency. Other choices might be cycle or period.
The rule of thumb should be to ask the user (product's business owner) what terms and wordings to use. It's not uncommon for business users to review all the terms and messages the application uses. That way the resulting product will speak the users' language.
The reason is that developer-invented terminology often leads to unintuitive UI. It may be perceived as clumsy, unfamiliar, or even incomprehensible by end-users. The worst case is bringing the software's internal terminology and mechanisms to the user interface.

Related

Product price changed while creating order

What is the DDD way of handling the following scenario:
user enters Order Create screen and starts creatingnew Order with OrderItems
user chooses ProductX from products catalog and adds quantity
OrderItem for ProductX is created on Order and user goes on adding another product
in the meantime, before Order is saved, admin changes price for ProductX
Assuming Product and Order/OrderItem are separate aggregates, potentially even separate bounded contexts, how is this handled?
I can think of several options:
optimistic concurrency combined with db transactions, but then if we broaden the question to microservices where each microservice has its own db - what then?
joining everything into one giant AR but that doesn’t seem right.
introduce a business rule that no product prices are updated during the point of sales working hours but that is often not possible (time triggered discounts, e.g.)
What is the proper DDD/microservices way of solving this?
What is the proper DDD/microservices way of solving this?
The general answer is that you make time an explicit part of your pricing model. Price changes made to the product catalog have an effective date, which means that you can, by modeling time in the order, have complete agreement on what price the shopper saw at the time of the order.
This might introduce the concept of a QuotedPrice as something separate from the Catalog price, where the quote is a promise to hold a price for some amount of time.
To address this sort of problem in general, here are three important papers to review:
Memories, Guesses, and Apologies -- Pat Helland, 2007
Data on the Outside vs Data on the Inside -- Pat Helland, 2005
Race Conditions Don't Exist -- Udi Dahan, 2010
I think one way to solve this through is Events. As you said, Product and Order can are very least separate aggregates, I would keep them loosely coupled. Putting them into one single aggregate root would against Open/Close and Single Responsibility Principle.
If a Product changes it can raise a ProductChanged event and likewise of an Order.
Depending on whether these Domain-Objects are within the same service or different service you can create a Domain-Event or an Integration event. Read more about it here.
From the above link:
A domain event is, something that happened in the domain that you want other parts of the same domain (in-process) to be aware of. The notified parts usually react somehow to the events.
I think this fits perfectly to your scenario.

Database schema for rewarding users for their activities

I would like to provide users with points when they do a certain thing. For example:
adding article
adding question
answering question
liking article
etc.
Some of them can have conditions like there are only points for first 3 articles a day, but I think I will handle this directly in my code base.
The problem is what would be a good database design to handle this? I think of 3 tables.
user_activities - in this table I will store event types (I use
laravel so it would probably be the event class name) and points for
specific event.
activity_user - pivot table between user_activities and users.
and of course users table
It is very simple so I am worrying that there are some conditions I haven't thought of, and it would come and bite me in the future.
I think you'll need a forth table that is simply "activities" that is simply a list of the kinds of activities to track. This will have an ID column, and then in your user_activities table include an 'activity_id' to link to that. You'll no doubt have unique information for each kind, for example an activities table may have columns like
ID : unique ID per laravel
ACTIVITY_CODE : short code to use as part of application/business logic
ACTIVITY_NAME : longer name that is for display name like "answered a question"
EVENT : what does the user have to do to trigger the activity award
POINT_VALUE: how many points for this event
etc
If you think that points may change in the future (eg. to encourage certain user activities) then you'll want to track the actual point awarded at the time in the user activities table, or some way to track what the points were at any one time.
While I'm suggesting fourth table, what you really need is more carefully worded list of features to be implemented before doing any design work. My example of allowing for points awarded to change over time is such a feature that you don't mention but you'll need to design for if this feature is needed.
Well I have found this https://laracasts.com/lessons/build-an-activity-feed-in-laravel as very good solution. Hope it helps someone :)

Microstrategy - How to apply a security filter just to certain report?

I need to apply a filter in some report for some users.
I was told that the best way to do this is a security filter but i discovered that security filters are applied to all the reports that the user open.
I need some kind o filter that filter an attribute on a user but just on some reports, not all.
example:
if report1{
if user1 then attribute = 1
if user2 then attribute = 2
}
let's say i have departments and chiefs of those departments.
It is not a matter of security but a matter of comfort.
I want to avoid the chief of a department to manually select (prompt) his department.
It would be more comfortable if the system would recognize the user and show the data of his interest.
There a different ways to solve this kind of scenario, depending on the level of flexibility you want to offer to your user and the effort you need to implement and maintain the solution.
The User Login way
No flexibility, low maintenance, more effort to implement
Use the User Login prompt. This is a system prompt (created by default MicroStrategy) that returns the user login. If you have a table with the data that a user can see like this:
UserLogin YourAttribute
user1 attribute1
user2 attribute2
user3 attribute3
... ...
You can create an attribute UserLogin to be parent of the Attribute you want to use as filter and then create a filter (User Login = User Login System prompt)that you will put in your report.
More detailed information can be found here.
Once implemented this solution will you need to maintain that new table and when the user run a report with that filter it will be able to see only his data. It's similar to a security filter, but now you can decide where to apply the filter.
Multiple reports for multiple prompt defaults
Flexibility, high maintenance, little effort to implement
For each user create a copy of that report with the proper answer as default.
Maybe you can create ten reports now, but if you need to modify that report tomorrow you will need to modify ten report or recreate again all copies with different prompt answers.
Anyway this is good for the users, because they can change the prompt answers if they need.
Using URL to answer prompts
Flexibility, low maintenance, variable effort to implement
Instead to run the report using MicroStrategy you can provide to each user a specific URL that, using MicroStrategy URLAPI, answer automatically the prompt.
Of course you need to prepare the URLs in advance or find a way to do it programmatically. This is a good solution if the user don't want to navigate the MicroStrategy web interface but just run the report.
Subscribe the prompt answers
Flexibility, low maintenance, medium effort to implement
Have the report with the proper prompt answer delivered to your user every morning (or when you want). Using MicroStrategy Distribution Services you can deliver a report or document to your user and for each user you can specify the correct prompt answers.
No user can receive the full report in their mail box or just a link to their history link, opening that link they will see the report with their data. Of course users (or probably you) will need to setup all the subscriptions required.
Final thoughts
In these case I prefer to leave flexibility to users and teach them how to use the product. Of course there are some people they have no time for this kind of things (usually C something levels), in that case the best this is to have the data delivered to their email.
I understand some of these options are not that straight forward to implement if you are new to MicroStrategy.
My suggestion: for now go with the subscriptions (if you can) or teach your users how to save their own copy of that report (in My Reports) with the prompt already answered (oh, yes, this was another option, but each user has to do it), every time they will open it now, the prompt won't show up (but if you change the original report they will need to do it again).
Let me know if you need more details.

Surely Salesforce supports regular old grouping and summarization in reports?

So the reporting system in Salesforce is a bit restricting. It seems there is no editor for an xml or other markup language to create reports in; apart from formulas you're stuck in the website drag and drop ui.
There seems to be 3 types of reports in Salesforce Tabular, Summary and Matrix. The first kind is kind of useless for more advanced reports, since it doesn't support forumulas (if both fields are in the same table you can work around this with calculated fields). However with all 3 I've found it difficult to impossible to make a report with basic details and summarized figures.
An example:
I've added a custom field "company size" to the Account table/object. This tracks the approximate number of employees working at the customers company (ever taken one of those surveys that asked you for a range of how many employees worked in your organization). I then have a custom table/object for sales, listing the account, the date and the volume ($).
I would think it would be a simple to create spreadsheet style report with each row listing an account, which state it was based in, how many employees they had, followed by their total sales and sales/employee (a formula of volume/employees).
But the grouping and summarization options don't seem to work that way. Grouping in both the Summary and Matrix report types seems to want to treat each grouped field as a seperate level, so with the 3 fields related to the account I get 3 cascading fields in a stair like arrangement, instead of being able to put them on one row.
It gets worse with the summarization - no matter what I and other colleague have tried the summarization doesn't seem to work. If an account has 50 sales we end up with 50 rows, even if we click the little arrow beside the column, click summarize and check Sum.
From an SQL perspective this report seems like something you would teach students in the first week, yet its really not obvious how translate this into something Salesforce can understand. A lot of the web ui is not discoverable (dragging fields provides no feedback as to why it can't be dropped in a particular place, some options are hidden unless you hover the mouse over the right place) so I would not be surprised if I've missed a crucial step.
So, is there an option to make this work (particularly getting sales to be totaled as a single cell for each account, not 2 or 5 or 50), maybe a distict checkbox lurking behind an innocent blank area?
Given the lack of calculated fields in the report, you need to create the formula at the object level. If it's not useful in the detail page, don't include it in the page layout. It will still be available in reporting.
The summarization/grouping options work as in SQL, but you can only group by one field at a time.
However, the result view in "show details" mode is not like a simple SQL query - more like using windowing functions where the result output can contain both groupings with aggregations at those levels, and the detail rows that fed into that grouping.
In "hide details" mode, the detail rows are not shown, and so only grouping levels and the aggregates are shown.
So, it looks like you can either:
group by state, then account, sum your employees, sum sales, and then a Custom Summary formula of sum:sales/sum:employees
or
create a formula field on account to do sales/employees
tabular report with fields of: account, state, employees, sales, your new field.
Also, if you want an XML editor, you can edit the XML for reports (as with many other parts of salesforce setup) via the metadata API and the force.com plugin for eclipse. But it's mainly for tweaking reports, or version control, or mass-actions, as there is no preview/run operations, it's mostly a metadata management system.

Best way to implement users location that allows me to see what users live roughly in the same area

A key part of my current project is users having the ability to see what other users live near to them. What is the best way to implement this?
I would just ask for country, state and city but because this will be international I can't have a fixed drop down list of states/administrative regions for each country, so if users spell the name of their state differently this will hinder my ability to detect that users live in the same state.
Say for example we have an the Swiss canton "St. Gallen". Some user will spell that as "Saint Gallen", others as "St Gallen" and so on. Which is obviously problematic.
Could I just ask for the zip code and use that? I've found some zipcode tools online but I'm suspecting they don't work very well. Has anyone used them?
Thanks for your asnwers.
Shouldn't you base your query on geographical data rather than administration one? I mean instead of comparing cities/zip codes just find people within, let's say, 5 km from current user location. And if you let every user to choose his/her location on the map, this will be as simple as choosing it from a series of drop-down lists or entering a ZIP code. Also there is an emerging geolocation HTML feature.
Querying such an information is different story thou. You'll probably gonna have to use GIS capabilities of your database: MySQL, PostgreSQL, Oracle and others.

Resources