multivendor-prescription
v0.0.1
Published
Install-and-use prescription plugin: upload, admin approve/reject, cart write ports, TypeORM entities/migrations, and HTTP controllers
Maintainers
Readme
multivendor-prescription
Wallet-style prescription plugin for multi-vendor marketplaces:
- Customer upload → admin approve/reject → cart lines
- TypeORM entities + migration (
1801000000000-CreatePrescriptionRequestTables) - HTTP controllers (routing-controllers)
- Host ports for cart / product / file / customer / email
Port error contract
| Port | Failure | |------|---------| | Cart write (approve) | Fatal → roll back txn | | Product resolve (approve) | Fatal → roll back txn | | File upload/read | Fatal for create/file | | Customer lookup | Fatal | | Email | Non-fatal — never undo approval |
Reject is usually single-table; if it writes more than prescription_request, use the same EntityManager rule as approve.
Two-phase host rollout
- Phase 1: Package +
PRESCRIPTION_PLUGINdual HTTP path; one entity class (package only). - Phase 2: Delete legacy host controllers/service after staging verify.
Host wiring
import {
registerPrescriptionPlugin,
getPrescriptionOrmMetadata,
PRESCRIPTION_PLUGIN_TOKEN,
} from 'multivendor-prescription';
// connectionOptions: merge getPrescriptionOrmMetadata().entities/migrations
// prescriptionLoader: registerPrescriptionPlugin({ dataSource, flags, ports, logger })
// Container.set(PRESCRIPTION_PLUGIN_TOKEN, plugin)Follow-ups
- Metrics counters (approve latency, email skip rate) — tracked in host issue #4.
- Phase 2 cutover: after staging with
PRESCRIPTION_PLUGIN=true, delete legacy host controllers/service/repos/DTO wrappers and remove the dual-path flag.
