Skip to main content

Reusable Django app for modelling bookable services, categories, and add-ons.

Project description

django-services — Bookable services for Django projects

A reusable Django app (app label: services) that models bookable services, categories, and add-ons for appointment and booking platforms.

What it provides

  • Service categories, services, and service add-ons with pricing, durations, and buffers.
  • Booking-time constraints: minimum notice, maximum advance window, and fixed start intervals.
  • Admin experience with inlines for add-ons and sensible list filters.
  • Optional tenant scoping via a configurable tenant model.

What it does not provide

  • Provider availability, slot generation, or calendars.
  • Booking lifecycle or payments handling.
  • Opinionated multi-tenant framework; only a light integration point.

Installation

pip install mroudai-django-services

Add to INSTALLED_APPS:

INSTALLED_APPS = [
    # ...
    "services",
]

Quick start (single-tenant)

python manage.py migrate
python manage.py createsuperuser
python manage.py runserver

Create categories and services via the Django admin. Slugs are auto-generated and validated for collisions.

Usage

Create categories/services programmatically:

from services.models import ServiceCategory, Service

category = ServiceCategory.objects.create(name="Consultations")
service = Service.objects.create(
    name="Initial Consult",
    category=category,
    duration_minutes=30,
    pricing_type=Service.PricingType.FIXED,
    price_amount=200,
    minimum_notice_minutes=120,
    maximum_advance_days=30,
    fixed_start_times_only=True,
    start_time_interval_minutes=15,
)

# List active services
from services.selectors import list_services
active_services = list_services()

Add-ons with tenant matching (when enabled) are created via ServiceAddon.objects.create(...) and inherit currency if left blank.

Multi-tenant configuration

Set SERVICES_TENANT_MODEL to your tenant model label (e.g. "tenants.Tenant"):

SERVICES_TENANT_MODEL = "tenants.Tenant"
SERVICES_DEFAULT_CURRENCY = "TTD"
SERVICES_ALLOWED_INTERVALS = [5, 10, 12, 15, 20, 30, 60]
SERVICES_MIN_DURATION_MINUTES = 5

When SERVICES_TENANT_MODEL is set, categories, services, and add-ons include a required tenant foreign key and uniqueness constraints are scoped per tenant. Without it, data is global.

Models overview

  • ServiceCategory: name, slug, optional description, sort order, active flag; unique slug (per tenant when enabled).
  • Service: category, name, slug, short/long description, duration, buffers, minimum notice, maximum advance, fixed start intervals, capacity and multi-client flag, pricing (FREE, FIXED, FROM, VARIABLE), currency, cancellation/reschedule rules, metadata.
  • ServiceAddon: service, name, slug, description, active flag, sort order, extra duration, pricing (FREE, FIXED, FROM, VARIABLE), currency (defaults to service), tenant match enforced when enabled.

Admin features

  • Inline add-ons within a service.
  • Filters for activity, visibility, pricing, category (and tenant when configured).
  • Slug auto-generation with collision handling.
  • Model validation enforced on save.

Testing

python -m test services

For tenant-aware runs, override SERVICES_TENANT_MODEL to point at your tenant model and rerun the tests.

Contributing

Issues and pull requests are welcome. Please keep changes small, add tests, and favour clear boundaries between apps. Early-stage API changes may occur as the package matures.

Licence

MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mroudai_django_services-0.1.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mroudai_django_services-0.1.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file mroudai_django_services-0.1.0.tar.gz.

File metadata

  • Download URL: mroudai_django_services-0.1.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for mroudai_django_services-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4babbd042dd7a9b696844c488468ecdf25e1b3c0c32e807e5508dc978b417ea7
MD5 f5ab9ac9466b4d6184254b2331b85751
BLAKE2b-256 cd800e4979d16ec04b43b6ba1f42457c40782932b93870078995891514bca284

See more details on using hashes here.

File details

Details for the file mroudai_django_services-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mroudai_django_services-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42446f9e2d8e3bdd41406145d085c677d162a70f88dc0351fa90e171bce0c08e
MD5 a1206f46541693a079fd111270bc992a
BLAKE2b-256 a452b8986f4ece0795b6877bd49e323e2c613ca604913ab004e5454b32c132c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page