# PC Business Suite

## Product Scope, Architecture Decisions & Development Charter

**Document status:** Approved project baseline\
**Product type:** Multi-tenant Business Management SaaS\
**Primary audience:** Small and medium-sized businesses, service
providers, retailers, technicians, and professional firms\
**Initial market focus:** Nigeria, with architecture suitable for
international use\
**Working product name:** PC Business Suite\
**Owner / product direction:** PerfectCloud

------------------------------------------------------------------------

## 1. Product vision

PC Business Suite will be a flexible, secure, multi-tenant business
management platform that helps businesses manage their customers,
products, services, sales, inventory, projects, staff, purchasing, and
finances from one system.

The platform must support both product-based and service-based
businesses. It should be useful to a GSM/mobile-phone repair technician,
electronics retailer, gadget dealer, web developer, software engineer,
consultant, workshop, wholesaler, or other small and medium-sized
business.

The product must not be designed around only one trade. A business
should be able to activate the tools it needs, configure its workflows,
and hide modules that are irrelevant to its operations.

The long-term goal is a commercially viable SaaS product that the owner
can use internally and offer to independent businesses through
subscriptions.

## 2. Product goals

1.  Give each business a reliable central place to manage day-to-day
    operations.
2.  Support both physical products and professional or technical
    services.
3.  Provide accurate, traceable inventory and financial records.
4.  Connect customers, sales, service jobs, projects, invoices, and
    payments into a coherent customer history.
5.  Support multiple businesses, branches, warehouses, teams, and users.
6.  Protect each tenant's data from access by other tenants.
7.  Allow businesses to configure modules, roles, settings, taxes,
    currencies, and workflows.
8.  Provide useful operational and management reports.
9.  Support a sustainable subscription-based SaaS business model.
10. Be maintainable, testable, secure, and extensible as the product
    grows.

## 3. Target users and business types

The platform should be broadly useful to:

-   GSM engineers, phone repairers, and electronics technicians.
-   Gadget, phone, computer, and electronics retailers.
-   General retail shops, wholesalers, and distributors.
-   Web developers, software engineers, IT consultants, and digital
    agencies.
-   Repair workshops and maintenance providers.
-   Professional service firms and consultants.
-   Businesses that sell products and provide services together.
-   Other small and medium-sized businesses with customers, staff,
    stock, jobs, sales, or projects to manage.

Industry-specific workflows should be configurable or delivered as
optional modules rather than imposed on every tenant.

## 4. Approved product and architecture decisions

The following decisions are approved as the project's baseline.

  -----------------------------------------------------------------------
  Area                                Approved decision
  ----------------------------------- -----------------------------------
  Product name                        PC Business Suite (working name)

  Product model                       Multi-tenant SaaS

  Target market                       Multiple business types and
                                      services

  Account ownership                   One user account can access and
                                      manage multiple businesses, subject
                                      to permissions

  Business data                       Each business has logically
                                      isolated records

  Locations                           Multiple branches and warehouses
                                      per business

  Modules                             Modular; businesses can enable
                                      relevant capabilities

  Frontend                            React

  Laravel integration                 Inertia.js

  Backend                             Laravel

  Styling                             Tailwind CSS

  Database                            MySQL

  Local development                   Windows, XAMPP, and projects under
                                      `C:\\xampp\\htdocs`

  Source control                      Git; remote repository to be
                                      selected

  Initial currency support            NGN, with multi-currency capability
                                      designed into the system

  Initial language                    English, with future localization
                                      support

  SaaS administration                 Separate platform-level
                                      administration from tenant business
                                      administration

  Security                            Tenant isolation, role-based
                                      permissions, audit trails, and
                                      secure file access are core
                                      requirements
  -----------------------------------------------------------------------

### 4.1 Account, business, and membership model

A person may have one login account and belong to one or more
businesses. A person may own one business and be a staff member in
another, if granted access.

A business is the tenant boundary for business data. Branches and
warehouses belong to a business. Users access a business through an
explicit membership and permission assignment.

Do not assume that the authenticated user owns every business they can
access. Check membership, active business context, role, and permission
on every protected operation.

### 4.2 Tenant isolation

Tenant isolation is a foundational security requirement, not a later
enhancement.

