Skip to content

Commit

Permalink
update env (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
magaldima authored Nov 9, 2023
1 parent 1b4bd76 commit 9a2f26b
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Database
DB_ROOT_USERNAME=agapay
DB_ROOT_PASSWORD=payments4all
DB_PORT=5433
DATABASE_URL='postgresql://agapay:payments4all@db:5433/agapay?connect_timeout=300'

# Agapay
INCREASE_SANDBOX=true
INCREASE_API_KEY={REPLACE_ME}
BANK_ENTITY={REPLACE_ME}
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ make
make test
```

### Configure environment variables

Copy the `.env.example` file to `.env` and update the values as needed.

```bash
cp .env.example .env
```

### Run locally

First run the following command to spin up the docker containers:
Expand Down
22 changes: 22 additions & 0 deletions prisma/ERD.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ erDiagram
BigInt user_id FK
DateTime created_at
}
"payment_intent" {
BigInt id PK
BigInt amount
String chariot_id "nullable"
String recipient_id FK
BigInt user_id FK
DateTime created_at
}
"transfer" {
BigInt id PK
BigInt amount
Expand All @@ -98,6 +106,7 @@ erDiagram
BigInt id PK
String account_number
String routing_number
payment_rail preferred_payment_rail "nullable"
bank_address_status status
DateTime updated_at
}
Expand All @@ -113,6 +122,8 @@ erDiagram
"payment" }|--|| "recipient" : recipient
"payment" }o--|| "idempotency_key" : idempotency_key
"payment" }|--|| "user" : user
"payment_intent" }|--|| "recipient" : recipient
"payment_intent" }|--|| "user" : user
"transfer" }|--|| "account" : account
"transfer" }o--|| "idempotency_key" : idempotency_key
"transfer" }|--|| "user" : user
Expand Down Expand Up @@ -198,6 +209,16 @@ erDiagram
- `user_id`:
- `created_at`:

### `payment_intent`

**Properties**
- `id`:
- `amount`:
- `chariot_id`:
- `recipient_id`:
- `user_id`:
- `created_at`:

### `transfer`

**Properties**
Expand Down Expand Up @@ -230,5 +251,6 @@ erDiagram
- `id`:
- `account_number`:
- `routing_number`:
- `preferred_payment_rail`:
- `status`:
- `updated_at`:
7 changes: 6 additions & 1 deletion schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ model payment {

// payment_intent represents a payment intent from an account to a recipient
// this is used to track offline payments that are not processed through the API
// TODO: this is not currently used and needs some more thought
model payment_intent {
// the unique identifier for the payment intent
id BigInt @id @default(autoincrement()) @db.BigInt
Expand All @@ -217,7 +218,11 @@ model payment_intent {
user_id BigInt @db.BigInt
user user @relation(fields: [user_id], references: [id], onDelete: Restrict, onUpdate: Cascade, map: "fk_payment_intent_user")
// the time the intent was created
created_at DateTime @default(now()) @db.Timestamptz(6)
created_at DateTime @default(now()) @db.Timestamptz(6)
@@index([chariot_id], map: "idx_payment_intent_chariot_id")
@@index([recipient_id], map: "idx_payment_intent_recipient_id")
@@index([user_id], map: "idx_payment_intent_user_id")
}

// transfer represents a transfer of funds into an account
Expand Down

0 comments on commit 9a2f26b

Please sign in to comment.