@promoboxx/graphql-gateway-types 1.11.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/schema.graphql CHANGED
@@ -305,18 +305,6 @@ input AddContractData {
305
305
  title: String
306
306
  }
307
307
 
308
- input AddFundsParams {
309
- amount_cents: String!
310
- brand_id: ID!
311
- source: String!
312
- source_id: ID!
313
- }
314
-
315
- type AddFundsResponse {
316
- deposit_id: ID
317
- transaction_id: ID
318
- }
319
-
320
308
  input AddLogoToAdAccountParams {
321
309
  id: ID!
322
310
  logo_id: ID!
@@ -924,11 +912,6 @@ enum BrandStatus {
924
912
  unlocked
925
913
  }
926
914
 
927
- type BrandWallet {
928
- id: String
929
- payment_methods: [PaymentMethod!]
930
- }
931
-
932
915
  enum BulkCollectionOperation {
933
916
  deactivate
934
917
  delete
@@ -3615,11 +3598,84 @@ input LeadsListParams {
3615
3598
  sort_direction: String
3616
3599
  }
3617
3600
 
3601
+ """
3602
+ Ledger Type
3603
+ belongs to a wallet, represents an amount of money that can be spent based on a set of restriction
3604
+ """
3618
3605
  type Ledger {
3619
- balance: String
3620
- id: String
3621
- restrictions: [Restriction!]
3622
- wallet_id: ID
3606
+ balance: String!
3607
+ created_at: String!
3608
+ created_by_id: String!
3609
+ expiration_date: String
3610
+ id: ID!
3611
+ refunded_at: String
3612
+ restrictions: [Restriction!]!
3613
+ wallet_id: ID!
3614
+ }
3615
+
3616
+ type LedgersResponse {
3617
+ ledgers: [Ledger!]!
3618
+ }
3619
+
3620
+ input LegacyWithdrawal {
3621
+ """The amount to withdraw in cents"""
3622
+ amount_cents: String!
3623
+ destination: LegacyWithdrawalDestination
3624
+ metadata: LegacyWithdrawalMetadata
3625
+ source: LegacyWithdrawalSource
3626
+
3627
+ """
3628
+ Abitrary type of the withdrawl
3629
+ ex: brand-withdrawal-to-pbxx-wallet
3630
+ """
3631
+ transaction_type: String!
3632
+ }
3633
+
3634
+ """
3635
+ The destination.
3636
+ This example is like a black hole... the magic wallet
3637
+ key: promoboxx
3638
+ value: 00000000-0000-0000-0000-000000000000
3639
+ """
3640
+ input LegacyWithdrawalDestination {
3641
+ restriction: LegacyWithdrawalRestriction
3642
+ }
3643
+
3644
+ """
3645
+ The who/how for the withdrawal
3646
+ ex:
3647
+ sent_via: postman
3648
+ sent_by: tsharkey
3649
+ """
3650
+ input LegacyWithdrawalMetadata {
3651
+ sent_by: String!
3652
+ sent_via: String!
3653
+ }
3654
+
3655
+ input LegacyWithdrawalParams {
3656
+ """
3657
+ Unique key to be used to ensure the withdrawal, once processed, will not be processed again.
3658
+ For most use cases directly from the UI this can just be a random uuid.
3659
+ Note, this does need to be int he proper uuid format.
3660
+ """
3661
+ idempotency_key: String!
3662
+ withdrawals: [LegacyWithdrawal!]!
3663
+ }
3664
+
3665
+ type LegacyWithdrawalResponse {
3666
+ wallet_balance: String!
3667
+ wallet_id: String!
3668
+ }
3669
+
3670
+ input LegacyWithdrawalRestriction {
3671
+ key: String!
3672
+ value: String!
3673
+ }
3674
+
3675
+ input LegacyWithdrawalSource {
3676
+ id: String!
3677
+ restriction: LegacyWithdrawalRestriction
3678
+ type: String!
3623
3679
  }
3624
3680
 
3625
3681
  type Legend {
@@ -3808,6 +3864,25 @@ type Logo {
3808
3864
  file: File
3809
3865
  }
3810
3866
 
3867
+ input MakeDepositData {
3868
+ amount_cents: String!
3869
+ destination: WalletTargetData
3870
+ idempotency_key: String!
3871
+ metadata: String
3872
+ source: RestrictionData
3873
+ transaction_type: String!
3874
+ }
3875
+
3876
+ input MakeTransferData {
3877
+ idempotency_key: String!
3878
+ transfers: [TransferData]!
3879
+ }
3880
+
3881
+ input MakeWithdrawalData {
3882
+ idempotency_key: String!
3883
+ withdrawals: [WithdrawalData!]!
3884
+ }
3885
+
3811
3886
  type MapChart {
3812
3887
  chart: Chart
3813
3888
  scale: MapScale
@@ -3846,7 +3921,6 @@ type Mutation {
3846
3921
  """
3847
3922
  addBillboard(data: AddBillboardData!): Billboard
3848
3923
  addContract(brandId: ID!, data: AddContractData!): Contract
3849
- addFunds(params: AddFundsParams!): AddFundsResponse!
3850
3924
  addLogoToAdAccount(params: AddLogoToAdAccountParams!): AdAccount!
3851
3925
  addRetailerToRetailerAccount(params: AddRetailerToRetailerAccountParams!): AddRetailerToRetailerAccountResponse!
3852
3926
  approveContentRequest(campaign_request_id: ID!): ContentRequest!
@@ -3936,6 +4010,21 @@ type Mutation {
3936
4010
  inviteRetailers(params: InviteRetailersParams!): ID
3937
4011
  inviteRetailersAndPublishPaidAd(inviteParams: InviteRetailersParams!, publishParams: PublishPaidAdParams!): ID!
3938
4012
  joinRetailer(brandId: ID!, linkId: ID!): Permission!
4013
+
4014
+ """
4015
+ Make a deposit to a source account
4016
+ internal only
4017
+ """
4018
+ make_deposit(data: MakeDepositData!): Transaction
4019
+
4020
+ """Make a transfer between accounts"""
4021
+ make_transfer(data: MakeTransferData): Boolean
4022
+
4023
+ """
4024
+ Make a withdrawal from a source account
4025
+ internal only
4026
+ """
4027
+ make_withdrawal(data: MakeWithdrawalData!): Transaction
3939
4028
  markAllAlertsAsRead(include_retailers: Boolean, resourceId: ID!): String!
3940
4029
  markCampaignInvitationOptIn(id: ID!): ID!
3941
4030
  markCampaignInvitationOptOut(id: ID!): ID!
@@ -3955,6 +4044,9 @@ type Mutation {
3955
4044
  rejectBrandRequest(brand_request: RejectBrandRequestBrandRequest, id: ID!): BrandRequest!
3956
4045
  resendAccessInvitation(id: ID!): ID!
3957
4046
  resetInvitations(params: ResetInvitationsParams!): [Invitations!]!
4047
+
4048
+ """Reset a transfer given an idempotency key"""
4049
+ reset_transfer(idempotency_key: String!): Transaction
3958
4050
  revokeBrandRequest(id: ID!): BrandRequest!
3959
4051
  setAccountFacebookPage(accountId: ID!, id: ID!): ID
3960
4052
  setAccountFacebookPages(params: [SetAccountFacebookPagesInput!]!): [ID!]
@@ -3998,7 +4090,7 @@ type Mutation {
3998
4090
  uploadCsv(brandId: String!, params: UploadCsvParams!): UploadCsvResponse @deprecated(reason: "Use bulkUpdateRetailerData or bulkDeleteRetailerData")
3999
4091
  upsertContentRequests(campaign_requests: [UpsertContentRequestInput!], fields: [String!]): [ContentRequest!]
4000
4092
  upsertFacebookUser(signedRequest: String!, uuid: ID!): UpsertFacebookUserResponse
4001
- withdrawal(params: WithdrawalParams!): WithdrawalResponse!
4093
+ withdrawal(params: LegacyWithdrawalParams!): LegacyWithdrawalResponse! @deprecated(reason: "Use the supergraph/wallet-service")
4002
4094
  }
4003
4095
 
4004
4096
  input NewEvent {
@@ -4097,6 +4189,17 @@ enum OptimizationGoal {
4097
4189
  THRUPLAY
4098
4190
  }
4099
4191
 
4192
+ """
4193
+ Type Pagination
4194
+ Represents the pagination information for a request
4195
+ """
4196
+ type Pagination {
4197
+ offset: Int!
4198
+ page_size: Int!
4199
+ sort_fields: [Sort!]!
4200
+ total_count: Int!
4201
+ }
4202
+
4100
4203
  """The paging parameter response from `getBillboards`"""
4101
4204
  type Paging {
4102
4205
  offset: Int
@@ -4105,14 +4208,15 @@ type Paging {
4105
4208
  total_results: Int!
4106
4209
  }
4107
4210
 
4108
- input PaidAdFilterGroups {
4109
- filters: [FilterGroups!]
4211
+ type PagingResponse {
4212
+ offset: Int
4213
+ page_size: Int
4214
+ sort: String
4215
+ total_results: Int!
4110
4216
  }
4111
4217
 
4112
- type PaymentMethod {
4113
- balance_cents: String
4114
- id: String
4115
- type: String
4218
+ input PaidAdFilterGroups {
4219
+ filters: [FilterGroups!]
4116
4220
  }
4117
4221
 
4118
4222
  type Permission {
@@ -4252,6 +4356,12 @@ type PutEventsResp {
4252
4356
  }
4253
4357
 
4254
4358
  type Query {
4359
+ """
4360
+ get brand_retailer_ledgers
4361
+ a list of business/retailer wallets that are associated to the requested brand.
4362
+ Each wallet contains the list of ledgers associated to the business/retailer and their expiration date if applicable.
4363
+ """
4364
+ brand_retailer_ledgers(brand_id: ID!, business_ids: [ID!]!, funded: Boolean): WalletsResponse!
4255
4365
  bulkGetUsersByUuidAndBrandId(brand_id: ID!, strict_ordering: Boolean, uuids: [String!]!): BulkGetUsersByUuidAndBrandIdResponse!
4256
4366
  getAccessInvitation(id: ID!, params: GetAccessInvitationParams): AccessInvitation
4257
4367
  getAccessInvitations(params: GetAccessInvitationsParams, resourceId: ID!, resourceType: AccessInvitationResourceType!): GetAccessInvitationsResponse
@@ -4421,7 +4531,24 @@ type Query {
4421
4531
  getTwitterAccounts(params: TwitterAccountParams, resourceId: ID!, resourceType: String!): [TwitterAccount!]!
4422
4532
  getUser(fields: [String!], id: ID!): User!
4423
4533
  getUsers(fields: [String!], filters: GetUserFilters, offset: Int, per_page: Int, resource_id: ID, resource_type: String, search: String, sort_column: String, sort_direction: String): [User!]!
4424
- getWallets(params: WalletsParams!): WalletResponse!
4534
+
4535
+ """
4536
+ get ledgers
4537
+ returns the ledgers for the requested brand or business filtered by the provided restrictions
4538
+ """
4539
+ get_ledgers(brand_id: ID, business_id: ID, exclusions: String, restrictions: String): LedgersResponse!
4540
+
4541
+ """
4542
+ get transaction history
4543
+ returns the transaction history for the requested brand or business
4544
+ """
4545
+ get_transaction_history(brand_id: ID, business_id: ID, limit: Int, offset: Int, sort: String): TransactionHistory!
4546
+
4547
+ """
4548
+ get wallet by brand or business
4549
+ returns the wallet and the associated ledgers for the requested brand or business
4550
+ """
4551
+ get_wallet_by_brand_or_business(brand_id: ID, business_id: ID): Wallet!
4425
4552
  manualBusinessRequest(id: ID!, params: FacebookPageParams): FacebookPage
4426
4553
  validateToken: ValidateTokenResponse
4427
4554
  zipDigitalAssets(params: ZipDigitalAssetsParams): ZipDigitalAssetsResponse!
@@ -4530,9 +4657,19 @@ enum ResourceType {
4530
4657
  smart_groups
4531
4658
  }
4532
4659
 
4660
+ """
4661
+ Restriction Type
4662
+ used to restrict the use of a ledger
4663
+ i.e. a ledger can be restricted to a specific brand or business or campaign
4664
+ """
4533
4665
  type Restriction {
4534
- key: String
4535
- value: String
4666
+ filter_value: String!
4667
+ key: String!
4668
+ }
4669
+
4670
+ input RestrictionData {
4671
+ type: String!
4672
+ value: String!
4536
4673
  }
4537
4674
 
4538
4675
  type Retailer {
@@ -5046,6 +5183,15 @@ type Socials {
5046
5183
  share_data: String
5047
5184
  }
5048
5185
 
5186
+ """
5187
+ Type Sort
5188
+ Represents the sort information for a request
5189
+ """
5190
+ type Sort {
5191
+ direction: String!
5192
+ field: String!
5193
+ }
5194
+
5049
5195
  input SortFields {
5050
5196
  direction: String
5051
5197
  field: String!
@@ -5210,6 +5356,56 @@ type TotalDivisionReferralStat {
5210
5356
  reps: Int
5211
5357
  }
5212
5358
 
5359
+ """
5360
+ Type Transaction
5361
+ Represents the source and destination, destination, amount and type of a transaction
5362
+ """
5363
+ type Transaction {
5364
+ amount: String!
5365
+ created_at: String!
5366
+ created_by_id: ID!
5367
+ destination_wallet_id: ID
5368
+ destination_wallet_type: String!
5369
+ id: ID!
5370
+ idempotency_key: String!
5371
+ metadata: String
5372
+ source_wallet_id: ID
5373
+ source_wallet_type: String!
5374
+ transaction_type: String!
5375
+ wallet_id: ID!
5376
+ wallet_running_balance: String!
5377
+ }
5378
+
5379
+ """
5380
+ Type TransactionHistory
5381
+ Represents a list of transactions
5382
+ """
5383
+ type TransactionHistory {
5384
+ paging: Pagination
5385
+ transactions: [Transaction!]!
5386
+ }
5387
+
5388
+ """
5389
+ Type Transfer
5390
+ Represents a transfer from one wallet to another
5391
+ """
5392
+ type Transfer {
5393
+ amount_cents: String!
5394
+ destination: WalletTarget
5395
+ metadata: String
5396
+ source: WalletTarget
5397
+ transaction_type: String!
5398
+ }
5399
+
5400
+ """A transfer is a transaction between two accounts"""
5401
+ input TransferData {
5402
+ amount_cents: String!
5403
+ destination: WalletTargetData
5404
+ metadata: String
5405
+ source: WalletTargetData
5406
+ transaction_type: String!
5407
+ }
5408
+
5213
5409
  type TwitterAccount {
5214
5410
  authenticated_local: Boolean
5215
5411
  auto_share_enabled: Boolean
@@ -5656,20 +5852,42 @@ type ViewStat {
5656
5852
  opened: Int
5657
5853
  }
5658
5854
 
5855
+ """
5856
+ Wallet Type
5857
+ Represents a wallet for a brand or business
5858
+ a wallet will only have a brand id or a business id set which indicates the type of wallet
5859
+ """
5659
5860
  type Wallet {
5660
- balance: String
5861
+ balance: String!
5661
5862
  brand_id: ID
5662
5863
  business_id: ID
5663
- id: String
5664
- ledgers: [Ledger!]
5864
+ created_at: String!
5865
+ created_by_id: ID
5866
+ id: ID!
5867
+ ledgers: [Ledger!]!
5665
5868
  }
5666
5869
 
5667
- type WalletResponse {
5668
- wallets: [Wallet!]
5870
+ """
5871
+ Type WalletTarget
5872
+ Represents the source or destination of a transaction
5873
+ """
5874
+ type WalletTarget {
5875
+ expiration: String
5876
+ id: ID!
5877
+ restriction: Restriction
5878
+ type: String!
5669
5879
  }
5670
5880
 
5671
- input WalletsParams {
5672
- brand_id: ID!
5881
+ input WalletTargetData {
5882
+ expiration: String
5883
+ id: ID!
5884
+ restriction: RestrictionData
5885
+ type: String!
5886
+ }
5887
+
5888
+ """get brand_retailer_ledgers"""
5889
+ type WalletsResponse {
5890
+ wallets: [Wallet!]!
5673
5891
  }
5674
5892
 
5675
5893
  input WeakCreateFilterDataFilterRuleSetCriteria {
@@ -5681,77 +5899,24 @@ input WeakCreateFilterDataFilterRuleSetCriteria {
5681
5899
  within_days: String
5682
5900
  }
5683
5901
 
5684
- input Withdrawal {
5685
- """The amount to withdraw in cents"""
5686
- amount_cents: String!
5687
- destination: WithdrawalDestination
5688
- metadata: WithdrawalMetadata
5689
- source: WithdrawalSource
5690
-
5691
- """
5692
- Abitrary type of the withdrawl
5693
- ex: brand-withdrawal-to-pbxx-wallet
5694
- """
5695
- transaction_type: String!
5696
- }
5697
-
5698
5902
  """
5699
- The destination.
5700
- This example is like a black hole... the magic wallet
5701
- key: promoboxx
5702
- value: 00000000-0000-0000-0000-000000000000
5903
+ Type Withdrawal
5904
+ Represents a withdrawal from a wallet
5703
5905
  """
5704
- input WithdrawalDestination {
5705
- restriction: WithdrawalRestriction
5706
- }
5707
-
5708
- """
5709
- The who/how for the withdrawal
5710
- ex:
5711
- sent_via: postman
5712
- sent_by: tsharkey
5713
- """
5714
- input WithdrawalMetadata {
5715
- sent_by: String!
5716
- sent_via: String!
5717
- }
5718
-
5719
- input WithdrawalParams {
5720
- """
5721
- Unique key to be used to ensure the withdrawal, once processed, will not be processed again.
5722
- For most use cases directly from the UI this can just be a random uuid.
5723
- Note, this does need to be int he proper uuid format.
5724
- """
5725
- idempotency_key: String!
5726
- withdrawals: [Withdrawal!]!
5727
- }
5728
-
5729
- type WithdrawalResponse {
5730
- wallet_balance: String!
5731
- wallet_id: String!
5732
- }
5733
-
5734
- input WithdrawalRestriction {
5735
- key: String!
5736
- value: String!
5906
+ type Withdrawal {
5907
+ amount_cents: String!
5908
+ destination: Restriction
5909
+ metadata: String
5910
+ source: WalletTarget
5911
+ transaction_type: String!
5737
5912
  }
5738
5913
 
5739
- """
5740
- Source of the withdrawal
5741
- ex:
5742
- source: {
5743
- id: <brand_uuid>
5744
- type: "brand"
5745
- restriction: {
5746
- key: "brand"
5747
- value: <brand_uuid>
5748
- }
5749
- }
5750
- """
5751
- input WithdrawalSource {
5752
- id: String!
5753
- restriction: WithdrawalRestriction
5754
- type: String!
5914
+ input WithdrawalData {
5915
+ amount_cents: String!
5916
+ destination: RestrictionData
5917
+ metadata: String
5918
+ source: WalletTargetData
5919
+ transaction_type: String!
5755
5920
  }
5756
5921
 
5757
5922
  input ZipDigitalAssetsParams {