Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix mock ASE seeding script #3050

Merged
merged 5 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
26 changes: 26 additions & 0 deletions localenv/mock-account-servicing-entity/generated/graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/auth/src/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ type Query {
sortOrder: SortOrder
): GrantsConnection!

"Fetch a grant"
oana-lolea marked this conversation as resolved.
Show resolved Hide resolved
grant(id: ID!): Grant!
"Fetch a specific grant by its ID."
grant("Unique identifier of the grant." id: ID!): Grant!
}

type Mutation {
Expand Down
13 changes: 13 additions & 0 deletions packages/backend/src/asset/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export interface AssetService {
update(options: UpdateOptions): Promise<Asset | AssetError>
delete(options: DeleteOptions): Promise<Asset | AssetError>
get(id: string): Promise<void | Asset>
getByCodeAndScale(code: string, scale: number): Promise<void | Asset>
getPage(pagination?: Pagination, sortOrder?: SortOrder): Promise<Asset[]>
getAll(): Promise<Asset[]>
}
Expand All @@ -59,6 +60,8 @@ export async function createAssetService({
update: (options) => updateAsset(deps, options),
delete: (options) => deleteAsset(deps, options),
get: (id) => getAsset(deps, id),
getByCodeAndScale: (code, scale) =>
getAssetByCodeAndScale(deps, code, scale),
getPage: (pagination?, sortOrder?) =>
getAssetsPage(deps, pagination, sortOrder),
getAll: () => getAll(deps)
Expand Down Expand Up @@ -171,6 +174,16 @@ async function getAsset(
return await Asset.query(deps.knex).whereNull('deletedAt').findById(id)
}

async function getAssetByCodeAndScale(
deps: ServiceDependencies,
code: string,
scale: number
): Promise<void | Asset> {
return await Asset.query(deps.knex)
.where({ code: code, scale: scale })
.first()
}

async function getAssetsPage(
deps: ServiceDependencies,
pagination?: Pagination,
Expand Down
119 changes: 119 additions & 0 deletions packages/backend/src/graphql/generated/graphql.schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions packages/backend/src/graphql/generated/graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading