factory/shape-booking (0.3.1)

Published 2026-08-14 00:40:11 +00:00 by bmiadmin

Installation

{
	"repositories": [{
			"type": "composer",
			"url": ""
		}
	]
}
composer require factory/shape-booking:0.3.1

About this package

Shape A: provider accepts a scheduled request. Pros, services, bookings (FSM), reviews, wallet, notifications — serves the factory_core client.

factory/shape-booking — v0.1.0

Shape A — provider accepts a scheduled request (Makeover, CoWork, LawLab). Serves the factory_core Flutter client verbatim: every JSON field name is copied from the Dart models (models.dart wins on any dispute).

Endpoints (all under /api, product resolved via X-Product-Slug or default)

Method Path Body / notes Response
GET /pros ?q=&area=&per_page= {ok, data:[Pro], meta}
GET /pros/{id} flat Pro
GET /bookings per X-User-Ref (default demo) {ok, data:[Booking], meta}
POST /bookings pro_id, service_name, price_minor, scheduled_label, address (+opt payment_label, fee_minor, tax_minor, tip_minor) flat Booking (client reads id/reference top-level), 201
GET /bookings/{id} flat Booking
PATCH /bookings/{id} tip_minor, my_rating, payment_label, status, review_text flat Booking
GET /booking-notifications {ok, data:[{title, body, time_label}]}
GET /wallet {ok, data:{balance_minor, currency, txs:[WalletTx]}}
POST /wallet/topup amount_minor (+opt method_label) flat WalletTx, 201

Behaviour

  • fee_minor/tax_minor default from product knobs (fee_minor, tax_bps — int basis points via Money::taxMinor).
  • status starts at the product's first configured status; PATCH transitions are forward-only through the kernel FSM, timestamped, audited in-transaction (audit failure rolls the change back).
  • Booking creation also writes the "Booking confirmed" notification and the debit wallet transaction, mirroring the client's offline behaviour.
  • Tables: pros, services, reviews, bookings, wallet_transactions, app_notifications — all product-scoped (product_slug).

Dependencies

Dependencies

ID Version
factory/auth ^0.3 || ^0.4
factory/infra ^0.1 || ^0.2 || ^0.3
factory/kernel ^0.4 || ^0.5 || ^0.6 || ^0.7 || ^0.8 || ^0.9
illuminate/database ^10.0 || ^11.0 || ^12.0 || ^13.0
illuminate/routing ^10.0 || ^11.0 || ^12.0 || ^13.0
illuminate/support ^10.0 || ^11.0 || ^12.0 || ^13.0
php ^8.2

Development dependencies

ID Version
orchestra/testbench ^8.0 || ^9.0 || ^10.0 || ^11.0
phpunit/phpunit ^10.1 || ^11.0 || ^12.0
Details
Composer
2026-08-14 00:40:11 +00:00
10
proprietary
35 KiB
Assets (1)
Versions (3) View all
0.3.2 2026-08-16
0.3.1 2026-08-14
0.3.0 2026-08-06