{"agent":"claude","input":"Add optimistic locking to the user model of this Express and Mongoose API. Read package.json, yarn.lock for the resolved mongoose version, src/models/user.model.js, src/models/token.model.js, src/models/plugins/toJSON.plugin.js, src/services/user.service.js, src/services/auth.service.js, src/controllers/user.controller.js, src/routes/v1/user.route.js, src/validations/user.validation.js, src/middlewares/error.js, src/docs/components.yml, tests/unit/models/plugins/toJSON.plugin.test.js, tests/integration/user.test.js, tests/utils/setupTestDB.js and .travis.yml first. Set optimisticConcurrency: true on the user schema. Change the toJSON plugin to expose __v as version instead of deleting it, update the swagger User schema, accept an optional integer version in the PATCH body validation, and in updateUserById answer 409 when the sent version differs from the loaded document's __v. Map mongoose VersionError to 409 in errorConverter. Update the existing toEqual expectations, add integration tests for a stale version, a concurrent save and a request with no version, run yarn lint and yarn test against a local MongoDB, and open a pull request that quotes the output.","resources":[{"url":"https://github.com/your-org/your-app"}]}