<commit_before>= Inpassing Web Service
<NAME> <<EMAIL>>

= Data model

_See inpassing/models.py for all the details._

== Org
Orgs have parking spaces and give out passes to users. Each org has a set of
states and some amount of parking spaces.

== User
Users can moderate an org or participate in an org.

== Pass
Passes are defined by a state and a spot number. The state could be 'A', 'B' for
A-B parking or 'M', 'T', 'W', etc for schedules that work on a weekly basis.
Passes don't exist until they are claimed by a user and verified by an org.
Passes are requested through the requestlog table, which stores the user who is
making the request, along with the *requested* state and spot. The Org may
decide to assign the user to a different spot, however.

== DayState
Right now it's basically a string that users of the service will recognize, IE
'A' or 'B' or 'Monday' or 'Tuesday', etc. It is referenced by its unique ID.


= API

|===
| Endpoint | Description | Authentication | Parameters / Form
| `POST /auth/user.jwt`
| Authenticates the user. Return a user auth token to be used header like
  `Authorization: Bearer <token>`
| None
| Form data: `email`, `password`
| `GET /me`
| Returns JSON object of user information based on login token. Includes id,
  first_name, last_name, email, orgs that this user participates in, orgs that
  this user moderates in, and all types of passes: pending, owned, and lent.
| User auth token
| None
| `POST /me/pass_request`
| Requests a pass on behalf of the user. Returns the new request ID.
| User auth token
| Form data: `org_id`, `state_id`, `spot_num`.
| `GET /orgs/<org_id>`
| Returns a JSON object describing the org. If the current user (given an auth
  token) is not a participant or mod of the org, only the name is provided.
  Otherwise the greeting and rules are provided as well.
| User auth token
| URL: `org_id`
|===<commit_msg>Add endpoint ideas for borrowing and lending<commit_after>= Inpassing Web Service
<NAME> <<EMAIL>>

= Data model

_See inpassing/models.py for all the details._

== Org
Orgs have parking spaces and give out passes to users. Each org has a set of
states and some amount of parking spaces.

== User
Users can moderate an org or participate in an org.

== Pass
Passes are defined by a state and a spot number. The state could be 'A', 'B' for
A-B parking or 'M', 'T', 'W', etc for schedules that work on a weekly basis.
Passes don't exist until they are claimed by a user and verified by an org.
Passes are requested through the requestlog table, which stores the user who is
making the request, along with the *requested* state and spot. The Org may
decide to assign the user to a different spot, however.

== DayState
Right now it's basically a string that users of the service will recognize, IE
'A' or 'B' or 'Monday' or 'Tuesday', etc. It is referenced by its unique ID.


= API

|===
| Endpoint | Description | Authentication | Parameters / Form
| `POST /auth/user.jwt`
| Authenticates the user. Return a user auth token to be used header like
  `Authorization: Bearer <token>`
| None
| Form data: `email`, `password`
| `GET /me`
| Returns JSON object of user information based on login token. Includes id,
  first_name, last_name, email, orgs that this user participates in, orgs that
  this user moderates in, and all types of passes: pending, owned, and lent.
| User auth token
| None
| `POST /me/pass_request`
| Requests a pass on behalf of the user. Returns the new request ID.
| User auth token
| Form data: `org_id`, `state_id`, `spot_num`.
| `GET /orgs/<org_id>`
| Returns a JSON object describing the org. If the current user (given an auth
  token) is not a participant or mod of the org, only the name is provided.
  Otherwise the greeting and rules are provided as well.
| User auth token
| URL: `org_id`
|===

== Implementing borrow and lend

.Endpoint Ideas
. `GET /me/lend/<pass_id>?start_date=<>&end_date=<>`
. `GET /me/borrow?type="date_range"&start_date=<>&end_date=<>`
. `GET /me/borrow?type="date"&date=<>`
. `GET /me/borrow?type="indefinite"`
. `GET /me/borrow?type="perpetual"`
{'fraction_non_alphanumeric': 0.09259711702907403, 'fraction_numerical': 0.0, 'mean_word_length': 4.054320987654321, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5721838', 'n_tokens_mistral': 1254, 'n_tokens_neox': 1224, 'n_words': 626}