Giter Club home page Giter Club logo

organization-app's Introduction

OrganizationApi

OrganizationApi

Usage

To run the application, follow these steps:

  1. Clone the repository.
  2. Install dependencies with mix deps.get.
  3. Create a .env.exs environment file and add your database username and password in the format provided in sample.env.exs
  4. Run mix ecto.create for creating the databases needed and run migration using command mix ecto.migrate.
  5. Start the Phoenix server with mix phx.server.Now you can visit localhost:4000 from your browser.

The application should now be running, and you can make requests to the endpoints using tools like Postman or cURL.

Routes

The following routes are available:

  • GET /api/organizations: Lists all organizations.
  • POST /api/organizations: Creates a new organization.
  • GET /api/organizations/:id: Retrieves a specific organization.
  • PUT /api/organizations/:id: Updates an existing organization.
  • DELETE /api/organizations/:id: Deletes an existing organization.

Testing

You can run the tests with the following command:

mix test

organization-app's People

Contributors

5h15h1r avatar

Watchers

 avatar

organization-app's Issues

Implement Oban

Overview

This task is to implement asynchronous audit log insertion

Subtasks

  • Create migration for oban.
  • Set up oban configuration.
  • Implement oban for async audit log insertion.

implement audit log

Description

This task is to implement audit log in out application. The audit log store all the create, update, delete operations done on the existing tables.
Create a schema for the audit log table with following fields:

  • id (UUID)
  • organization_id (UUID)
  • user_id (UUID)
  • action(CREATE, UPDATE, DELETE)
  • table_name (varchar)
  • record_id (UUID)
  • old_data (jsonb)
  • new_data (jsonb)
  • ip_address (varchar)
  • user_agent (varchar)

Subtasks

  • Create migrations for audit log table with the fields mentioned above.
  • Create routes for audit log endpoint
  • Create context for audit log
  • Make existing controller to add changes to audit log when doing CREATE, UPDATE, DELETE operation.
  • Write tests for the audit log.

Implement soft delete

Description

The task is to implement soft delete for organization and vendor context.

Create endpoint for vendors

Description

The task is to create endpoints for vendors.
Create a schema for vendors with following fields:

  • Name - varchar, Not Null, unique
  • Phone - varchar
  • Email - varchar
  • organization_id - uuid, references: organizations

Subtasks

  • Create migration to set up table column corresponding with the fields above.
  • Create routes for vendors.
  • Create CRUD (Create, Read, Update, Delete) endpoints for vendors API.
  • Write tests for vendors context and the associated controller.

Create Organisation API

Description

The task is to create a new Phoenix project and set up an endpoints for managing organizations.
Create a schema Organizations with the following fields:

  • id (UUID)
  • name (string)
  • logo_url (string)
  • configurations (JSONB)

Sub Tasks

  • Create migration to set up table column corresponding with the fields above.
  • Create routes for the organization API.
  • Implement Create functionality for the Organization endpoint.
  • Implement Read functionality for the Organization endpoint.
  • Implement Update functionality for the Organization endpoint.
  • Implement Delete functionality for the Organization endpoint.
  • Write tests for the Organizations context and the associated controller.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.