Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement an Outbook Django Model #117

Open
12 tasks
mikelane opened this issue Feb 3, 2019 · 2 comments
Open
12 tasks

Implement an Outbook Django Model #117

mikelane opened this issue Feb 3, 2019 · 2 comments
Assignees
Labels
Back End Primarily has work in python and django beginner-friendly enhancement help wanted

Comments

@mikelane
Copy link
Collaborator

mikelane commented Feb 3, 2019

Sisters of the Road Outbook

Description

Sisters is a safe space and is dedicated to maintaning a violence-free, respectful, and dignified environment in the cafe. If a customer violates the house rules, they can be put on an "out", meaning they are not invited to the cafe for some period of time. This duration is determined through a conversation with the customer and sisters staff.

We'd eventually like to be able to support the outbook for Sisters of the Road. We'd like to be able to allow the POS app to know if a client is currently out and we'd like to make it easy for SotR to generate the various reports that they are required to make.

Requirements

Outbook Events

  • New django model with a name OutbookEvents
  • barter account: A required Foreign key field to a barter account (establishing the many-to-one relation).
  • out start date: A required date field
  • out end date: A required date field
  • reason: An optional text field
  • Set the default ordering of the model to be by the out end date in descending order
  • Custom manager method is_barter_account_out that takes a BarterAccount object and returns a bool makes it easy to determine if a given barter account is currently out
  • Custom manager method get_barter_account_out_reason that takes a BarterAccount object and returns a str that makes it easy to see why a given barter account is currently out

BarterAccount Model changes

  • add BarterAccount method add_out_event that adds an event to the outbook for this barter account
  • add @property named is_out to BarterAccount that takes no parameters and returns a bool that uses self in the is_barter_account_out custom manager method
  • add @property named out_reason to BarterAccount that takes no parameters and returns an optional str that uses self to call the get_barter_account_out_reason method.

Tests

Notes:

Testing

Implement the following if the new testing system gets released before this work is done. Please feel free to pair with @mikelane for help on this.

  • It'd be nice to use the upcoming testing system for the tests, if possible. Mike is happy to pair with you on this.
  • It'd also be nice to create a model factory to facilitate the creation of outbook events
  • It'd also be nice to create functionality to optionally add outbook events in the barter account factory
@mikelane mikelane added enhancement Front End Primarily has work in javascript and react Back End Primarily has work in python and django labels Feb 3, 2019
@mikelane mikelane changed the title Outbook Implement an Outbook Feb 3, 2019
@mikelane mikelane changed the title Implement an Outbook Implement an Outbook Django Model Mar 3, 2019
@mikelane mikelane added beginner-friendly help wanted and removed Front End Primarily has work in javascript and react labels Mar 3, 2019
@trezp
Copy link
Collaborator

trezp commented Apr 17, 2019

Hello! I learned about this project at a PyLadies meetup quite a while ago and have been wanting to contribute. Can I start working on this issue? Is this the best place to ask questions, and is the python-for-good slack channel still active? I wasn't able to join it (it said "token revoked"). Thanks :)

@trezp trezp self-assigned this May 4, 2019
@jarrighi
Copy link
Collaborator

jarrighi commented May 4, 2019

Awesome, Treasure! This is a great case to work on. Let us know if you need anything and I'll try to respond quicker next time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Back End Primarily has work in python and django beginner-friendly enhancement help wanted
Projects
None yet
Development

No branches or pull requests

3 participants