Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ stop-frappe:
reset-frappe:
./dev/erpnext/clean.sh
./dev/erpnext/start.sh
@echo "Waiting 60 seconds for frappe to initialize..."
@sleep 60
@echo "Waiting for frappe-create-site to finish..."
@exit_code=$$(docker wait flash-frappe-create-site-1); if [ "$$exit_code" != "0" ]; then echo "frappe-create-site failed (exit code $$exit_code). Check logs: docker logs flash-frappe-create-site-1"; exit 1; fi
./dev/erpnext/restore.sh dev/erpnext/backups/20260123_132015-frontend-database.sql.gz

start-deps-integration:
Expand Down
81 changes: 61 additions & 20 deletions dev/apollo-federation/supergraph.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -155,28 +155,32 @@ type AccountUpdateNotificationSettingsPayload
errors: [Error!]!
}

type AccountUpgradePayload
@join__type(graph: PUBLIC)
{
errors: [Error]
id: String
status: String
}

type AccountUpgradeRequest
@join__type(graph: PUBLIC)
{
businessAddress: String
businessName: String
address: Address!
bankAccount: BankAccount
currentLevel: AccountLevel!
email: String
email: String!
fullName: String!

"""Whether an ID document is provided with the upgrade request"""
idDocument: Boolean!

"""ERPNext document name"""
name: String!
phoneNumber: String
phoneNumber: String!
requestedLevel: AccountLevel!

"""Status of the upgrade request"""
status: String!

"""Whether a PoS terminal is requested with the upgrade"""
terminalRequested: Boolean!
terminalsRequested: Int!
username: String!
}

Expand All @@ -187,6 +191,30 @@ type AccountUpgradeRequestPayload
upgradeRequest: AccountUpgradeRequest
}

type Address
@join__type(graph: PUBLIC)
{
city: String!
country: String!
line1: String!
line2: String
postalCode: String
state: String!
title: String!
}

input AddressInput
@join__type(graph: PUBLIC)
{
city: String!
country: String!
line1: String!
line2: String
postalCode: String
state: String!
title: String!
}

"""An Opaque Bearer token"""
scalar AuthToken
@join__type(graph: PUBLIC)
Expand All @@ -205,6 +233,26 @@ type Bank
name: String!
}

type BankAccount
@join__type(graph: PUBLIC)
{
accountNumber: Int!
accountType: String!
bankName: String!
branch: String!
currency: String!
}

input BankAccountInput
@join__type(graph: PUBLIC)
{
accountNumber: Int!
accountType: String!
bankBranch: String!
bankName: String!
currency: String!
}

"""
A wallet belonging to an account which contains a BTC balance and a list of transactions.
"""
Expand Down Expand Up @@ -265,19 +313,12 @@ type BuildInformation
input BusinessAccountUpgradeRequestInput
@join__type(graph: PUBLIC)
{
accountNumber: Int
accountType: String
bankBranch: String
bankName: String
businessAddress: String
businessName: String
currency: String
email: String
address: AddressInput!
bankAccount: BankAccountInput
fullName: String!
idDocument: String
level: AccountLevel!
phoneNumber: String
terminalRequested: Boolean
terminalsRequested: Int = 0
}

type CallbackEndpoint
Expand Down Expand Up @@ -1044,7 +1085,7 @@ type Mutation
accountEnableNotificationChannel(input: AccountEnableNotificationChannelInput!): AccountUpdateNotificationSettingsPayload!
accountUpdateDefaultWalletId(input: AccountUpdateDefaultWalletIdInput!): AccountUpdateDefaultWalletIdPayload!
accountUpdateDisplayCurrency(input: AccountUpdateDisplayCurrencyInput!): AccountUpdateDisplayCurrencyPayload!
businessAccountUpgradeRequest(input: BusinessAccountUpgradeRequestInput!): SuccessPayload!
businessAccountUpgradeRequest(input: BusinessAccountUpgradeRequestInput!): AccountUpgradePayload!
callbackEndpointAdd(input: CallbackEndpointAddInput!): CallbackEndpointAddPayload!
callbackEndpointDelete(input: CallbackEndpointDeleteInput!): SuccessPayload!
captchaCreateChallenge: CaptchaCreateChallengePayload!
Expand Down
Binary file not shown.
Binary file modified dev/erpnext/backups/clean-snapshot.sql.gz
Binary file not shown.
11 changes: 8 additions & 3 deletions dev/erpnext/restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@ fi
BACKUP_FILENAME=$(basename "$BACKUP_FILE")