-   Every tenant-owned record must be associated with the correct
    business/tenant.
-   Queries, reports, exports, searches, background jobs, file
    downloads, and API endpoints must enforce tenant scope.
-   Never rely only on hiding interface elements to protect data.
-   Validate ownership of related records when creating or updating
    relationships.
-   Prevent insecure direct object reference (IDOR) vulnerabilities.
-   Platform administrators must use explicit, audited support access
    where access to tenant data is ever permitted.
-   Automated tests must attempt cross-tenant access and prove that it
    is denied.

A shared database with tenant-scoped records is a suitable initial
approach, provided tenant boundaries are consistently enforced and
tested. The architecture should not prevent a future move to
database-per-tenant if scale or customer requirements justify it.

## 5. Product modules and scope

Modules should share common records and services where appropriate. For
example, customers should not need separate duplicate records for sales,
repairs, and projects.

### 5.1 Platform and SaaS administration

Platform-level capabilities for the SaaS operator:

-   Platform administrator authentication and dashboard.
-   Tenant/business registration and status management.
-   Subscription plans, trials, renewals, and billing status.
-   Module entitlements and plan limits.
-   Usage monitoring and account limits.
-   Subscription payment records and transaction references.
-   Tenant suspension, reactivation, and cancellation workflows.
-   Platform announcements and support management.
-   Platform-level audit logs.
-   Controlled support access with reason, scope, and audit history.
-   System configuration and operational monitoring.

Platform administrators must not automatically have unrestricted access
to private tenant business data.

### 5.2 Business onboarding and settings

-   User registration, login, logout, password reset, and email
    verification.
-   Create and manage multiple businesses under one account.
-   Business profile: legal/trading name, logo, contact details,
    address, industry, and tax details.
-   Business type and optional industry template.
-   Branch and warehouse setup.
-   Financial year, timezone, date format, currency, invoice numbering,
    and receipt settings.
-   Tax and discount configuration.
-   Module activation and business preferences.
-   Business switching with clear active-business context.
-   Invite users and manage memberships.

### 5.3 Dashboard

Provide role-aware dashboards with configurable widgets, such as:

-   Sales today, this week, and this month.
-   Revenue and payment collections.
-   Outstanding customer invoices and receivables.
-   Expenses and supplier payables.
-   Gross profit and net profit where sufficient cost data exists.
-   Stock value and low-stock items.
-   Pending purchase orders.
-   Open service jobs and overdue jobs.
-   Active projects, tasks, and upcoming deadlines.
-   Recent transactions and activity.
-   Alerts and reminders.

Dashboard figures must use clearly defined accounting and reporting
rules. Revenue, cash collected, gross profit, and net profit must not be
treated as interchangeable measures.

### 5.4 Customer relationship management (CRM)

-   Customer profiles and unique customer numbers.
-   Individual and business customers.
-   Contact information, addresses, tags, and notes.
-   Customer groups and optional custom fields.
-   Communication and activity timeline.
-   Sales, invoices, payments, returns, service jobs, and project
    history.
-   Outstanding balances and credit limits, if enabled.
-   Customer statements and exportable records.
-   Duplicate detection and controlled merging.
-   Consent and communication preferences where relevant.

### 5.5 Products, services, and catalogue

Products:

-   Product name, description, category, brand, images, SKU, barcode,
    and status.
-   Variants such as size, colour, model, or configuration.
-   Units of measure.
-   Cost price, selling price, wholesale price, and optional price
    lists.
-   Tax category and discount rules.
-   Serial-number and IMEI tracking where applicable.
-   Reorder level and preferred supplier.
-   Product bundles or kits where required.

Services:

-   Service name, description, category, duration, base price, and
    status.
-   Labour charges and service components.
-   Optional service packages.
-   Assigned staff or skill requirements.
-   Service-specific terms, warranties, and checklists.

A business may sell products, services, or both.

### 5.6 Inventory and warehouse management

-   Multiple branches and warehouses.
-   Stock receipts, issues, transfers, and adjustments.
-   Stock movement ledger with reason, date, user, source, and
    reference.
-   Opening stock and stock counts.
-   Low-stock and reorder alerts.
-   Reserved, available, damaged, and returned stock states where
    appropriate.
