diff --git a/.github/workflows/frontend-cicd.yaml b/.github/workflows/frontend-cicd.yaml index 43d68a0a..5b252ab2 100644 --- a/.github/workflows/frontend-cicd.yaml +++ b/.github/workflows/frontend-cicd.yaml @@ -92,6 +92,7 @@ jobs: build-args: | REACT_APP_API_URL=${{ vars.REACT_APP_API_URL }} REACT_APP_SENTRY_DSN=${{ secrets.REACT_APP_SENTRY_DSN }} + REACT_APP_PUBLIC_URL=${{ vars.REACT_APP_PUBLIC_URL }} outputs: type=docker,dest=/tmp/docker_image.tar - name: Upload artifact diff --git a/backend/internal/usecase/mocks/mocks.go b/backend/internal/usecase/mocks/mocks.go index e6767185..c70a1c6c 100644 --- a/backend/internal/usecase/mocks/mocks.go +++ b/backend/internal/usecase/mocks/mocks.go @@ -1139,6 +1139,21 @@ func (mr *MockLogTransactionRepoInterfaceMockRecorder) GetLogTransactionsByUserI return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLogTransactionsByUserID", reflect.TypeOf((*MockLogTransactionRepoInterface)(nil).GetLogTransactionsByUserID), userID, timeRange) } +// LogTransactionSupplyByAssetID mocks base method. +func (m *MockLogTransactionRepoInterface) LogTransactionSupplyByAssetID(assetID int, timeRange, periodInitial, interval string) (entity.LogTransactionSupply, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LogTransactionSupplyByAssetID", assetID, timeRange, periodInitial, interval) + ret0, _ := ret[0].(entity.LogTransactionSupply) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// LogTransactionSupplyByAssetID indicates an expected call of LogTransactionSupplyByAssetID. +func (mr *MockLogTransactionRepoInterfaceMockRecorder) LogTransactionSupplyByAssetID(assetID, timeRange, periodInitial, interval interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LogTransactionSupplyByAssetID", reflect.TypeOf((*MockLogTransactionRepoInterface)(nil).LogTransactionSupplyByAssetID), assetID, timeRange, periodInitial, interval) +} + // StoreLogTransaction mocks base method. func (m *MockLogTransactionRepoInterface) StoreLogTransaction(arg0 entity.LogTransaction) error { m.ctrl.T.Helper() @@ -1153,6 +1168,21 @@ func (mr *MockLogTransactionRepoInterfaceMockRecorder) StoreLogTransaction(arg0 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StoreLogTransaction", reflect.TypeOf((*MockLogTransactionRepoInterface)(nil).StoreLogTransaction), arg0) } +// SumLogTransactionSupply mocks base method. +func (m *MockLogTransactionRepoInterface) SumLogTransactionSupply(timeRange string, timeFrame time.Duration) ([]entity.SumLogTransactionSupply, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SumLogTransactionSupply", timeRange, timeFrame) + ret0, _ := ret[0].([]entity.SumLogTransactionSupply) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SumLogTransactionSupply indicates an expected call of SumLogTransactionSupply. +func (mr *MockLogTransactionRepoInterfaceMockRecorder) SumLogTransactionSupply(timeRange, timeFrame interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SumLogTransactionSupply", reflect.TypeOf((*MockLogTransactionRepoInterface)(nil).SumLogTransactionSupply), timeRange, timeFrame) +} + // SumLogTransactions mocks base method. func (m *MockLogTransactionRepoInterface) SumLogTransactions(timeRange string, timeFrame time.Duration) ([]entity.SumLogTransaction, error) { m.ctrl.T.Helper() diff --git a/backend/internal/usecase/repo/asset_postgres.go b/backend/internal/usecase/repo/asset_postgres.go index f8f9026f..ef96f46a 100644 --- a/backend/internal/usecase/repo/asset_postgres.go +++ b/backend/internal/usecase/repo/asset_postgres.go @@ -127,8 +127,8 @@ func (r AssetRepo) GetAssetByCode(code string) (entity.Asset, error) { func (r AssetRepo) CreateAsset(data entity.Asset) (entity.Asset, error) { res := data - stmt := `INSERT INTO Asset (code, issuer_id, distributor_id, name, asset_type) VALUES ($1, $2, $3,$4, $5) RETURNING id;` - err := r.Db.QueryRow(stmt, data.Code, data.Issuer.Id, data.Distributor.Id, data.Name, data.AssetType).Scan(&res.Id) + stmt := `INSERT INTO Asset (code, issuer_id, distributor_id, name, asset_type, image) VALUES ($1, $2, $3,$4, $5, $6) RETURNING id;` + err := r.Db.QueryRow(stmt, data.Code, data.Issuer.Id, data.Distributor.Id, data.Name, data.AssetType, data.Image).Scan(&res.Id) if err != nil { return entity.Asset{}, fmt.Errorf("AssetRepo - CreateAsset - db.QueryRow: %w", err) } diff --git a/backend/migrations/000027_asset_image.down.sql b/backend/migrations/000027_asset_image.down.sql new file mode 100644 index 00000000..cb93810c --- /dev/null +++ b/backend/migrations/000027_asset_image.down.sql @@ -0,0 +1 @@ +ALTER TABLE asset DROP COLUMN image; \ No newline at end of file diff --git a/backend/migrations/000027_asset_image.up.sql b/backend/migrations/000027_asset_image.up.sql new file mode 100644 index 00000000..a4c5da83 --- /dev/null +++ b/backend/migrations/000027_asset_image.up.sql @@ -0,0 +1 @@ +ALTER TABLE asset ADD COLUMN image BYTEA; \ No newline at end of file diff --git a/frontend/.idea/workspace.xml b/frontend/.idea/workspace.xml index 57c33e7a..60437f27 100644 --- a/frontend/.idea/workspace.xml +++ b/frontend/.idea/workspace.xml @@ -4,20 +4,66 @@