# Copy the backup file from host to container restore directory
docker exec -it flash-frappe-backend-1 mkdir -p /tmp/restore
docker exec flash-frappe-backend-1 mkdir -p /tmp/restore
docker cp "$BACKUP_FILE" flash-frappe-backend-1:/tmp/restore/"$BACKUP_FILENAME"

# Remove stale locks if present (e.g. from frappe-create-site)
docker exec flash-frappe-backend-1 rm -f /home/frappe/frappe-bench/sites/frontend/locks/*.lock 2>/dev/null || true

# Restore the database inside the container with the password
docker exec -it flash-frappe-backend-1 bench --site frontend restore --db-root-password "$DB_PASSWORD" /tmp/restore/"$BACKUP_FILENAME"
docker exec flash-frappe-backend-1 bench --site frontend restore --db-root-password "$DB_PASSWORD" /tmp/restore/"$BACKUP_FILENAME"

# Run migrate to sync database schema with current code
docker exec -it flash-frappe-backend-1 bench --site frontend migrate
echo "Migrating frontend"
docker exec flash-frappe-backend-1 bench --site frontend migrate || {
echo "Migration failed, retrying..."
sleep 5
docker exec flash-frappe-backend-1 bench --site frontend migrate
}
24 changes: 23 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,11 @@ services:
# Frappe/ERPNext services
frappe-backend:
# image: lnflash/frappe-erp-admin:latest
<<<<<<< dev/refactor-acct-upgrade
image: brh28/frappe-flash-admin:1.0.0
=======
image: brh28/frappe-flash:${FRAPPE_TAG:-latest}
>>>>>>> main
deploy:
restart_policy:
condition: on-failure
Expand All @@ -213,7 +217,11 @@ services:
MARIADB_ROOT_PASSWORD: admin

frappe-configurator:
<<<<<<< dev/refactor-acct-upgrade
image: brh28/frappe-flash-admin:1.0.0
=======
image: brh28/frappe-flash:${FRAPPE_TAG:-latest}
>>>>>>> main
deploy:
restart_policy:
condition: none
Expand All @@ -232,6 +240,7 @@ services:
bench set-config -gp socketio_port $$SOCKETIO_PORT;
bench set-config -g flash_admin_api_url $$FLASH_API;
bench set-config -g admin_api_key $$FLASH_SECRET;
bench set-config -gp developer_mode 1;
environment:
DB_HOST: mariadb
DB_PORT: "3306"
Expand All @@ -245,7 +254,11 @@ services:
- frappe-logs:/home/frappe/frappe-bench/logs

frappe-create-site:
<<<<<<< dev/refactor-acct-upgrade
image: brh28/frappe-flash-admin:1.0.0
=======
image: brh28/frappe-flash:${FRAPPE_TAG:-latest}
>>>>>>> main
deploy:
restart_policy:
condition: none
Expand All @@ -265,7 +278,8 @@ services:
export start=`date +%s`;
until [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".db_host // empty"` ]] && \
[[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_cache // empty"` ]] && \
[[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_queue // empty"` ]];
[[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_queue // empty"` ]] && \
[[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".developer_mode // empty"` ]];
do
echo "Waiting for sites/common_site_config.json to be created";
sleep 5;
Expand Down Expand Up @@ -299,7 +313,11 @@ services:
- mariadb-data:/var/lib/mysql

frappe-frontend:
<<<<<<< dev/refactor-acct-upgrade
image: brh28/frappe-flash-admin:1.0.0
=======
image: brh28/frappe-flash:${FRAPPE_TAG:-latest}
>>>>>>> main
ports: ["8080:8080"]
depends_on:
- frappe-websocket
Expand All @@ -322,7 +340,11 @@ services:
- frappe-logs:/home/frappe/frappe-bench/logs

frappe-websocket:
<<<<<<< dev/refactor-acct-upgrade
image: brh28/frappe-flash-admin:1.0.0
=======
image: brh28/frappe-flash:${FRAPPE_TAG:-latest}
>>>>>>> main
deploy:
restart_policy:
condition: on-failure
Expand Down
Loading