Merge pull request 'FEATURE(wallets): rename WALLET_RIAL/WALLET_REWARD and add WALLET_PROMOTION' (#4) from feature/wallet-refactor into master
Reviewed-on: #4
This commit is contained in:
commit
059de2914d
3 changed files with 9 additions and 6 deletions
|
|
@ -313,7 +313,9 @@ Non-secret values only — pulled from `main/settings.py` and this checkout's ow
|
|||
| `OAUTH2_PROVIDER_PUBLIC_URL` / `_PRIVATE_URL` | Central accounts service's OAuth2 endpoints (token issuance, introspection). Points at the accounts service's staging environment — see this checkout's own `.env` for the actual hostname. |
|
||||
| `ACCOUNTS_BASE_PUBLIC_URL` | Accounts service REST API (user/application profile reads). |
|
||||
| `WALLET_BASE_PUBLIC_URL` | Wallet service REST API (deposit submit/verify). |
|
||||
| `WALLET_RIAL` / `WALLET_REWARD` | UUIDs of specific `Wallet` (currency pool) rows in the wallet service — not amounts. `WALLET_REWARD` is the pool promotions pays out of; passed as both the deposit's `payer_wallet` and its `payee_wallet`, since payer (this app's pool) and payee (the user) share one currency. |
|
||||
| `WALLET_RIAL_DEPOSIT` | UUID of the rial currency pool row in the wallet service. Not currently referenced by any code path in this checkout. |
|
||||
| `WALLET_USER_BILLBOARD_VISIT_INCOME` | UUID of the reward-type wallet on the user's side — the `payee_wallet` for every promotion deposit. Same UUID/naming as the identically-named var in `advertising`/`settlement`; despite the name, it's the generic reward-currency wallet type, not billboard-specific. |
|
||||
| `WALLET_PROMOTION` | UUID of this service's own pool — the `payer_wallet` for every promotion deposit. Previously shared the `WALLET_REWARD` value with the payee side; now a distinct wallet dedicated to promotions. |
|
||||
| `NOTIFICATIONS_BASE_PUBLIC_URL` | Notifications service REST API. |
|
||||
| `OAUTH2_CLIENT_ID` / `_SECRET` / `_SCOPES` | This service's own client-credentials identity, used for every outbound call above via `login_as_client_credentials()` (token cached under the key `promotions_access_token`). |
|
||||
|
||||
|
|
|
|||
|
|
@ -489,7 +489,7 @@ class Promotion(BaseModel):
|
|||
"uuid": payment_uuid,
|
||||
"payee": str(self.user_uuid),
|
||||
"payee_type": 1,
|
||||
"payee_wallet": settings.WALLET_REWARD,
|
||||
"payee_wallet": settings.WALLET_USER_BILLBOARD_VISIT_INCOME,
|
||||
"amount": self.promotion_amount,
|
||||
"details": {
|
||||
'description': str(_(self.recipient.label)),
|
||||
|
|
@ -499,7 +499,7 @@ class Promotion(BaseModel):
|
|||
}
|
||||
|
||||
try:
|
||||
submit_response = deposit_to_user_wallet_submit(settings.WALLET_REWARD, data)
|
||||
submit_response = deposit_to_user_wallet_submit(settings.WALLET_PROMOTION, data)
|
||||
if not submit_response.uuid:
|
||||
raise Exception('Failed to submit promotion. 1')
|
||||
|
||||
|
|
@ -515,7 +515,7 @@ class Promotion(BaseModel):
|
|||
raise Exception('Failed to submit promotion. 2')
|
||||
|
||||
try:
|
||||
verify_response = deposit_to_user_wallet_verify(settings.WALLET_REWARD, submit_response.uuid)
|
||||
verify_response = deposit_to_user_wallet_verify(settings.WALLET_PROMOTION, submit_response.uuid)
|
||||
if not verify_response.uuid:
|
||||
raise Exception('Failed to verify promotion. 1')
|
||||
|
||||
|
|
|
|||
|
|
@ -385,7 +385,8 @@ CELERY_RESULT_BACKEND = REDIS_BASE_URL
|
|||
ACCOUNTS_BASE_PUBLIC_URL = config('ACCOUNTS_BASE_PUBLIC_URL', default=None, cast=str)
|
||||
|
||||
WALLET_BASE_PUBLIC_URL = config('WALLET_BASE_PUBLIC_URL', default=None, cast=str)
|
||||
WALLET_RIAL = config('WALLET_RIAL', cast=str)
|
||||
WALLET_REWARD = config('WALLET_REWARD', cast=str)
|
||||
WALLET_RIAL_DEPOSIT = config('WALLET_RIAL_DEPOSIT', cast=str)
|
||||
WALLET_USER_BILLBOARD_VISIT_INCOME = config('WALLET_USER_BILLBOARD_VISIT_INCOME', cast=str)
|
||||
WALLET_PROMOTION = config('WALLET_PROMOTION', cast=str)
|
||||
|
||||
NOTIFICATIONS_BASE_PUBLIC_URL = config('NOTIFICATIONS_BASE_PUBLIC_URL', default=None, cast=str)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue