{"openapi":"3.0.0","paths":{"/api":{"get":{"operationId":"AppController_getInfo","parameters":[],"responses":{"200":{"description":""}},"tags":["root"]}},"/api/entitlements":{"get":{"operationId":"EntitlementsController_list","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["entitlements"]}},"/api/reminders/refills":{"get":{"operationId":"RemindersController_refills","parameters":[{"name":"withinDays","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["reminders"]}},"/api/reminders/refills/send":{"post":{"operationId":"RemindersController_sendRefill","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendRefillDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["reminders"]}},"/api/platform/auth/login":{"post":{"operationId":"PlatformAuthController_login","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformLoginDto"}}}},"responses":{"201":{"description":""}},"tags":["platform"]}},"/api/platform/public/plans":{"get":{"operationId":"PlatformPublicController_plans","parameters":[],"responses":{"200":{"description":""}},"tags":["platform"]}},"/api/platform/capabilities":{"get":{"operationId":"PlatformController_capabilities","parameters":[],"responses":{"200":{"description":""}},"tags":["platform"]}},"/api/platform/auth/me":{"get":{"operationId":"PlatformController_me","parameters":[],"responses":{"200":{"description":""}},"tags":["platform"]}},"/api/platform/overview":{"get":{"operationId":"PlatformController_overview","parameters":[],"responses":{"200":{"description":""}},"tags":["platform"]}},"/api/platform/config":{"get":{"operationId":"PlatformController_config","parameters":[],"responses":{"200":{"description":""}},"tags":["platform"]}},"/api/platform/config/{group}":{"put":{"operationId":"PlatformController_saveConfig","parameters":[{"name":"group","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["platform"]}},"/api/platform/config/{group}/test":{"post":{"operationId":"PlatformController_testConfig","parameters":[{"name":"group","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"tags":["platform"]}},"/api/platform/templates":{"get":{"operationId":"PlatformController_listTemplates","parameters":[],"responses":{"200":{"description":""}},"tags":["platform"]}},"/api/platform/templates/{id}":{"get":{"operationId":"PlatformController_getTemplate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["platform"]},"put":{"operationId":"PlatformController_updateTemplate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["platform"]}},"/api/platform/templates/{id}/preview":{"post":{"operationId":"PlatformController_previewTemplate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"tags":["platform"]}},"/api/platform/templates/{id}/test":{"post":{"operationId":"PlatformController_testTemplate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"tags":["platform"]}},"/api/platform/plans":{"get":{"operationId":"PlatformController_plans","parameters":[],"responses":{"200":{"description":""}},"tags":["platform"]},"post":{"operationId":"PlatformController_createPlan","parameters":[],"responses":{"201":{"description":""}},"tags":["platform"]}},"/api/platform/plans/{id}":{"patch":{"operationId":"PlatformController_updatePlan","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["platform"]},"delete":{"operationId":"PlatformController_removePlan","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["platform"]}},"/api/platform/tenants":{"get":{"operationId":"PlatformController_tenants","parameters":[],"responses":{"200":{"description":""}},"tags":["platform"]}},"/api/platform/tenants/{id}":{"get":{"operationId":"PlatformController_tenant","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["platform"]},"patch":{"operationId":"PlatformController_updateTenant","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["platform"]}},"/api/platform/tenants/{id}/users/{userId}/reset-password":{"post":{"operationId":"PlatformController_resetTenantPassword","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"userId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"tags":["platform"]}},"/api/stores/current":{"get":{"operationId":"StoresController_getCurrent","parameters":[],"responses":{"200":{"description":"The active store profile (GST config, invoice prefix, etc.)"}},"security":[{"bearer":[]}],"tags":["stores"]},"patch":{"operationId":"StoresController_updateCurrent","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStoreDto"}}}},"responses":{"200":{"description":"The updated store profile."}},"security":[{"bearer":[]}],"tags":["stores"]}},"/api/stores/current/settings":{"get":{"operationId":"StoresController_getSettings","parameters":[],"responses":{"200":{"description":"Effective store preferences (defaults + overrides)."}},"security":[{"bearer":[]}],"tags":["stores"]},"patch":{"operationId":"StoresController_updateSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStoreSettingsDto"}}}},"responses":{"200":{"description":"The updated store preferences."}},"security":[{"bearer":[]}],"tags":["stores"]}},"/api/health":{"get":{"operationId":"HealthController_check","parameters":[],"responses":{"200":{"description":"Liveness/health probe (checks the database)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}},"tags":["health"]}},"/api/auth/register":{"post":{"operationId":"AuthController_register","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterDto"}}}},"responses":{"201":{"description":""}},"tags":["auth"]}},"/api/auth/login":{"post":{"operationId":"AuthController_login","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginDto"}}}},"responses":{"201":{"description":""}},"tags":["auth"]}},"/api/auth/forgot-password":{"post":{"operationId":"AuthController_forgotPassword","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordDto"}}}},"responses":{"201":{"description":""}},"tags":["auth"]}},"/api/auth/reset-password":{"post":{"operationId":"AuthController_resetPassword","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordWithTokenDto"}}}},"responses":{"201":{"description":""}},"tags":["auth"]}},"/api/auth/me":{"get":{"operationId":"AuthController_me","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["auth"]},"patch":{"operationId":"AuthController_updateMe","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProfileDto"}}}},"responses":{"200":{"description":"The updated profile of the signed-in user."}},"security":[{"bearer":[]}],"tags":["auth"]}},"/api/auth/refresh":{"post":{"operationId":"AuthController_refresh","parameters":[],"responses":{"200":{"description":"A fresh access token for the already-signed-in user."}},"security":[{"bearer":[]}],"tags":["auth"]}},"/api/auth/change-password":{"post":{"operationId":"AuthController_changePassword","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["auth"]}},"/api/products":{"post":{"operationId":"ProductsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProductDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["products"]},"get":{"operationId":"ProductsController_findAll","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"allOf":[{"$ref":"#/components/schemas/Object"}]}},{"name":"pageSize","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"allOf":[{"$ref":"#/components/schemas/Object"}]}},{"name":"search","required":false,"in":"query","description":"Free-text search","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["products"]}},"/api/products/import":{"post":{"operationId":"ProductsController_import","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportProductsDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["products"]}},"/api/products/{id}":{"get":{"operationId":"ProductsController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["products"]},"patch":{"operationId":"ProductsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProductDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["products"]},"delete":{"operationId":"ProductsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["products"]}},"/api/products/{id}/last-purchase":{"get":{"operationId":"ProductsController_lastPurchase","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["products"]}},"/api/products/{id}/merge-preview":{"post":{"operationId":"ProductsController_mergePreview","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeProductsDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["products"]}},"/api/products/{id}/merge":{"post":{"operationId":"ProductsController_merge","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeProductsDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["products"]}},"/api/manufacturers":{"get":{"operationId":"ManufacturersController_list","parameters":[{"name":"search","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["manufacturers"]},"post":{"operationId":"ManufacturersController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateManufacturerDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["manufacturers"]}},"/api/manufacturers/master":{"get":{"operationId":"ManufacturersController_master","parameters":[{"name":"search","required":true,"in":"query","schema":{"type":"string"}},{"name":"limit","required":true,"in":"query","schema":{"type":"string"}},{"name":"offset","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["manufacturers"]}},"/api/manufacturers/{id}":{"patch":{"operationId":"ManufacturersController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateManufacturerDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["manufacturers"]},"delete":{"operationId":"ManufacturersController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["manufacturers"]}},"/api/geo/states":{"get":{"operationId":"GeoController_states","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["geo"]},"post":{"operationId":"GeoController_createState","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateStateDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["geo"]}},"/api/geo/cities":{"get":{"operationId":"GeoController_cities","parameters":[{"name":"search","required":true,"in":"query","schema":{"type":"string"}},{"name":"limit","required":true,"in":"query","schema":{"type":"string"}},{"name":"offset","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["geo"]},"post":{"operationId":"GeoController_createCity","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCityDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["geo"]}},"/api/geo/states/{id}":{"patch":{"operationId":"GeoController_updateState","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStateDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["geo"]},"delete":{"operationId":"GeoController_removeState","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["geo"]}},"/api/geo/cities/{id}":{"patch":{"operationId":"GeoController_updateCity","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCityDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["geo"]},"delete":{"operationId":"GeoController_removeCity","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["geo"]}},"/api/batches":{"post":{"operationId":"BatchesController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBatchDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["batches"]},"get":{"operationId":"BatchesController_findAll","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"allOf":[{"$ref":"#/components/schemas/Object"}]}},{"name":"pageSize","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"allOf":[{"$ref":"#/components/schemas/Object"}]}},{"name":"search","required":false,"in":"query","description":"Free-text search","schema":{"type":"string"}},{"name":"productId","required":false,"in":"query","description":"Filter by product","schema":{"format":"uuid","type":"string"}},{"name":"expiringInDays","required":false,"in":"query","description":"Only batches expiring within N days","schema":{"example":90,"type":"number"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["batches"]}},"/api/batches/import":{"post":{"operationId":"BatchesController_import","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportBatchesDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["batches"]}},"/api/batches/{id}":{"get":{"operationId":"BatchesController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["batches"]},"patch":{"operationId":"BatchesController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBatchDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["batches"]},"delete":{"operationId":"BatchesController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["batches"]}},"/api/batches/{id}/adjust":{"post":{"operationId":"BatchesController_adjust","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdjustStockDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["batches"]}},"/api/suppliers":{"post":{"operationId":"SuppliersController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSupplierDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["suppliers"]},"get":{"operationId":"SuppliersController_findAll","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"allOf":[{"$ref":"#/components/schemas/Object"}]}},{"name":"pageSize","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"allOf":[{"$ref":"#/components/schemas/Object"}]}},{"name":"search","required":false,"in":"query","description":"Free-text search","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["suppliers"]}},"/api/suppliers/import":{"post":{"operationId":"SuppliersController_import","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportSuppliersDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["suppliers"]}},"/api/suppliers/{id}":{"get":{"operationId":"SuppliersController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["suppliers"]},"patch":{"operationId":"SuppliersController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSupplierDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["suppliers"]},"delete":{"operationId":"SuppliersController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["suppliers"]}},"/api/customers":{"post":{"operationId":"CustomersController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomerDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["customers"]},"get":{"operationId":"CustomersController_findAll","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"allOf":[{"$ref":"#/components/schemas/Object"}]}},{"name":"pageSize","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"allOf":[{"$ref":"#/components/schemas/Object"}]}},{"name":"search","required":false,"in":"query","description":"Free-text search","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["customers"]}},"/api/customers/import":{"post":{"operationId":"CustomersController_import","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportCustomersDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["customers"]}},"/api/customers/{id}":{"get":{"operationId":"CustomersController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["customers"]},"patch":{"operationId":"CustomersController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCustomerDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["customers"]},"delete":{"operationId":"CustomersController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["customers"]}},"/api/purchases":{"post":{"operationId":"PurchasesController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePurchaseDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["purchases"]},"get":{"operationId":"PurchasesController_findAll","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"allOf":[{"$ref":"#/components/schemas/Object"}]}},{"name":"pageSize","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"allOf":[{"$ref":"#/components/schemas/Object"}]}},{"name":"search","required":false,"in":"query","description":"Free-text search","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["purchases"]}},"/api/purchases/scan":{"post":{"operationId":"PurchasesController_scanBill","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanBillDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["purchases"]}},"/api/purchases/import":{"post":{"operationId":"PurchasesController_import","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportPurchasesDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["purchases"]}},"/api/purchases/export":{"get":{"operationId":"PurchasesController_export","parameters":[{"name":"period","required":true,"in":"query","schema":{"type":"string"}},{"name":"from","required":true,"in":"query","schema":{"type":"string"}},{"name":"to","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["purchases"]}},"/api/purchases/drafts":{"get":{"operationId":"PurchasesController_listDrafts","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["purchases"]},"post":{"operationId":"PurchasesController_saveDraft","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveDraftDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["purchases"]}},"/api/purchases/drafts/{id}":{"get":{"operationId":"PurchasesController_getDraft","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["purchases"]},"patch":{"operationId":"PurchasesController_updateDraft","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveDraftDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["purchases"]},"delete":{"operationId":"PurchasesController_deleteDraft","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["purchases"]}},"/api/purchases/{id}":{"get":{"operationId":"PurchasesController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["purchases"]}},"/api/purchases/{id}/void":{"post":{"operationId":"PurchasesController_voidPurchase","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["purchases"]}},"/api/purchases/{id}/invoice":{"post":{"operationId":"PurchasesController_attachInvoice","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachInvoiceDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["purchases"]},"get":{"operationId":"PurchasesController_viewInvoice","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["purchases"]},"delete":{"operationId":"PurchasesController_removeInvoice","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["purchases"]}},"/api/users":{"get":{"operationId":"UsersController_list","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["users"]},"post":{"operationId":"UsersController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["users"]}},"/api/users/{id}/reset-password":{"post":{"operationId":"UsersController_resetPassword","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["users"]}},"/api/users/{id}":{"delete":{"operationId":"UsersController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["users"]}},"/api/reports/dashboard":{"get":{"operationId":"ReportsController_dashboard","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["reports"]}},"/api/reports/summary":{"get":{"operationId":"ReportsController_summary","parameters":[{"name":"period","required":true,"in":"query","schema":{"type":"string"}},{"name":"from","required":true,"in":"query","schema":{"type":"string"}},{"name":"to","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["reports"]}},"/api/reports/stock-valuation":{"get":{"operationId":"ReportsController_stockValuation","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["reports"]}},"/api/reports/h1-register":{"get":{"operationId":"ReportsController_h1Register","parameters":[{"name":"period","required":true,"in":"query","schema":{"type":"string"}},{"name":"from","required":true,"in":"query","schema":{"type":"string"}},{"name":"to","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["reports"]}},"/api/reports/alerts":{"get":{"operationId":"ReportsController_alerts","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["reports"]}},"/api/sales/catalog":{"get":{"operationId":"SalesController_catalog","parameters":[{"name":"search","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["sales"]}},"/api/sales/export":{"get":{"operationId":"SalesController_export","parameters":[{"name":"period","required":true,"in":"query","schema":{"type":"string"}},{"name":"from","required":true,"in":"query","schema":{"type":"string"}},{"name":"to","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["sales"]}},"/api/sales/scan-medicine":{"post":{"operationId":"SalesController_scanMedicine","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanMedicineDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["sales"]}},"/api/sales/drafts":{"get":{"operationId":"SalesController_listDrafts","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["sales"]},"post":{"operationId":"SalesController_saveDraft","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveSaleDraftDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["sales"]}},"/api/sales/drafts/{id}":{"get":{"operationId":"SalesController_getDraft","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["sales"]},"patch":{"operationId":"SalesController_updateDraft","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveSaleDraftDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["sales"]},"delete":{"operationId":"SalesController_deleteDraft","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["sales"]}},"/api/sales":{"post":{"operationId":"SalesController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSaleDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["sales"]},"get":{"operationId":"SalesController_findAll","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"allOf":[{"$ref":"#/components/schemas/Object"}]}},{"name":"pageSize","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"allOf":[{"$ref":"#/components/schemas/Object"}]}},{"name":"search","required":false,"in":"query","description":"Free-text search","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["sales"]}},"/api/sales/{id}":{"get":{"operationId":"SalesController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["sales"]},"patch":{"operationId":"SalesController_updateDetails","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["sales"]}},"/api/sales/{id}/whatsapp":{"post":{"operationId":"SalesController_sendWhatsApp","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["sales"]}},"/api/sales/{id}/void":{"post":{"operationId":"SalesController_voidSale","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoidSaleDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["sales"]}},"/api/sale-returns":{"post":{"operationId":"SaleReturnsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSaleReturnDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["sale-returns"]},"get":{"operationId":"SaleReturnsController_findAll","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"allOf":[{"$ref":"#/components/schemas/Object"}]}},{"name":"pageSize","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"allOf":[{"$ref":"#/components/schemas/Object"}]}},{"name":"search","required":false,"in":"query","description":"Free-text search","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["sale-returns"]}},"/api/sale-returns/returnable/{saleId}":{"get":{"operationId":"SaleReturnsController_returnable","parameters":[{"name":"saleId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["sale-returns"]}},"/api/sale-returns/{id}":{"get":{"operationId":"SaleReturnsController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["sale-returns"]},"delete":{"operationId":"SaleReturnsController_void","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["sale-returns"]}},"/api/receivables":{"get":{"operationId":"ReceivablesController_summary","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["receivables"]}},"/api/receivables/{saleId}/payments":{"get":{"operationId":"ReceivablesController_payments","parameters":[{"name":"saleId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["receivables"]},"post":{"operationId":"ReceivablesController_recordPayment","parameters":[{"name":"saleId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordPaymentDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["receivables"]}},"/api/payables":{"get":{"operationId":"PayablesController_summary","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["payables"]}},"/api/payables/{purchaseId}/payments":{"get":{"operationId":"PayablesController_payments","parameters":[{"name":"purchaseId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["payables"]},"post":{"operationId":"PayablesController_recordPayment","parameters":[{"name":"purchaseId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordPaymentDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["payables"]}},"/api/accounting/suppliers":{"get":{"operationId":"AccountingController_supplierParties","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["accounting"]}},"/api/accounting/customers":{"get":{"operationId":"AccountingController_customerParties","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["accounting"]}},"/api/accounting/suppliers/{id}/ledger":{"get":{"operationId":"AccountingController_supplierLedger","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["accounting"]}},"/api/accounting/customers/{id}/ledger":{"get":{"operationId":"AccountingController_customerLedger","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["accounting"]}},"/api/gst/gstr1":{"get":{"operationId":"GstController_gstr1","parameters":[{"name":"month","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["gst"]}},"/api/gst/gstr3b":{"get":{"operationId":"GstController_gstr3b","parameters":[{"name":"month","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["gst"]}},"/api/purchase-orders/suggestions":{"get":{"operationId":"PurchaseOrdersController_suggestions","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["purchase-orders"]}},"/api/purchase-orders":{"post":{"operationId":"PurchaseOrdersController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePurchaseOrderDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["purchase-orders"]},"get":{"operationId":"PurchaseOrdersController_findAll","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["purchase-orders"]}},"/api/purchase-orders/{id}":{"get":{"operationId":"PurchaseOrdersController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["purchase-orders"]},"patch":{"operationId":"PurchaseOrdersController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePurchaseOrderDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["purchase-orders"]},"delete":{"operationId":"PurchaseOrdersController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["purchase-orders"]}},"/api/purchase-orders/{id}/status":{"patch":{"operationId":"PurchaseOrdersController_updateStatus","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePoStatusDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["purchase-orders"]}},"/api/sync/pull":{"post":{"operationId":"SyncController_pull","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PullDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["sync"]}},"/api/sync/push":{"post":{"operationId":"SyncController_push","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["sync"]}}},"info":{"title":"InsightRx API","description":"Medical store (pharmacy) management platform — REST API","version":"0.1.0","contact":{}},"tags":[],"servers":[],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"SendRefillDto":{"type":"object","properties":{}},"PlatformLoginDto":{"type":"object","properties":{}},"UpdateStoreDto":{"type":"object","properties":{"name":{"type":"string","example":"City Medical & General Store"},"gstin":{"type":"string","example":"27ABCDE1234F1Z5"},"drugLicenseNo":{"type":"string","example":"MH-MUM-20B"},"address":{"type":"string","example":"Shop 4, Main Bazaar Road"},"city":{"type":"string","example":"Mumbai"},"state":{"type":"string","example":"Maharashtra"},"pincode":{"type":"string","example":"400001"},"phone":{"type":"string","example":"022-24681012"},"email":{"type":"string","example":"store@citymedical.in"},"invoicePrefix":{"type":"string","example":"CMS","description":"Prefix for new invoice numbers."}}},"UpdateStoreSettingsDto":{"type":"object","properties":{"expiryAlertDays":{"type":"number","minimum":1,"maximum":365,"description":"Expiry alert window in days"},"defaultReorderLevel":{"type":"number","minimum":0,"maximum":1000000,"description":"Fallback low-stock threshold"},"lowStockAlertsEnabled":{"type":"boolean","description":"Show low-stock alerts"},"expiryAlertsEnabled":{"type":"boolean","description":"Show expiry alerts"}}},"HealthResponse":{"type":"object","properties":{}},"RegisterDto":{"type":"object","properties":{"storeName":{"type":"string","example":"City Medical & General Store"},"gstin":{"type":"string","example":"27AAAAA0000A1Z5","description":"Store GSTIN"},"drugLicenseNo":{"type":"string","example":"MH-MUM-20B-123456","description":"Drug licence number"},"phone":{"type":"string","example":"9876543210"},"address":{"type":"string","example":"Shop 4, Main Bazaar Road"},"city":{"type":"string","example":"Mumbai"},"state":{"type":"string","example":"Maharashtra"},"pincode":{"type":"string","example":"400001"},"stateCode":{"type":"string","example":"27","description":"GST state code"},"name":{"type":"string","example":"Store Owner"},"email":{"type":"string","example":"owner@citymedical.in"},"password":{"type":"string","example":"S3curePass!","minLength":8}},"required":["storeName","name","email","password"]},"LoginDto":{"type":"object","properties":{"email":{"type":"string","example":"owner@citymedical.in"},"password":{"type":"string","example":"S3curePass!"}},"required":["email","password"]},"ForgotPasswordDto":{"type":"object","properties":{"email":{"type":"string","example":"owner@store.in"}},"required":["email"]},"ResetPasswordWithTokenDto":{"type":"object","properties":{"token":{"type":"string","description":"Token from the reset email"},"newPassword":{"type":"string","description":"New password (min 8 chars)"}},"required":["token","newPassword"]},"UpdateProfileDto":{"type":"object","properties":{"name":{"type":"string","example":"Anita Deshpande"},"avatarUrl":{"type":"string","description":"Avatar data URL, or \"\" to remove"}}},"ChangePasswordDto":{"type":"object","properties":{"currentPassword":{"type":"string","description":"Current password"},"newPassword":{"type":"string","description":"New password (min 8 chars)"}},"required":["currentPassword","newPassword"]},"CreateProductDto":{"type":"object","properties":{"name":{"type":"string","example":"Paracetamol 650mg"},"genericName":{"type":"string","example":"Paracetamol"},"manufacturer":{"type":"string","example":"Cipla Ltd"},"barcode":{"type":"string","example":"8901234567890","description":"EAN/UPC barcode scanned at billing"},"hsn":{"type":"string","example":"3004","description":"HSN code"},"gstRate":{"type":"number","enum":[0,5,12,18,28],"example":12},"schedule":{"type":"string","enum":["OTC","G","H","H1","X"],"default":"OTC"},"unit":{"type":"string","example":"Tablet","default":"Unit"},"packSize":{"type":"string","example":"10 tablets"},"unitsPerPack":{"type":"number","example":20,"default":1,"description":"Sell-units (strips) in one purchase pack/box"},"reorderLevel":{"type":"number","example":20,"default":0},"rackLocation":{"type":"string","example":"A-3"},"refillDays":{"type":"number","example":30,"description":"Refill interval in days for chronic meds (drives refill reminders)"}},"required":["name","gstRate"]},"ImportProductsDto":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object"}}},"required":["items"]},"Object":{"type":"object","properties":{}},"UpdateProductDto":{"type":"object","properties":{"name":{"type":"string","example":"Paracetamol 650mg"},"genericName":{"type":"string","example":"Paracetamol"},"manufacturer":{"type":"string","example":"Cipla Ltd"},"barcode":{"type":"string","example":"8901234567890","description":"EAN/UPC barcode scanned at billing"},"hsn":{"type":"string","example":"3004","description":"HSN code"},"gstRate":{"type":"number","enum":[0,5,12,18,28],"example":12},"schedule":{"type":"string","enum":["OTC","G","H","H1","X"],"default":"OTC"},"unit":{"type":"string","example":"Tablet","default":"Unit"},"packSize":{"type":"string","example":"10 tablets"},"unitsPerPack":{"type":"number","example":20,"default":1,"description":"Sell-units (strips) in one purchase pack/box"},"reorderLevel":{"type":"number","example":20,"default":0},"rackLocation":{"type":"string","example":"A-3"},"refillDays":{"type":"number","example":30,"description":"Refill interval in days for chronic meds (drives refill reminders)"}}},"MergeProductsDto":{"type":"object","properties":{}},"CreateManufacturerDto":{"type":"object","properties":{"name":{"type":"string","example":"Cipla"}},"required":["name"]},"CreateStateDto":{"type":"object","properties":{"name":{"type":"string","example":"Maharashtra"},"gstCode":{"type":"string","example":"27","description":"Two-digit GST state code"}},"required":["name","gstCode"]},"UpdateStateDto":{"type":"object","properties":{"name":{"type":"string","example":"Maharashtra"},"gstCode":{"type":"string","example":"27"}}},"CreateCityDto":{"type":"object","properties":{"name":{"type":"string","example":"Pune"},"state":{"type":"string","example":"Maharashtra","description":"Must match an existing state"}},"required":["name","state"]},"UpdateCityDto":{"type":"object","properties":{"name":{"type":"string","example":"Pune"},"state":{"type":"string","example":"Maharashtra","description":"Must match an existing state"}}},"CreateBatchDto":{"type":"object","properties":{"productId":{"type":"string","format":"uuid"},"batchNo":{"type":"string","example":"PCM9080"},"expiry":{"type":"string","example":"2026-12-31","description":"Batch expiry date (ISO)"},"mrp":{"type":"number","example":25.5,"description":"Maximum retail price"},"purchasePrice":{"type":"number","example":18,"default":0},"salePrice":{"type":"number","example":25.5},"quantity":{"type":"number","example":100,"default":0,"description":"Opening stock quantity"}},"required":["productId","batchNo","expiry","mrp","salePrice"]},"ImportBatchesDto":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object"}}},"required":["items"]},"UpdateBatchDto":{"type":"object","properties":{"batchNo":{"type":"string","example":"PCM9080"},"expiry":{"type":"string","example":"2026-12-31","description":"Batch expiry date (ISO)"},"mrp":{"type":"number","example":25.5,"description":"Maximum retail price"},"purchasePrice":{"type":"number","example":18,"default":0},"salePrice":{"type":"number","example":25.5}}},"AdjustStockDto":{"type":"object","properties":{"quantity":{"type":"number","example":-5,"description":"Signed quantity: positive = in, negative = out"},"type":{"type":"string","enum":["PURCHASE_IN","SALE_OUT","SALE_RETURN_IN","PURCHASE_RETURN_OUT","ADJUSTMENT","EXPIRY_WRITE_OFF"],"default":"ADJUSTMENT"},"note":{"type":"string","example":"Damaged in transit"}},"required":["quantity"]},"CreateSupplierDto":{"type":"object","properties":{"name":{"type":"string","example":"MedSupply Distributors"},"gstin":{"type":"string","example":"27ABCDE1234F1Z5","description":"Supplier GSTIN"},"phone":{"type":"string","example":"9876543210"},"email":{"type":"string","example":"sales@medsupply.in"},"address":{"type":"string"},"city":{"type":"string","example":"Pune"},"state":{"type":"string","example":"Maharashtra"},"pincode":{"type":"string","example":"411001"}},"required":["name"]},"ImportSuppliersDto":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object"}}},"required":["items"]},"UpdateSupplierDto":{"type":"object","properties":{"name":{"type":"string","example":"MedSupply Distributors"},"gstin":{"type":"string","example":"27ABCDE1234F1Z5","description":"Supplier GSTIN"},"phone":{"type":"string","example":"9876543210"},"email":{"type":"string","example":"sales@medsupply.in"},"address":{"type":"string"},"city":{"type":"string","example":"Pune"},"state":{"type":"string","example":"Maharashtra"},"pincode":{"type":"string","example":"411001"}}},"CreateCustomerDto":{"type":"object","properties":{"name":{"type":"string","example":"Ramesh Kumar"},"phone":{"type":"string","example":"9876543210"},"email":{"type":"string","example":"ramesh@example.in"},"gstin":{"type":"string","example":"27ABCDE1234F1Z5","description":"Customer GSTIN (B2B)"},"address":{"type":"string"},"city":{"type":"string","example":"Pune"},"state":{"type":"string","example":"Maharashtra"},"pincode":{"type":"string","example":"411001"},"doctorName":{"type":"string","example":"Dr. A. Sharma","description":"Referring doctor"}},"required":["name"]},"ImportCustomersDto":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object"}}},"required":["items"]},"UpdateCustomerDto":{"type":"object","properties":{"name":{"type":"string","example":"Ramesh Kumar"},"phone":{"type":"string","example":"9876543210"},"email":{"type":"string","example":"ramesh@example.in"},"gstin":{"type":"string","example":"27ABCDE1234F1Z5","description":"Customer GSTIN (B2B)"},"address":{"type":"string"},"city":{"type":"string","example":"Pune"},"state":{"type":"string","example":"Maharashtra"},"pincode":{"type":"string","example":"411001"},"doctorName":{"type":"string","example":"Dr. A. Sharma","description":"Referring doctor"}}},"PurchaseItemInput":{"type":"object","properties":{"productId":{"type":"string","format":"uuid"},"batchNo":{"type":"string","example":"PCM9080"},"expiry":{"type":"string","example":"2027-06-30"},"mrp":{"type":"number","example":32},"salePrice":{"type":"number","example":32,"description":"Defaults to MRP"},"purchasePrice":{"type":"number","example":22,"description":"Purchase cost (GST-exclusive)"},"quantity":{"type":"number","example":100},"gstRate":{"type":"number","example":12,"description":"Defaults to the product's GST rate"},"discount":{"type":"number","example":4.76,"description":"Trade discount % applied to the list rate"},"listRate":{"type":"number","example":297,"description":"Pre-discount (list) rate as printed on the bill"},"schemePaid":{"type":"number","example":9,"description":"Scheme paid qty (the \"9\" in 9+1)"},"schemeFree":{"type":"number","example":1,"description":"Scheme free qty (the \"1\" in 9+1)"},"schemePercent":{"type":"number","example":5,"description":"Scheme as a flat discount % (instead of free goods)"},"boxMrp":{"type":"number","example":700,"description":"Full-box MRP (loose/strip MRP goes in mrp)"}},"required":["productId","batchNo","expiry","mrp","purchasePrice","quantity"]},"CreatePurchaseDto":{"type":"object","properties":{"supplierId":{"type":"string","format":"uuid"},"invoiceNo":{"type":"string","example":"SUP-2291"},"invoiceDate":{"type":"string","example":"2026-07-27"},"interState":{"type":"boolean","default":false,"description":"Inter-state purchase (IGST instead of CGST/SGST)"},"paidAmount":{"type":"number","example":0,"description":"Amount paid to the supplier now (rest becomes payable)"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseItemInput"}}},"required":["items"]},"ScanBillDto":{"type":"object","properties":{"image":{"type":"string","description":"Base64-encoded bill image or PDF (no data: prefix)"},"mediaType":{"type":"string","enum":["image/jpeg","image/png","image/webp","image/gif","application/pdf"]}},"required":["image","mediaType"]},"ImportPurchasesDto":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object"}},"createMissingProducts":{"type":"boolean","description":"Create products/suppliers that don’t exist (used for scanned bills)"}},"required":["items"]},"SaveDraftDto":{"type":"object","properties":{"label":{"type":"string","description":"Supplier / invoice label for the drafts list"},"payload":{"type":"object","description":"The in-progress purchase form state (header + items)"}},"required":["payload"]},"AttachInvoiceDto":{"type":"object","properties":{"filename":{"type":"string","example":"invoice-1042.pdf"},"mimeType":{"type":"string","enum":["application/pdf","image/jpeg","image/png","image/webp"]},"data":{"type":"string","description":"Base64-encoded file (no data: prefix)"}},"required":["filename","mimeType","data"]},"CreateUserDto":{"type":"object","properties":{"name":{"type":"string","example":"Priya (Pharmacist)"},"email":{"type":"string","example":"priya@citymedical.in"},"password":{"type":"string","example":"Str0ng@Pass","minLength":8},"role":{"type":"string","enum":["PHARMACIST","CASHIER"]}},"required":["name","email","password","role"]},"ResetPasswordDto":{"type":"object","properties":{"newPassword":{"type":"string","description":"New password for the user (min 8 chars)"}},"required":["newPassword"]},"ScanMedicineDto":{"type":"object","properties":{"image":{"type":"string","description":"Base64-encoded photo of the medicine pack (no data: prefix)"},"mediaType":{"type":"string","enum":["image/jpeg","image/png","image/webp","image/gif"]}},"required":["image","mediaType"]},"SaveSaleDraftDto":{"type":"object","properties":{"label":{"type":"string","description":"Customer / item label for the held-bills list"},"payload":{"type":"object","description":"The in-progress billing state (cart + customer + payment)"}},"required":["payload"]},"SaleLineInput":{"type":"object","properties":{"productId":{"type":"string","format":"uuid"},"quantity":{"type":"number","example":2},"unitPrice":{"type":"number","example":32,"description":"GST-inclusive selling price per unit"}},"required":["productId","quantity","unitPrice"]},"CreateSaleDto":{"type":"object","properties":{"paymentMode":{"type":"string","enum":["CASH","CARD","UPI","CREDIT","CHEQUE","BANK"],"default":"CASH"},"discount":{"type":"number","default":0},"interState":{"type":"boolean","default":false},"customerName":{"type":"string"},"customerPhone":{"type":"string"},"customerGstin":{"type":"string","description":"Customer GSTIN (B2B); state code = first 2 chars"},"placeOfSupply":{"type":"string","description":"GST state code of place of supply (B2C inter-state)"},"doctorName":{"type":"string","description":"Prescribing doctor (Schedule H1/H/X)"},"prescriptionNo":{"type":"string","description":"Prescription reference number"},"items":{"type":"array","items":{"$ref":"#/components/schemas/SaleLineInput"}}},"required":["items"]},"VoidSaleDto":{"type":"object","properties":{"reason":{"type":"string","example":"Wrong item billed","description":"Reason for voiding"}}},"SaleReturnItemInput":{"type":"object","properties":{"saleItemId":{"type":"string","format":"uuid","description":"The original sale line (SaleItem) id being returned"},"quantity":{"type":"number","example":1,"description":"Quantity returned (≤ remaining returnable)"}},"required":["saleItemId","quantity"]},"CreateSaleReturnDto":{"type":"object","properties":{"saleId":{"type":"string","format":"uuid","description":"The sale (invoice) being returned against"},"reason":{"type":"string","example":"Wrong medicine"},"refundMode":{"type":"string","enum":["CASH","CARD","UPI","CREDIT","CHEQUE","BANK"],"default":"CASH","description":"How the refund is given"},"items":{"type":"array","items":{"$ref":"#/components/schemas/SaleReturnItemInput"}}},"required":["saleId","items"]},"RecordPaymentDto":{"type":"object","properties":{"amount":{"type":"number","example":500,"description":"Amount paid (must be > 0 and ≤ outstanding)"},"mode":{"type":"string","enum":["CASH","CARD","UPI","CREDIT","CHEQUE","BANK"],"default":"CASH"},"note":{"type":"string","example":"Part payment"},"refNo":{"type":"string","example":"000123","description":"Cheque no. / UTR / transaction reference (required for non-cash modes)"},"refDate":{"type":"string","example":"2026-08-04","description":"Cheque date (required for CHEQUE)"},"bankName":{"type":"string","example":"HDFC Bank","description":"Drawee/remitting bank (required for CHEQUE)"}},"required":["amount"]},"PurchaseOrderItemInput":{"type":"object","properties":{"productId":{"type":"string","format":"uuid"},"quantity":{"type":"number","example":50}},"required":["productId","quantity"]},"CreatePurchaseOrderDto":{"type":"object","properties":{"supplierId":{"type":"string","format":"uuid"},"notes":{"type":"string","example":"Deliver by Friday"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemInput"}}},"required":["items"]},"UpdatePoStatusDto":{"type":"object","properties":{"status":{"type":"string","enum":["DRAFT","SENT","RECEIVED","CANCELLED"]}},"required":["status"]},"PullDto":{"type":"object","properties":{"since":{"type":"string","description":"ISO timestamp of the last successful sync. Omit for a full initial sync.","example":"2026-07-27T00:00:00.000Z"}}},"StockAdjustmentInput":{"type":"object","properties":{"clientId":{"type":"string","description":"Client-generated id for idempotent replay"},"batchId":{"type":"string","format":"uuid"},"quantity":{"type":"number","example":-2,"description":"Signed quantity"},"type":{"type":"string","enum":["PURCHASE_IN","SALE_OUT","SALE_RETURN_IN","PURCHASE_RETURN_OUT","ADJUSTMENT","EXPIRY_WRITE_OFF"],"default":"ADJUSTMENT"},"note":{"type":"string"}},"required":["clientId","batchId","quantity"]},"SaleItemInput":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"productId":{"type":"string","format":"uuid"},"batchId":{"type":"string","format":"uuid"},"quantity":{"type":"number","example":2},"mrp":{"type":"number","example":32},"rate":{"type":"number","example":32},"gstRate":{"type":"number","example":12},"discount":{"type":"number","example":0,"default":0}},"required":["id","productId","batchId","quantity","mrp","rate","gstRate"]},"SaleInput":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Client-generated sale id (idempotency key)"},"invoiceNo":{"type":"string","example":"CMS-20260727-1"},"saleDate":{"type":"string","example":"2026-07-27T10:15:00.000Z"},"paymentMode":{"type":"string","enum":["CASH","CARD","UPI","CREDIT","CHEQUE","BANK"],"default":"CASH"},"discount":{"type":"number","default":0},"taxable":{"type":"number"},"tax":{"type":"number"},"total":{"type":"number"},"interState":{"type":"boolean","default":false},"customerName":{"type":"string"},"customerPhone":{"type":"string"},"customerGstin":{"type":"string","description":"Customer GSTIN (B2B)"},"placeOfSupply":{"type":"string","description":"GST state code of place of supply (B2C inter-state)"},"doctorName":{"type":"string","description":"Prescribing doctor (Schedule H1/H/X)"},"prescriptionNo":{"type":"string","description":"Prescription reference number"},"items":{"type":"array","items":{"$ref":"#/components/schemas/SaleItemInput"}}},"required":["id","invoiceNo","saleDate","taxable","tax","total","items"]},"PushDto":{"type":"object","properties":{"stockAdjustments":{"type":"array","items":{"$ref":"#/components/schemas/StockAdjustmentInput"}},"sales":{"type":"array","items":{"$ref":"#/components/schemas/SaleInput"}}}}}}}