@@ -43,8 +43,6 @@ type intentModel struct {
4343 IsRemoteSend bool `db:"is_remote_send"`
4444 IsReturned bool `db:"is_returned"`
4545 IsIssuerVoidingGiftCard bool `db:"is_issuer_voiding_gift_card"`
46- IsMicroPayment bool `db:"is_micro_payment"`
47- ExtendedMetadata []byte `db:"extended_metadata"`
4846 State uint `db:"state"`
4947 Version int64 `db:"version"`
5048 CreatedAt time.Time `db:"created_at"`
@@ -69,15 +67,14 @@ func toIntentModel(obj *intent.Record) (*intentModel, error) {
6967 }
7068
7169 m := & intentModel {
72- Id : sql.NullInt64 {Int64 : int64 (obj .Id ), Valid : true },
73- IntentId : obj .IntentId ,
74- IntentType : uint (obj .IntentType ),
75- Mint : mint ,
76- InitiatorOwner : obj .InitiatorOwnerAccount ,
77- ExtendedMetadata : obj .ExtendedMetadata ,
78- State : uint (obj .State ),
79- CreatedAt : obj .CreatedAt ,
80- Version : int64 (obj .Version ),
70+ Id : sql.NullInt64 {Int64 : int64 (obj .Id ), Valid : true },
71+ IntentId : obj .IntentId ,
72+ IntentType : uint (obj .IntentType ),
73+ Mint : mint ,
74+ InitiatorOwner : obj .InitiatorOwnerAccount ,
75+ State : uint (obj .State ),
76+ CreatedAt : obj .CreatedAt ,
77+ Version : int64 (obj .Version ),
8178 }
8279
8380 switch obj .IntentType {
@@ -132,7 +129,6 @@ func fromIntentModel(obj *intentModel) *intent.Record {
132129 IntentId : obj .IntentId ,
133130 IntentType : intent .Type (obj .IntentType ),
134131 InitiatorOwnerAccount : obj .InitiatorOwner ,
135- ExtendedMetadata : obj .ExtendedMetadata ,
136132 State : intent .State (obj .State ),
137133 Version : uint64 (obj .Version ),
138134 CreatedAt : obj .CreatedAt .UTC (),
@@ -203,16 +199,16 @@ func (m *intentModel) dbSave(ctx context.Context, db *sqlx.DB) error {
203199
204200 return pgutil .ExecuteInTx (ctx , db , sql .LevelDefault , func (tx * sqlx.Tx ) error {
205201 query := `INSERT INTO ` + intentTableName + `
206- (intent_id, intent_type, mint, owner, source, destination_owner, destination, quantity, exchange_currency, exchange_rate, native_amount, usd_market_value, is_withdraw, is_deposit, is_remote_send, is_returned, is_issuer_voiding_gift_card, is_micro_payment, extended_metadata, state, version, created_at)
207- VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21 + 1, $22 )
202+ (intent_id, intent_type, mint, owner, source, destination_owner, destination, quantity, exchange_currency, exchange_rate, native_amount, usd_market_value, is_withdraw, is_deposit, is_remote_send, is_returned, is_issuer_voiding_gift_card, state, version, created_at)
203+ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19 + 1, $20 )
208204
209205 ON CONFLICT (intent_id)
210206 DO UPDATE
211- SET state = $20 , version = ` + intentTableName + `.version + 1
212- WHERE ` + intentTableName + `.intent_id = $1 AND ` + intentTableName + `.version = $21
207+ SET state = $18 , version = ` + intentTableName + `.version + 1
208+ WHERE ` + intentTableName + `.intent_id = $1 AND ` + intentTableName + `.version = $19
213209
214210 RETURNING
215- id, intent_id, intent_type, mint, owner, source, destination_owner, destination, quantity, exchange_currency, exchange_rate, native_amount, usd_market_value, is_withdraw, is_deposit, is_remote_send, is_returned, is_issuer_voiding_gift_card, is_micro_payment, extended_metadata, state, version, created_at`
211+ id, intent_id, intent_type, mint, owner, source, destination_owner, destination, quantity, exchange_currency, exchange_rate, native_amount, usd_market_value, is_withdraw, is_deposit, is_remote_send, is_returned, is_issuer_voiding_gift_card, state, version, created_at`
216212
217213 err := tx .QueryRowxContext (
218214 ctx ,
@@ -234,8 +230,6 @@ func (m *intentModel) dbSave(ctx context.Context, db *sqlx.DB) error {
234230 m .IsRemoteSend ,
235231 m .IsReturned ,
236232 m .IsIssuerVoidingGiftCard ,
237- m .IsMicroPayment ,
238- m .ExtendedMetadata ,
239233 m .State ,
240234 m .Version ,
241235 m .CreatedAt ,
@@ -361,7 +355,7 @@ func dbGetAccounts(ctx context.Context, db *sqlx.DB, intentType intent.Type, pag
361355func dbGetIntentByIntentID (ctx context.Context , db * sqlx.DB , intentID string ) (* intentModel , error ) {
362356 res := & intentModel {}
363357
364- query := `SELECT id, intent_id, intent_type, mint, owner, source, destination_owner, destination, quantity, exchange_currency, exchange_rate, native_amount, usd_market_value, is_withdraw, is_deposit, is_remote_send, is_returned, is_issuer_voiding_gift_card, is_micro_payment, extended_metadata, state, version, created_at
358+ query := `SELECT id, intent_id, intent_type, mint, owner, source, destination_owner, destination, quantity, exchange_currency, exchange_rate, native_amount, usd_market_value, is_withdraw, is_deposit, is_remote_send, is_returned, is_issuer_voiding_gift_card, state, version, created_at
365359 FROM ` + intentTableName + `
366360 WHERE intent_id = $1
367361 LIMIT 1`
@@ -381,7 +375,7 @@ func dbGetIntentByIntentID(ctx context.Context, db *sqlx.DB, intentID string) (*
381375func dbGetIntentByID (ctx context.Context , db * sqlx.DB , id int64 ) (* intentModel , error ) {
382376 res := & intentModel {}
383377
384- query := `SELECT id, intent_id, intent_type, mint, owner, source, destination_owner, destination, quantity, exchange_currency, exchange_rate, native_amount, usd_market_value, is_withdraw, is_deposit, is_remote_send, is_returned, is_issuer_voiding_gift_card, is_micro_payment, extended_metadata, state, version, created_at
378+ query := `SELECT id, intent_id, intent_type, mint, owner, source, destination_owner, destination, quantity, exchange_currency, exchange_rate, native_amount, usd_market_value, is_withdraw, is_deposit, is_remote_send, is_returned, is_issuer_voiding_gift_card, state, version, created_at
385379 FROM ` + intentTableName + `
386380 WHERE id = $1
387381 LIMIT 1`
@@ -404,7 +398,7 @@ func dbGetAllByOwner(ctx context.Context, db *sqlx.DB, owner string, cursor q.Cu
404398 models := []* intentModel {}
405399
406400 opts := []any {owner }
407- query1 := `SELECT id, intent_id, intent_type, mint, owner, source, destination_owner, destination, quantity, exchange_currency, exchange_rate, native_amount, usd_market_value, is_withdraw, is_deposit, is_remote_send, is_returned, is_issuer_voiding_gift_card, is_micro_payment, extended_metadata, state, version, created_at
401+ query1 := `SELECT id, intent_id, intent_type, mint, owner, source, destination_owner, destination, quantity, exchange_currency, exchange_rate, native_amount, usd_market_value, is_withdraw, is_deposit, is_remote_send, is_returned, is_issuer_voiding_gift_card, state, version, created_at
408402 FROM ` + intentTableName + `
409403 WHERE (owner = $1 OR destination_owner = $1)
410404 `
@@ -473,7 +467,7 @@ func dbGetAllByOwner(ctx context.Context, db *sqlx.DB, owner string, cursor q.Cu
473467func dbGetOriginalGiftCardIssuedIntent (ctx context.Context , db * sqlx.DB , giftCardVault string ) (* intentModel , error ) {
474468 res := []* intentModel {}
475469
476- query := `SELECT id, intent_id, intent_type, mint, owner, source, destination_owner, destination, quantity, exchange_currency, exchange_rate, native_amount, usd_market_value, is_withdraw, is_deposit, is_remote_send, is_returned, is_issuer_voiding_gift_card, is_micro_payment, extended_metadata, state, version, created_at
470+ query := `SELECT id, intent_id, intent_type, mint, owner, source, destination_owner, destination, quantity, exchange_currency, exchange_rate, native_amount, usd_market_value, is_withdraw, is_deposit, is_remote_send, is_returned, is_issuer_voiding_gift_card, state, version, created_at
477471 FROM ` + intentTableName + `
478472 WHERE destination = $1 and intent_type = $2 AND state != $3 AND is_remote_send IS TRUE
479473 LIMIT 2
@@ -505,7 +499,7 @@ func dbGetOriginalGiftCardIssuedIntent(ctx context.Context, db *sqlx.DB, giftCar
505499func dbGetGiftCardClaimedIntent (ctx context.Context , db * sqlx.DB , giftCardVault string ) (* intentModel , error ) {
506500 res := []* intentModel {}
507501
508- query := `SELECT id, intent_id, intent_type, mint, owner, source, destination_owner, destination, quantity, exchange_currency, exchange_rate, native_amount, usd_market_value, is_withdraw, is_deposit, is_remote_send, is_returned, is_issuer_voiding_gift_card, is_micro_payment, extended_metadata, state, version, created_at
502+ query := `SELECT id, intent_id, intent_type, mint, owner, source, destination_owner, destination, quantity, exchange_currency, exchange_rate, native_amount, usd_market_value, is_withdraw, is_deposit, is_remote_send, is_returned, is_issuer_voiding_gift_card, state, version, created_at
509503 FROM ` + intentTableName + `
510504 WHERE source = $1 and intent_type = $2 AND state != $3 AND is_remote_send IS TRUE
511505 LIMIT 2
0 commit comments