Giter Site home page Giter Site logo

factryflow's Introduction

WELCOME

Getting started

  1. Install VS Code and Docker Desktop
  2. Install Remote Development Extension for VS Code
  3. Clone repo
  4. Open in VS CODE, then you should see the following notification (Click Reopen in Container):

Development setup

  1. Duplicate .env.template and rename it .env and add the secrets.

  2. Then Ctrl + Shift + P and select Dev Containers: Rebuild Container

  3. Then Ctrl + Shift + P and select Developer: Reload Window this will ensure that the extensions and formatters work properly. This only needs to be done after a container rebuild.

  4. Run make migrations in terminal to create new migratrions.

  5. Run make migrate in terminal to migrate changes in the database.

  6. Run make sync_roles in terminal to add user roles in the database.

  7. Run make dev in terminal to run django.

Production

  1. Duplicate .env.template and rename it to .env, then add the necessary secrets. Ensure that the value of the DJANGO_ENV environment variable is set to production.
  2. Run docker compose up --build in terminal to build the container and to run the server

SQLite database is set up for development purposes, while PostgreSQL is used for the production environment.

factryflow's People

Contributors

yacobolo avatar ujjwal51 avatar astronaut101 avatar mytechworker avatar mravi07 avatar mjducut-oe avatar loststoner avatar

Stargazers

Reza Rohani avatar  avatar Nikolaus Schlemm avatar  avatar

Forkers

theonlykingpin

factryflow's Issues

Factryflow Initial Checks

Hi @loststoner,

As discussed, here's the first list of findings and changes. Please take note that some of these might still be subjected to change but you may start working on them.

  • Jobs - Dependencies should be Optional.

  • Items - We should have a place for Items CRUD as well. We can place it in Production -> Items.

  • Fields to use:
    External ID (Optional)
    Item name
    Item Description

  • Cardinality:
    1 Item: Many tasks

  • Tasks -> Task Details:
    a. Items should be a dropdown of all listed items instead of free-writing it.
    b. Need to clarify with Jacob if task dependency is different from task predecessors.
    c. Task Type can be optional

  • Deletion confirmation not working. The row is deleted even before I confirm.

  • Dependency:
    a. We should finalize the design of this one with Jacob as I don't think it is supposed to be built like this.

  • Weekly Shift Template and Schedule Details:

  • Schedule Details' IDs should be a foreign key to a weekly shift template. This is so we can reuse schedule details to different shift templates and not the other way around.

  • The flow should be:
    i. Create Schedule Details first Like Monday (1), 6:15am - 3:00 pm
    ii. And then, you can attach this schedule detail into multiple shift templates that require it.
    iii. In creating or updating shift template, we should be able to select multiple shift details.

  • Looks like the "Edit" button is not working as well on some views.
    a. Test on Resources. Create one and make an update by changing the resource type.

Some of the forms can be properly condensed or combined to avoid repetitions. I'll update this list for some ideas.
I will regularly update this list for more findings and updates once I have them clarified from Jacob. Thanks!

Assigning Resources to Tasks

What's Being Introduced?

  • Resource Constraints: These are defined as resources required to be available for the entire duration of a task or process.

Goal

  • The aim is to align the models to reflect factryengine.

Required Models

Two specific models need to be implemented:

  1. ResourceAssignment

    • Attributes:
      • task_id: Identifier for the task.
      • assignment_rule_id: Identifier for the assignment rule.
      • resource_groups: Groups of resources.
      • resource_count: The number of resources.
      • use_all_resources: A boolean indicating whether all resources should be used.
  2. ResourceConstraint

    • Attributes:
      • task_id: Identifier for the task.
      • assignment_rule_id: Identifier for the assignment rule.
      • resources: The actual resources involved.

Relationships

  • Both Constraint and Assignments need to be related either to a task or an assignment rule.

Assignment Rule Models

  • The models for assignment rules will remain unchanged. Assignment rules serve as a dynamic mechanism to apply constraints and assignments to tasks, based on specific criteria, rather than creating these elements directly onto the tasks. This provides a more dynamic way of specifying resources.

Add Custom Field Feature

Issue Description:

Overview:
We want to let users create their own fields for any part of the app. This means they can add extra information that's important to them.

Details:

  • Users can add their own fields to any part of the factryflow application.
  • They can store different types of information for resources, task and other database model using custom field.
  • custom field will be store in the custom field model itself.
  • We'll create a new field in the Base Model called custom_field to hold all the custom fields together. It will be a json field.
  • we will store only the name and value of custom field in the custom_field entity as a json field in the database.

Steps:

  1. Add a custom_field entity in the base model.
  2. Update the form and custom crud views and all services as per new entity in the database.
  3. Update the app's interface so users can add and manage custom fields.
  4. Update the test cases for custom fields.

Benefits:

  • Users can personalize the app to fit their needs.
  • Data will be better organized.
  • Using the factryflow will be more efficient.

Assignement Rules

Feature Overview: Assignment Rules

Purpose: The assignment rules feature is designed to help automate the allocation of workers to tasks based on specific criteria defined by the user. This acts like a query builder that filters and matches tasks to workers.

How It Works:

  1. Rule Creation: Users can create rules to assign specific workers to particular tasks. For example, if you want Worker A to only handle urgent tasks, you can set up a rule for this.

  2. Setting Criteria: Each rule consists of one or more criteria that specify which tasks should be assigned to the worker. Criteria can be based on the task's main fields or related fields, such as items associated with the task or jobs. For instance, a criterion could be that the task description starts with "urgent".

  3. Application Scope: Each rule is applicable to tasks within a specific work center. This means when setting up a rule, you must define the work center where this rule will apply.

  4. Handling Multiple Matches: It's possible for a task to match multiple rules. Therefore, it's important to prioritize rules within their respective work centers to determine which rule should take precedence when assigning a worker to a task.

Implementation Considerations:

  • Users should be able to add, modify, and remove criteria easily.
  • The system must evaluate all rules for a task and apply the highest priority rule when there are multiple matches.
  • Ensure that the rules are efficiently processed, especially when tasks or work centers have numerous associated rules.

Benefits:

  • Streamlines the task assignment process, reducing manual effort.
  • Increases efficiency by ensuring that workers are matched to tasks best suited to their skills or assigned roles based on urgency and other criteria.
  • Enhances flexibility and control in workforce management within the software.

By implementing this feature, the software will enable more dynamic and automated task management, ultimately leading to optimized operational workflows.


Please see the exsiting models

Make Django project production-ready

Update the project so we have the same features working even with these settings:

DEBUG=True
DISABLE_AUTH=False
  • Setup Gunicorn to run the project in a production-ready state
  • Setup the project to be able to run with PostgreSQL - the database we'll be using on production
  • Setup collectstatic for frontend elements

Implement Scheduling Algorithm

High level overview

Parameters:
plan_start_date
horizion_weeks

Algorithm:

convert weekly shift templates to minutes from plan_start until plan_start + horzion

convert operational exceptions to minutes

# Create dict of resources
resource_dict = {}
for resource in resources
	deduct exception intervals from shift template
	build resource

# build task list
tasks = []
For task in tasks
	build assignment from taskresourceassignment
	build task
	

scheduler(tasks = tasks, resources = resources)

Please see:
https://github.com/factryflow/factryflow/blob/feature/setup-scheduler/src/scheduler/services.py#L79

Build Scheduler app models

we need these models to store the output of the scheduling algorithm, which has the following output:
image

They should all be add to the scheduler app.

Models Overview

  1. SchedulerRuns

    • id (AutoField): Primary key, automatically incremented.
    • run_time (DateTimeField): Records when the scheduling process was executed.
    • details (TextField): Stores a summary or details about the scheduling run, such as outcomes, performance metrics, etc.
  2. ResourceIntervals

    • id (AutoField): Primary key, automatically incremented.
    • resource_id (ForeignKey): Links to the Resource model.
    • task_id (ForeignKey): Links to the Task model, indicating the task to which the interval belongs.
    • interval_start (DateTimeField): The start time of the scheduled interval.
    • interval_end (DateTimeField): The end time of the scheduled interval.
  3. ResourceAllocations

    • id (AutoField): Primary key, automatically incremented.
    • task_id (ForeignKey): Links to the Task model.
    • resource_id (ForeignKey): Links to the Resource model, indicating the resource assigned to the task.
  4. Task (existing model)

    • planned_start (DateTimeField): Planned start time for the task.
    • planned_end (DateTimeField): Planned end time for the task.

In the resource manager app we need the models: Resource and ResourceGroup
In the resource assigner app we need the Resource assignments which should reflect the Assignment model in factryengine. You can keep the Assignment Rule and Assignment Rule Constraint.
See: https://github.com/factryflow/factryengine/blob/main/docs/usage.md
.

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.