-   Serial number and IMEI tracking where enabled.
-   Batch and expiry tracking for business types that need it.
-   Goods received notes.
-   Inventory valuation using a clearly selected costing method.
-   Stock reports by product, category, branch, and warehouse.
-   Approval controls for sensitive adjustments and transfers.

**Non-negotiable inventory rule:** Do not change stock quantity without
recording a corresponding stock movement. Stock balances should be
traceable to the movement ledger. Use database transactions and
concurrency-safe operations for stock-affecting actions.

### 5.7 Sales and point of sale (POS)

-   Create quotations, orders, invoices, and sales.
-   Fast product and service search.
-   Cart, quantities, discounts, taxes, and configurable charges.
-   Cash, transfer, card, and other configured payment methods.
-   Full and partial payments.
-   Split payments where needed.
-   Receipts and printable/downloadable invoices.
-   Sales returns, refunds, and exchanges.
-   Customer credit sales with permission and limits.
-   Salesperson attribution and commission capability.
-   Sales by date, branch, staff member, customer, and product.
-   Configurable invoice and receipt numbering.

POS should be usable on desktop, tablet, and mobile screens. Barcode
scanning should be supported where practical.

### 5.8 Purchasing and suppliers

-   Supplier profiles and contacts.
-   Purchase requests and purchase orders.
-   Goods received and supplier bills.
-   Partial and full supplier payments.
-   Purchase returns and supplier credits.
-   Supplier balances and statements.
-   Purchase history and supplier performance.
-   Stock receipt linked to the originating purchase record.

### 5.9 Service, repair, and job management

Designed for repairers, technicians, maintenance providers, and other
service businesses.

-   Service requests and job cards with unique references.
-   Customer and asset/device details.
-   Device model, serial number, IMEI, accessories, and reported
    condition where applicable.
-   Intake photographs and customer-supplied notes.
-   Diagnosis, quotation, approval, and customer authorization.
-   Job assignment, status, priority, and due date.
-   Labour and parts used, linked to inventory movements.
-   Technician notes and progress history.
-   Testing and quality-control checklist.
-   Collection, delivery, payment, and handover records.
-   Warranty terms and service history.
-   Customer notifications and job status tracking.
-   Optional customer acknowledgement/signature.

Suggested configurable workflow: Received → Diagnosing → Awaiting
Approval → Awaiting Parts → In Progress → Quality Check → Ready for
Collection → Completed. Businesses must be able to adapt statuses to
their workflow.

### 5.10 Project and task management

Designed for developers, agencies, consultants, and businesses
delivering work over time.

-   Client projects and project references.
-   Project descriptions, budgets, start/end dates, and status.
-   Project members and role assignments.
-   Tasks, subtasks, priorities, deadlines, and dependencies.
-   Kanban boards and list views.
-   Milestones and deliverables.
-   Time entries and work logs.
-   Files, comments, and activity history.
-   Client approvals and change requests.
-   Project expenses, invoices, and profitability.
-   Maintenance contracts and renewal reminders.
-   Project reports and overdue-task alerts.

Potential future enhancements include Gantt timelines, client portals,
resource planning, and advanced time tracking.

### 5.11 Finance, expenses, and reporting

Initial operational finance scope:

-   Income and expense recording.
-   Expense categories and attachments.
-   Customer receivables and supplier payables.
-   Payment allocation to invoices and bills.
-   Cash, bank, and payment account tracking.
-   Cash movement and reconciliation support.
-   Sales, purchase, expense, and payment reports.
-   Inventory valuation and cost reports.
-   Service and project profitability reports.
-   Customer and supplier statements.
-   Export to CSV, Excel, and PDF.

**Accounting integrity requirement:** Design financial records so posted
transactions are traceable and corrections are made through reversals or
adjustment records rather than silently overwriting history. Before
marketing the product as full accounting software, implement and
validate a proper double-entry general ledger, chart of accounts,
journals, trial balance, balance sheet, and profit-and-loss statements.

### 5.12 Employee and team management

-   Staff profiles and business memberships.
-   Roles and granular permissions.
-   Branch assignment.
-   Team and department structure.
-   Task, job, and sales assignment.
-   Activity and performance reporting.
-   Optional attendance, leave, and payroll integrations in later
    phases.

The initial product should not claim to be a complete HR or payroll
system unless those capabilities are separately scoped and implemented.

### 5.13 Notifications and communication

-   In-app notifications.
-   Email notifications.
-   Optional SMS and messaging integrations.
-   Low-stock alerts.
-   Invoice and payment reminders.
-   Repair/job status updates.
-   Task and project deadline reminders.
-   Subscription and renewal notices.
-   User notification preferences and delivery history.

### 5.14 Files and documents

-   Secure uploads for customer, product, repair, project, and
    transaction records.
-   File type and size validation.
-   Private storage by default for sensitive documents.
-   Authorization checks on every download.
-   File metadata, ownership, and retention policies.
-   Malware scanning where supported.
-   Configurable storage limits by subscription plan.

## 6. Cross-module workflows

The platform's value depends on modules working together.

### 6.1 Product sale

Customer → POS cart → Stock availability check → Sale/invoice → Payment
→ Stock movement → Receipt → Reports.

### 6.2 Repair job

Customer → Device intake → Diagnosis → Quotation → Customer approval →
Parts reservation/issue → Repair → Quality check → Invoice/payment →
Handover → Warranty history.

### 6.3 Web development project

Customer → Project creation → Quotation/contract → Milestones and tasks
→ Time and expense records → Progress updates → Invoice/payment →
Delivery → Maintenance contract and renewal reminder.

### 6.4 Purchasing and stock replenishment

Low-stock alert → Purchase order → Goods received → Stock movement →
Supplier bill → Supplier payment → Updated inventory and reports.

## 7. User roles and permissions

Provide configurable role-based access control. Suggested starting
roles:

-   Business owner.
-   Business administrator.
-   Manager.
-   Accountant.
-   Salesperson/cashier.
-   Technician.
-   Storekeeper.
-   Project manager.
-   Staff/member with custom permissions.

Permissions should be granular and grouped by module and action, such as
view, create, edit, approve, delete, export, refund, adjust stock, and
manage settings.

Use least-privilege defaults. Sensitive actions should support approval
requirements and audit logging.

## 8. SaaS plans and monetization

The platform should support configurable subscription plans rather than
hardcoding prices or limits.

Possible plan dimensions:

-   Number of businesses.
-   Users and staff seats.
-   Branches and warehouses.
-   Enabled modules.
-   Storage capacity.
-   Monthly transaction or usage limits.
-   Reporting and export features.
-   Support level.
-   API and integration access.

Support trial periods, monthly and annual billing, renewals,
failed-payment handling, grace periods, upgrades, downgrades,
cancellation, and receipts.

Subscription enforcement must be predictable and must not silently
destroy customer data. Define read-only or restricted-access behaviour
for expired subscriptions, with clear renewal and data-export processes.

Payment gateway selection and commercial pricing are to be decided
separately after market and cost validation.

## 9. Technical architecture

### 9.1 Application stack

-   **Backend:** Laravel 13, subject to verifying the selected PHP
    version against Laravel's official compatibility requirements.
-   **Frontend:** React.
-   **Integration:** Inertia.js.
-   **UI styling:** Tailwind CSS.
-   **Database:** MySQL.
-   **Local environment:** XAMPP for Apache and MySQL where appropriate.
-   **Development server:** Laravel Artisan server may be used during
    development; Apache may also serve the application's `public`
    directory when correctly configured.
-   **Dependency management:** Composer and npm.
-   **Version control:** Git.
-   **Testing:** PHPUnit or Pest, with a consistent project-wide choice.
-   **Background jobs:** Laravel queues.
-   **Real-time capability:** Laravel Reverb or another suitable
    broadcasting service when required.
-   **File storage:** Local private storage for development;
    production-compatible object storage abstraction for deployment.

Verify PHP, Laravel, database, and package compatibility from official
release documentation before upgrading production dependencies.

### 9.2 Architectural principles

-   Modular, maintainable code organised around business capabilities.
-   Clear separation between platform administration and tenant
    operations.
-   Tenant context resolved and authorized centrally.
-   Form requests or equivalent validation for incoming data.
-   Policies and permissions for authorization.
-   Database transactions for multi-step financial and stock operations.
-   Events and queued jobs for appropriate asynchronous work.
-   Consistent error handling and audit logging.
-   API-ready design without prematurely splitting the application into
    microservices.
-   Responsive and accessible user interface.
-   Automated tests for critical business rules and tenant boundaries.

### 9.3 Data design principles

-   Use stable primary keys and appropriate unique constraints.
-   Add tenant/business ownership to tenant-owned records.
-   Index frequently filtered and joined columns, including tenant
    identifiers.
-   Use foreign keys where appropriate.
-   Store monetary amounts in suitable fixed-precision decimal columns,
    not floating-point types.
-   Store timestamps consistently and respect each business's timezone
    for display and reporting.
-   Use soft deletion only where appropriate; preserve financial and
    audit history.
-   Keep stock movements, payments, and posted financial transactions
    traceable.
-   Use database transactions and locking/concurrency controls for
    critical updates.
-   Avoid duplicating customer, product, and supplier records across
    modules without a deliberate reason.

## 10. Security, privacy, and reliability requirements

-   Secure password hashing and authentication.
-   Email verification and password reset.
-   Optional multi-factor authentication.
-   CSRF protection and secure session configuration.
-   Authorization on every server-side action.
-   Tenant isolation across web pages, APIs, exports, files, jobs, and
    reports.
-   Input validation and output escaping.
-   Protection against SQL injection, XSS, CSRF, IDOR, and
    mass-assignment vulnerabilities.
-   Rate limiting for authentication and sensitive endpoints.
-   Secure secrets and environment configuration.
-   Audit logs for sensitive business actions.
-   Regular backups and tested restoration procedures.
-   Defined retention, deletion, and export processes.
-   Privacy-conscious collection of customer and staff information.
-   Production HTTPS and secure cookie settings.
-   Dependency and security update process.

No system should claim to be perfectly secure. Security must be
continuously tested and improved.

## 11. User experience requirements

-   Professional, clean, consistent SaaS interface.
-   Responsive desktop, tablet, and mobile layouts.
-   Clear navigation and business/branch switchers.
-   Role-aware dashboards and menus.
-   Fast search, filtering, sorting, and pagination.
-   Accessible forms with useful validation messages.
-   Consistent empty states, loading states, and error messages.
-   Confirmation for destructive or financially sensitive actions.
-   Printable invoices, receipts, and job cards.
-   Configurable business branding where appropriate.
-   Simple onboarding for non-technical business owners.

## 12. Development phases

### Phase 0 --- Discovery and technical foundation

-   Confirm requirements and user journeys.
-   Inspect the generated Laravel/React starter project.
-   Confirm framework and dependency versions.
-   Establish Git repository and development conventions.
-   Design tenant, account, business, branch, and membership model.
-   Define authorization and audit approach.
-   Create database relationship diagrams and migration plan.

**Exit criteria:** Approved architecture, core data model, working local
environment, and automated test setup.

### Phase 1 --- SaaS foundation

-   Authentication and account profile.
-   Business onboarding and business switching.
-   Tenant context and data isolation.
-   Memberships, roles, and permissions.
-   Business settings.
-   Branches and warehouses.
-   Platform administration baseline.
-   Audit logging foundation.

**Exit criteria:** A user can create or join businesses, switch between
them, and access only authorized business records. Cross-tenant tests
pass.

### Phase 2 --- Core business records

-   Customers and suppliers.
-   Product and service catalogue.
-   Categories, units, and pricing.
-   Inventory locations.
-   Stock movement ledger.
-   Opening stock and stock counts.

**Exit criteria:** Businesses can maintain customers, suppliers,
products, services, and traceable inventory.

### Phase 3 --- Sales and purchasing

-   POS and sales workflow.
-   Quotations and invoices.
-   Payments and receipts.
-   Returns and refunds.
-   Purchase orders and goods received.
-   Supplier bills and payments.
-   Basic operational reports.

**Exit criteria:** End-to-end sale and purchase workflows update
financial and stock records correctly.

### Phase 4 --- Service and project operations

-   Service requests and repair job cards.
-   Diagnosis, approval, parts, labour, and completion.
-   Project, task, milestone, and time tracking.
-   Project/client billing links.
-   Notifications and activity history.

**Exit criteria:** A technician can complete a traceable service job and
a professional can manage a client project from start to delivery.

