{"id":21564627,"url":"https://github.com/zven21/aasm","last_synced_at":"2025-04-10T13:07:22.045Z","repository":{"id":56841781,"uuid":"191108150","full_name":"zven21/aasm","owner":"zven21","description":"The finite state machine implementations for Elixir.","archived":false,"fork":false,"pushed_at":"2019-06-11T05:44:40.000Z","size":9,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-24T11:45:45.832Z","etag":null,"topics":["ecto","elixir","elixir-lang","hex","state-machine"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zven21.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-10T06:14:24.000Z","updated_at":"2024-02-14T14:24:03.000Z","dependencies_parsed_at":"2022-08-29T12:51:16.012Z","dependency_job_id":null,"html_url":"https://github.com/zven21/aasm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zven21%2Faasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zven21%2Faasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zven21%2Faasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zven21%2Faasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zven21","download_url":"https://codeload.github.com/zven21/aasm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247934808,"owners_count":21020724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecto","elixir","elixir-lang","hex","state-machine"],"created_at":"2024-11-24T10:16:36.382Z","updated_at":"2025-04-10T13:07:22.029Z","avatar_url":"https://github.com/zven21.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AASM\n\n\u003e The finite state machine implementations for Elixir.\n\n## Table of contents\n\n* [Getting started](#getting-started)\n* [Examples](#examples)\n* [TODO](#todo)\n* [Contributing](#contributing)\n* [Make a pull request](#make-a-pull-request)\n* [License](#license)\n* [Credits](#credits)\n\n## Getting started\n\n* The package can be installed by adding `aasm` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:aasm, \"~\u003e 0.2.0\"}\n  ]\nend\n```\n\n## Examples\n\n```elixir\ndefmodule Dummy.Order do\n  @moduledoc \"\"\"\n  Order model\n  \"\"\"\n\n  use Ecto.Schema\n  import AASM\n\n  aasm :state do\n    state(~w(state_created state_assigned state_finished state_closed)a)\n\n    event(:handle_assigned, %{from: ~w(state_created)a, to: :state_assigned}, fn changeset -\u003e\n      changeset\n    end)\n\n    event(:handle_finished, %{from: ~w(state_assigned)a, to: :state_finished}, fn changeset -\u003e\n      changeset\n    end)\n\n    event(\n      :handle_closed,\n      %{from: ~w(state_created state_assigned state_finished)a, to: :state_closed},\n      fn changeset -\u003e changeset end\n    )\n  end\n\n  schema \"orders\" do\n    field(:state, :string)\n  end\nend\n```\n\n## TODO\n\n* [ ] Support multi db column.\n* [ ] Add before_event.\n* [ ] Initial value\n\n## Contributing\n\nBug report or pull request are welcome.\n\n## Make a pull request\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\nPlease write unit test with your code if necessary.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n## Credits\n\n* [aasm](https://github.com/aasm/aasm) - State machines for Ruby classes.\n* [ecto_state_machine](https://github.com/asiniy/ecto_state_machine) - Other state machine for elixir.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzven21%2Faasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzven21%2Faasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzven21%2Faasm/lists"}