The post has been translated automatically. Original language: Russian
In the rental platform, the same person rents out equipment today and takes someone else's tomorrow. We're looking at how to set up accounts and roles so that it doesn't turn into confusion.
A task. If you create two separate types of accounts, a person has to register twice, the data is duplicated, and the reporting is split. This is especially noticeable in small studios and private craftsmen: they can be both owners and tenants.
Idea. There is only one account. A role is not a type of user, but a context of actions: in it, a person is currently handing over or taking equipment.
The data model.
- User: A specific person logged in.
- Organization: a legal entity or an individual entrepreneur, if a person acts on its behalf.
- Role in the context: equipment owner or tenant.
- Participation: on his own behalf or on behalf of the organization.
Access rules.
- As the owner, you can see your own pieces of equipment, orders for them, payments, and reports.
- The tenant role shows his orders, acts, and payment history.
- The data of the other party is opened during the transaction and is not wider than necessary for it.
- The context is chosen explicitly, not guessed from the page.
Nuances.
- A deal with himself: the owner does not have to rent his own equipment through the platform, or such a deal is marked separately.
- Verification is different: it is important for the tenant to confirm his identity, and for the owner to have the right to dispose of the equipment.
- Notifications come by context so that the owner does not receive the tenant's messages and vice versa.
- Account settings (login, phone, mail) are common for both roles.
What to check.
- A user with two roles sees only the required data in each context.
- You cannot book your own equipment.
- Disabling the role does not delete the transaction history.
- An individual and an organization are not confused in the reports.
В платформе аренды один и тот же человек сегодня сдаёт технику, а завтра берёт чужую. Разбираем, как устроить аккаунты и роли, чтобы это не превращалось в путаницу.
Задача. Если сделать два отдельных типа аккаунтов, человеку приходится регистрироваться дважды, данные дублируются, а отчётность раздваивается. Особенно это заметно у небольших студий и частных мастеров: они бывают и владельцами, и арендаторами.
Идея. Аккаунт один. Роль это не тип пользователя, а контекст действий: в нём человек сейчас сдаёт или берёт технику.
Модель данных.
- Пользователь: конкретный человек со входом в систему.
- Организация: юридическое лицо или индивидуальный предприниматель, если человек действует от его имени.
- Роль в контексте: владелец оборудования или арендатор.
- Участие: от своего имени или от организации.
Правила доступа.
- В роли владельца видны свои единицы оборудования, заказы по ним, выплаты и отчёты.
- В роли арендатора видны свои заказы, акты и история оплаты.
- Данные другой стороны открываются по ходу сделки и не шире, чем нужно для неё.
- Контекст выбирается явно, а не угадывается по странице.
Нюансы.
- Сделка с самим собой: владелец не должен арендовать собственное оборудование через платформу, либо такая сделка помечается отдельно.
- Проверка разная: арендатору важно подтвердить личность, владельцу ещё и право распоряжаться оборудованием.
- Уведомления приходят по контексту, чтобы владелец не получал сообщения арендатора и наоборот.
- Настройки аккаунта (вход, телефон, почта) общие для обеих ролей.
Что проверить.
- Пользователь с двумя ролями видит в каждом контексте только положенные данные.
- Нельзя забронировать собственное оборудование.
- Отключение роли не удаляет историю сделок.
- Физическое лицо и организация не смешиваются в отчётах.
Comments 1
Newest Popular