### Phase 5 --- Finance and management reporting

-   Expense management.
-   Receivables and payables.
-   Cash/bank records.
-   Inventory valuation.
-   Management dashboards and exports.
-   Accounting design and implementation decision.

**Exit criteria:** Reports reconcile to source transactions and clearly
distinguish cash, revenue, costs, and profit.

### Phase 6 --- SaaS subscriptions and integrations

-   Subscription plans and entitlements.
-   Trial and renewal management.
-   Payment gateway integration.
-   Email/SMS integrations.
-   Storage limits and usage monitoring.
-   Platform support workflows.

**Exit criteria:** A business can subscribe, pay, renew, and use only
the capabilities included in its plan.

### Phase 7 --- Production readiness and launch

-   Security and tenant-isolation review.
-   Performance and load testing.
-   Backup and restore testing.
-   Error monitoring and operational logging.
-   Deployment pipeline and environment configuration.
-   User acceptance testing.
-   Documentation, onboarding, and support process.
-   Controlled pilot with selected businesses.

**Exit criteria:** Critical workflows, security controls, recovery
procedures, and support operations are validated before general release.

## 13. Initial release priorities

The first usable release should focus on a dependable foundation and the
most widely shared business workflows:

1.  Account registration and business onboarding.
2.  Multiple businesses and tenant isolation.
3.  Branches and warehouses.
4.  Users, roles, and permissions.
5.  Customers and suppliers.
6.  Products and services.
7.  Inventory movements.
8.  Sales, invoices, receipts, and payments.
9.  Basic expenses and reports.

Repair management and project management should follow as specialized
modules built on the same customer, service, product, invoice, and
payment foundations.

## 14. Explicitly deferred scope

The following are not required for the first release and should be
considered only after core workflows are stable:

-   Full payroll and statutory HR administration.
-   Full double-entry accounting, unless separately prioritized and
    properly scoped.
-   Native Android and iOS applications.
-   Offline-first synchronization.
-   Advanced Gantt and resource planning.
-   E-commerce storefronts and customer self-service portals.
-   Marketplace integrations.
-   Complex manufacturing and bill-of-materials workflows.
-   Advanced multi-company consolidation.
-   AI forecasting and automated business recommendations.
-   Franchise management and highly customized industry editions.

The architecture should allow future additions without making these
features prerequisites for the initial release.

## 15. Definition of done

A module is not complete merely because its screens exist. It is
complete when:

-   Business rules are documented and implemented.
-   Validation and authorization are enforced server-side.
-   Tenant boundaries are tested.
-   Database changes are reversible where practical.
-   Critical operations use transactions where required.
-   Audit history exists for sensitive actions.
-   Empty, loading, success, and failure states are handled.
-   Responsive behaviour is checked.
-   Automated tests cover key workflows and edge cases.
-   Reports reconcile with underlying records.
-   User-facing terminology and help text are understandable.
-   Relevant documentation is updated.

## 16. Immediate next steps

1.  Inspect the generated Laravel project and confirm its actual
    Laravel, PHP, React, Inertia, and package versions.
2.  Create and initialize the Git repository.
3.  Confirm the local MySQL connection and create a dedicated
    development database.
4.  Produce the initial entity-relationship diagram.
5.  Design and review the account, business, membership, branch,
    warehouse, role, permission, and audit tables.
6.  Implement the SaaS foundation before building sales or inventory
    screens.
7.  Add automated tenant-isolation tests before introducing real
    customer data.

## 17. Project governance and change control

This document is the approved baseline for product direction and
architecture.

Changes that affect tenant boundaries, account ownership, financial
records, inventory integrity, subscription entitlements, or security
must be reviewed before implementation.

New feature requests should be assessed for: - Which business types need
the feature. - Whether it belongs in the shared core or an optional
module. - Data ownership and permissions. - Effects on existing
workflows and reports. - Subscription and operational implications. -
Security, privacy, and testing requirements.

Maintain a decision log for material architecture changes. Do not
silently change approved foundational decisions during implementation.

------------------------------------------------------------------------

**Approved direction:** Build PC Business Suite as a modular,
multi-tenant business management SaaS for diverse product-based and
service-based businesses, with strong tenant isolation, shared business
foundations, configurable modules, and phased delivery.
