chore: sync submodule state (parent ref update)
Made-with: Cursor
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import { hsmService } from '@/integration/hsm/hsm.service';
|
||||
import { IdentityType, SovereignIdentity } from '@/shared/types';
|
||||
import prisma from '@/shared/database/prisma';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
export interface RootSovereignIdentity {
|
||||
sovereignBankId: string;
|
||||
@@ -38,18 +39,21 @@ export class SovereignIdentityFabricService {
|
||||
rootIdentity.identities.set(IdentityType.MASTER, masterKey.keyId);
|
||||
|
||||
// Store in database
|
||||
await prisma.sovereignIdentity.create({
|
||||
await prisma.sovereign_identities.create({
|
||||
data: {
|
||||
id: uuidv4(),
|
||||
sovereignBankId,
|
||||
identityType: IdentityType.MASTER,
|
||||
identityKey: masterKey.publicKey,
|
||||
hsmKeyId: masterKey.keyId,
|
||||
status: 'active',
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
});
|
||||
|
||||
// Update sovereign bank record
|
||||
await prisma.sovereignBank.update({
|
||||
await prisma.sovereign_banks.update({
|
||||
where: { id: sovereignBankId },
|
||||
data: {
|
||||
rootSovereignKey: rootKey.keyId,
|
||||
@@ -83,13 +87,16 @@ export class SovereignIdentityFabricService {
|
||||
rootIdentity.identities.set(identityType, identityKey.keyId);
|
||||
|
||||
// Store in database
|
||||
await prisma.sovereignIdentity.create({
|
||||
await prisma.sovereign_identities.create({
|
||||
data: {
|
||||
id: uuidv4(),
|
||||
sovereignBankId,
|
||||
identityType,
|
||||
identityKey: identityKey.publicKey,
|
||||
hsmKeyId: identityKey.keyId,
|
||||
status: 'active',
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
});
|
||||
|
||||
@@ -103,7 +110,7 @@ export class SovereignIdentityFabricService {
|
||||
sovereignBankId: string,
|
||||
identityType: string
|
||||
): Promise<{ hsmKeyId: string; identityKey: string } | null> {
|
||||
const identity = await prisma.sovereignIdentity.findFirst({
|
||||
const identity = await prisma.sovereign_identities.findFirst({
|
||||
where: {
|
||||
sovereignBankId,
|
||||
identityType,
|
||||
@@ -189,7 +196,7 @@ export class SovereignIdentityFabricService {
|
||||
* Get all identities for a sovereign bank
|
||||
*/
|
||||
async getSovereignIdentities(sovereignBankId: string): Promise<SovereignIdentity[]> {
|
||||
const identities = await prisma.sovereignIdentity.findMany({
|
||||
const identities = await prisma.sovereign_identities.findMany({
|
||||
where: {
|
||||
sovereignBankId,
|
||||
status: 'active',
|
||||
|
||||
@@ -4,6 +4,7 @@ import prisma from '@/shared/database/prisma';
|
||||
import { sovereignIdentityFabric } from '@/sovereign/identity/sovereign-identity-fabric.service';
|
||||
import { SOVEREIGN_CODES } from '@/shared/constants';
|
||||
import { IdentityType } from '@/shared/types';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
export class OmnlService {
|
||||
/**
|
||||
@@ -11,14 +12,17 @@ export class OmnlService {
|
||||
*/
|
||||
async initializeOmnlInstance(): Promise<void> {
|
||||
// Create OMNL sovereign bank record
|
||||
const omnlBank = await prisma.sovereignBank.upsert({
|
||||
const omnlBank = await prisma.sovereign_banks.upsert({
|
||||
where: { sovereignCode: SOVEREIGN_CODES.OMNL },
|
||||
update: {},
|
||||
create: {
|
||||
id: uuidv4(),
|
||||
sovereignCode: SOVEREIGN_CODES.OMNL,
|
||||
name: 'OMNL Central Bank',
|
||||
bic: 'OMNLXXXX',
|
||||
status: 'active',
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user