chore: sync submodule state (parent ref update)
Made-with: Cursor
This commit is contained in:
@@ -51,12 +51,12 @@ export class MigrationRoadmapService {
|
||||
];
|
||||
|
||||
for (const phaseData of phases) {
|
||||
const existing = await prisma.quantumMigrationPhase.findFirst({
|
||||
const existing = await prisma.quantum_migration_phases.findFirst({
|
||||
where: { phaseNumber: phaseData.phaseNumber },
|
||||
});
|
||||
|
||||
if (!existing) {
|
||||
await prisma.quantumMigrationPhase.create({
|
||||
await prisma.quantum_migration_phases.create({
|
||||
data: {
|
||||
id: uuidv4(),
|
||||
phaseNumber: phaseData.phaseNumber,
|
||||
@@ -74,7 +74,7 @@ export class MigrationRoadmapService {
|
||||
* Get phase by number
|
||||
*/
|
||||
async getPhase(phaseNumber: number) {
|
||||
return await prisma.quantumMigrationPhase.findFirst({
|
||||
return await prisma.quantum_migration_phases.findFirst({
|
||||
where: { phaseNumber },
|
||||
include: { migrations: true },
|
||||
});
|
||||
@@ -84,7 +84,7 @@ export class MigrationRoadmapService {
|
||||
* Get all phases
|
||||
*/
|
||||
async getAllPhases() {
|
||||
return await prisma.quantumMigrationPhase.findMany({
|
||||
return await prisma.quantum_migration_phases.findMany({
|
||||
include: { migrations: true },
|
||||
orderBy: { phaseNumber: 'asc' },
|
||||
});
|
||||
@@ -94,7 +94,7 @@ export class MigrationRoadmapService {
|
||||
* Start phase
|
||||
*/
|
||||
async startPhase(phaseNumber: number) {
|
||||
const phase = await prisma.quantumMigrationPhase.findFirst({
|
||||
const phase = await prisma.quantum_migration_phases.findFirst({
|
||||
where: { phaseNumber },
|
||||
});
|
||||
|
||||
@@ -102,7 +102,7 @@ export class MigrationRoadmapService {
|
||||
throw new Error(`Phase ${phaseNumber} not found`);
|
||||
}
|
||||
|
||||
return await prisma.quantumMigrationPhase.update({
|
||||
return await prisma.quantum_migration_phases.update({
|
||||
where: { id: phase.id },
|
||||
data: {
|
||||
status: 'in_progress',
|
||||
@@ -115,7 +115,7 @@ export class MigrationRoadmapService {
|
||||
* Complete phase
|
||||
*/
|
||||
async completePhase(phaseNumber: number) {
|
||||
const phase = await prisma.quantumMigrationPhase.findFirst({
|
||||
const phase = await prisma.quantum_migration_phases.findFirst({
|
||||
where: { phaseNumber },
|
||||
include: { migrations: true },
|
||||
});
|
||||
@@ -135,7 +135,7 @@ export class MigrationRoadmapService {
|
||||
);
|
||||
}
|
||||
|
||||
return await prisma.quantumMigrationPhase.update({
|
||||
return await prisma.quantum_migration_phases.update({
|
||||
where: { id: phase.id },
|
||||
data: {
|
||||
status: 'completed',
|
||||
@@ -148,7 +148,7 @@ export class MigrationRoadmapService {
|
||||
* Register component migration
|
||||
*/
|
||||
async registerMigration(data: MigrationStatus) {
|
||||
const phase = await prisma.quantumMigrationPhase.findUnique({
|
||||
const phase = await prisma.quantum_migration_phases.findUnique({
|
||||
where: { id: data.phaseId },
|
||||
});
|
||||
|
||||
@@ -156,7 +156,7 @@ export class MigrationRoadmapService {
|
||||
throw new Error(`Phase not found: ${data.phaseId}`);
|
||||
}
|
||||
|
||||
const migration = await prisma.migrationAudit.create({
|
||||
const migration = await prisma.migration_audits.create({
|
||||
data: {
|
||||
id: uuidv4(),
|
||||
phaseId: data.phaseId,
|
||||
@@ -195,7 +195,7 @@ export class MigrationRoadmapService {
|
||||
updateData.migrationDate = new Date();
|
||||
}
|
||||
|
||||
return await prisma.migrationAudit.update({
|
||||
return await prisma.migration_audits.update({
|
||||
where: { id: migrationId },
|
||||
data: updateData,
|
||||
});
|
||||
@@ -205,7 +205,7 @@ export class MigrationRoadmapService {
|
||||
* Get migration status for component
|
||||
*/
|
||||
async getComponentMigrationStatus(componentType: string, componentId: string) {
|
||||
return await prisma.migrationAudit.findMany({
|
||||
return await prisma.migration_audits.findMany({
|
||||
where: {
|
||||
componentType,
|
||||
componentId,
|
||||
@@ -227,7 +227,7 @@ export class MigrationRoadmapService {
|
||||
0
|
||||
);
|
||||
|
||||
const allMigrations = await prisma.migrationAudit.findMany();
|
||||
const allMigrations = await prisma.migration_audits.findMany();
|
||||
const completedMigrations = allMigrations.filter(
|
||||
(m) => m.migrationStatus === 'completed'
|
||||
).length;
|
||||
|
||||
@@ -31,7 +31,7 @@ export class PQCKeyManagerService {
|
||||
* Get key by ID
|
||||
*/
|
||||
async getKey(keyId: string) {
|
||||
return await prisma.cryptographicKey.findUnique({
|
||||
return await prisma.cryptographic_keys.findUnique({
|
||||
where: { keyId },
|
||||
});
|
||||
}
|
||||
@@ -40,7 +40,7 @@ export class PQCKeyManagerService {
|
||||
* Get keys by purpose
|
||||
*/
|
||||
async getKeysByPurpose(keyPurpose: string) {
|
||||
return await prisma.cryptographicKey.findMany({
|
||||
return await prisma.cryptographic_keys.findMany({
|
||||
where: {
|
||||
keyPurpose,
|
||||
status: 'active',
|
||||
@@ -53,7 +53,7 @@ export class PQCKeyManagerService {
|
||||
* Get keys by type
|
||||
*/
|
||||
async getKeysByType(keyType: string) {
|
||||
return await prisma.cryptographicKey.findMany({
|
||||
return await prisma.cryptographic_keys.findMany({
|
||||
where: {
|
||||
keyType,
|
||||
status: 'active',
|
||||
@@ -66,7 +66,7 @@ export class PQCKeyManagerService {
|
||||
* Rotate key
|
||||
*/
|
||||
async rotateKey(keyId: string, newKeyPurpose?: string) {
|
||||
const oldKey = await prisma.cryptographicKey.findUnique({
|
||||
const oldKey = await prisma.cryptographic_keys.findUnique({
|
||||
where: { keyId },
|
||||
});
|
||||
|
||||
@@ -91,7 +91,7 @@ export class PQCKeyManagerService {
|
||||
);
|
||||
|
||||
// Mark old key as rotated
|
||||
await prisma.cryptographicKey.update({
|
||||
await prisma.cryptographic_keys.update({
|
||||
where: { keyId },
|
||||
data: {
|
||||
status: 'rotated',
|
||||
@@ -106,7 +106,7 @@ export class PQCKeyManagerService {
|
||||
* Revoke key
|
||||
*/
|
||||
async revokeKey(keyId: string, reason?: string) {
|
||||
return await prisma.cryptographicKey.update({
|
||||
return await prisma.cryptographic_keys.update({
|
||||
where: { keyId },
|
||||
data: {
|
||||
status: 'revoked',
|
||||
@@ -118,7 +118,7 @@ export class PQCKeyManagerService {
|
||||
* Check key expiration
|
||||
*/
|
||||
async checkKeyExpiration(keyId: string): Promise<boolean> {
|
||||
const key = await prisma.cryptographicKey.findUnique({
|
||||
const key = await prisma.cryptographic_keys.findUnique({
|
||||
where: { keyId },
|
||||
});
|
||||
|
||||
@@ -136,7 +136,7 @@ export class PQCKeyManagerService {
|
||||
const thresholdDate = new Date();
|
||||
thresholdDate.setDate(thresholdDate.getDate() + daysAhead);
|
||||
|
||||
return await prisma.cryptographicKey.findMany({
|
||||
return await prisma.cryptographic_keys.findMany({
|
||||
where: {
|
||||
status: 'active',
|
||||
expiresAt: {
|
||||
@@ -155,7 +155,7 @@ export class PQCKeyManagerService {
|
||||
sovereignIdentityId: string,
|
||||
quantumKeyId: string
|
||||
) {
|
||||
const key = await prisma.cryptographicKey.findUnique({
|
||||
const key = await prisma.cryptographic_keys.findUnique({
|
||||
where: { keyId: quantumKeyId },
|
||||
});
|
||||
|
||||
@@ -167,7 +167,7 @@ export class PQCKeyManagerService {
|
||||
throw new Error(`Key ${quantumKeyId} is not a quantum-safe key`);
|
||||
}
|
||||
|
||||
return await prisma.sovereignIdentity.update({
|
||||
return await prisma.sovereign_identities.update({
|
||||
where: { id: sovereignIdentityId },
|
||||
data: {
|
||||
quantumKeyId,
|
||||
@@ -180,13 +180,13 @@ export class PQCKeyManagerService {
|
||||
* Get quantum-enabled identities
|
||||
*/
|
||||
async getQuantumEnabledIdentities() {
|
||||
return await prisma.sovereignIdentity.findMany({
|
||||
return await prisma.sovereign_identities.findMany({
|
||||
where: {
|
||||
isQuantumEnabled: true,
|
||||
status: 'active',
|
||||
},
|
||||
include: {
|
||||
sovereignBank: true,
|
||||
sovereign_banks: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ export class QuantumCompatibilityService {
|
||||
): Promise<string> {
|
||||
const mappingId = `QPS-MAP-${uuidv4()}`;
|
||||
|
||||
await prisma.legacyProtocolMapping.create({
|
||||
await prisma.legacy_protocol_mappings.create({
|
||||
data: {
|
||||
mappingId,
|
||||
legacyProtocol,
|
||||
@@ -246,7 +246,7 @@ export class QuantumCompatibilityService {
|
||||
* Get protocol mapping
|
||||
*/
|
||||
async getProtocolMapping(legacyProtocol: string) {
|
||||
return await prisma.legacyProtocolMapping.findFirst({
|
||||
return await prisma.legacy_protocol_mappings.findFirst({
|
||||
where: { legacyProtocol, status: 'active' },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -47,8 +47,9 @@ export class QuantumEnvelopeService {
|
||||
await this.createDimensionalHarmonizationHash(request.transactionData);
|
||||
|
||||
// Step 4: Create envelope record
|
||||
const envelope = await prisma.quantumEnvelope.create({
|
||||
const envelope = await prisma.quantum_envelopes.create({
|
||||
data: {
|
||||
id: uuidv4(),
|
||||
envelopeId,
|
||||
legacyTransactionId: request.legacyTransactionId,
|
||||
legacyProtocol: request.legacyProtocol,
|
||||
@@ -57,6 +58,8 @@ export class QuantumEnvelopeService {
|
||||
dimensionalHarmonizationHash,
|
||||
transactionData: request.transactionData as any,
|
||||
status: 'created',
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
});
|
||||
|
||||
@@ -125,7 +128,7 @@ export class QuantumEnvelopeService {
|
||||
private async getPreviousTransactionHash(
|
||||
sourceBankId: string
|
||||
): Promise<string | null> {
|
||||
const lastTransaction = await prisma.quantumProxyTransaction.findFirst({
|
||||
const lastTransaction = await prisma.quantum_proxy_transactions.findFirst({
|
||||
where: { sourceBankId },
|
||||
orderBy: { createdAt: 'desc' },
|
||||
});
|
||||
@@ -138,7 +141,7 @@ export class QuantumEnvelopeService {
|
||||
*/
|
||||
private async getCausalOrder(transactionData: any): Promise<number> {
|
||||
// Get count of transactions from source bank
|
||||
const count = await prisma.quantumProxyTransaction.count({
|
||||
const count = await prisma.quantum_proxy_transactions.count({
|
||||
where: { sourceBankId: transactionData.sourceBankId },
|
||||
});
|
||||
|
||||
@@ -182,7 +185,7 @@ export class QuantumEnvelopeService {
|
||||
* Get envelope by ID
|
||||
*/
|
||||
async getEnvelope(envelopeId: string) {
|
||||
return await prisma.quantumEnvelope.findUnique({
|
||||
return await prisma.quantum_envelopes.findUnique({
|
||||
where: { envelopeId },
|
||||
});
|
||||
}
|
||||
@@ -191,7 +194,7 @@ export class QuantumEnvelopeService {
|
||||
* Verify envelope integrity
|
||||
*/
|
||||
async verifyEnvelopeIntegrity(envelopeId: string): Promise<boolean> {
|
||||
const envelope = await prisma.quantumEnvelope.findUnique({
|
||||
const envelope = await prisma.quantum_envelopes.findUnique({
|
||||
where: { envelopeId },
|
||||
});
|
||||
|
||||
|
||||
@@ -77,8 +77,9 @@ export class QuantumProxyService {
|
||||
);
|
||||
|
||||
// Step 5: Create proxy transaction record
|
||||
const proxyTransaction = await prisma.quantumProxyTransaction.create({
|
||||
const proxyTransaction = await prisma.quantum_proxy_transactions.create({
|
||||
data: {
|
||||
id: uuidv4(),
|
||||
proxyTransactionId,
|
||||
legacyTransactionId: request.legacyTransactionId,
|
||||
legacyProtocol: request.legacyProtocol,
|
||||
@@ -91,6 +92,8 @@ export class QuantumProxyService {
|
||||
currencyCode: request.currencyCode,
|
||||
status: 'bridged',
|
||||
bridgedAt: new Date(),
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
});
|
||||
|
||||
@@ -113,8 +116,9 @@ export class QuantumProxyService {
|
||||
});
|
||||
|
||||
// Create failed transaction record
|
||||
await prisma.quantumProxyTransaction.create({
|
||||
await prisma.quantum_proxy_transactions.create({
|
||||
data: {
|
||||
id: uuidv4(),
|
||||
proxyTransactionId,
|
||||
legacyTransactionId: request.legacyTransactionId,
|
||||
legacyProtocol: request.legacyProtocol,
|
||||
@@ -123,6 +127,8 @@ export class QuantumProxyService {
|
||||
amount: new Decimal(request.amount),
|
||||
currencyCode: request.currencyCode,
|
||||
status: 'failed',
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
});
|
||||
|
||||
@@ -178,11 +184,11 @@ export class QuantumProxyService {
|
||||
* Get proxy transaction by ID
|
||||
*/
|
||||
async getProxyTransaction(proxyTransactionId: string) {
|
||||
return await prisma.quantumProxyTransaction.findUnique({
|
||||
return await prisma.quantum_proxy_transactions.findUnique({
|
||||
where: { proxyTransactionId },
|
||||
include: {
|
||||
envelope: true,
|
||||
translation: true,
|
||||
quantum_envelopes: true,
|
||||
quantum_translations: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -191,7 +197,7 @@ export class QuantumProxyService {
|
||||
* Get proxy transactions for a bank
|
||||
*/
|
||||
async getProxyTransactionsForBank(sovereignBankId: string) {
|
||||
return await prisma.quantumProxyTransaction.findMany({
|
||||
return await prisma.quantum_proxy_transactions.findMany({
|
||||
where: {
|
||||
OR: [
|
||||
{ sourceBankId: sovereignBankId },
|
||||
@@ -200,8 +206,8 @@ export class QuantumProxyService {
|
||||
},
|
||||
orderBy: { createdAt: 'desc' },
|
||||
include: {
|
||||
envelope: true,
|
||||
translation: true,
|
||||
quantum_envelopes: true,
|
||||
quantum_translations: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -213,7 +219,7 @@ export class QuantumProxyService {
|
||||
legacyProtocol: string,
|
||||
limit: number = 100
|
||||
) {
|
||||
return await prisma.quantumProxyTransaction.findMany({
|
||||
return await prisma.quantum_proxy_transactions.findMany({
|
||||
where: { legacyProtocol },
|
||||
orderBy: { createdAt: 'desc' },
|
||||
take: limit,
|
||||
|
||||
@@ -58,8 +58,9 @@ export class QuantumTranslationService {
|
||||
const quantumCompatibleCurrency = fxTranslation.quantumCurrency;
|
||||
|
||||
// Step 5: Save translation record
|
||||
const translation = await prisma.quantumTranslation.create({
|
||||
const translation = await prisma.quantum_translations.create({
|
||||
data: {
|
||||
id: uuidv4(),
|
||||
translationId,
|
||||
legacyProtocol: request.legacyProtocol,
|
||||
legacyAmount: new Decimal(request.amount),
|
||||
@@ -71,6 +72,8 @@ export class QuantumTranslationService {
|
||||
protocolMapping: protocolMapping as any,
|
||||
transactionData: request.transactionData as any,
|
||||
status: 'completed',
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
});
|
||||
|
||||
@@ -95,7 +98,7 @@ export class QuantumTranslationService {
|
||||
private async getProtocolMapping(
|
||||
legacyProtocol: string
|
||||
): Promise<any> {
|
||||
const mapping = await prisma.legacyProtocolMapping.findFirst({
|
||||
const mapping = await prisma.legacy_protocol_mappings.findFirst({
|
||||
where: { legacyProtocol, status: 'active' },
|
||||
});
|
||||
|
||||
@@ -261,7 +264,7 @@ export class QuantumTranslationService {
|
||||
* Get translation by ID
|
||||
*/
|
||||
async getTranslation(translationId: string) {
|
||||
return await prisma.quantumTranslation.findUnique({
|
||||
return await prisma.quantum_translations.findUnique({
|
||||
where: { translationId },
|
||||
});
|
||||
}
|
||||
@@ -273,7 +276,7 @@ export class QuantumTranslationService {
|
||||
legacyProtocol: string,
|
||||
limit: number = 100
|
||||
) {
|
||||
return await prisma.quantumTranslation.findMany({
|
||||
return await prisma.quantum_translations.findMany({
|
||||
where: { legacyProtocol },
|
||||
orderBy: { createdAt: 'desc' },
|
||||
take: limit,
|
||||
|
||||
@@ -36,11 +36,11 @@ export class QuantumCryptoService {
|
||||
pqcKeyId: string
|
||||
): Promise<HybridSignature> {
|
||||
// Get keys
|
||||
const eccKey = await prisma.cryptographicKey.findUnique({
|
||||
const eccKey = await prisma.cryptographic_keys.findUnique({
|
||||
where: { keyId: eccKeyId },
|
||||
});
|
||||
|
||||
const pqcKey = await prisma.cryptographicKey.findUnique({
|
||||
const pqcKey = await prisma.cryptographic_keys.findUnique({
|
||||
where: { keyId: pqcKeyId },
|
||||
});
|
||||
|
||||
@@ -72,11 +72,11 @@ export class QuantumCryptoService {
|
||||
eccKeyId: string,
|
||||
pqcKeyId: string
|
||||
): Promise<boolean> {
|
||||
const eccKey = await prisma.cryptographicKey.findUnique({
|
||||
const eccKey = await prisma.cryptographic_keys.findUnique({
|
||||
where: { keyId: eccKeyId },
|
||||
});
|
||||
|
||||
const pqcKey = await prisma.cryptographicKey.findUnique({
|
||||
const pqcKey = await prisma.cryptographic_keys.findUnique({
|
||||
where: { keyId: pqcKeyId },
|
||||
});
|
||||
|
||||
@@ -100,7 +100,7 @@ export class QuantumCryptoService {
|
||||
const publicKey = `ecc_521_public_${keyId}`;
|
||||
const privateKeyRef = `hsm_ecc_521_${keyId}`;
|
||||
|
||||
await prisma.cryptographicKey.create({
|
||||
await prisma.cryptographic_keys.create({
|
||||
data: {
|
||||
id: uuidv4(),
|
||||
keyId,
|
||||
@@ -130,7 +130,7 @@ export class QuantumCryptoService {
|
||||
|
||||
const keyType = algorithm === 'CRYSTALS-Kyber' ? 'pqc_kyber' : 'pqc_dilithium';
|
||||
|
||||
await prisma.cryptographicKey.create({
|
||||
await prisma.cryptographic_keys.create({
|
||||
data: {
|
||||
id: uuidv4(),
|
||||
keyId,
|
||||
@@ -171,7 +171,7 @@ export class QuantumCryptoService {
|
||||
* Rotate key
|
||||
*/
|
||||
async rotateKey(oldKeyId: string, newKeyPurpose?: string): Promise<string> {
|
||||
const oldKey = await prisma.cryptographicKey.findUnique({
|
||||
const oldKey = await prisma.cryptographic_keys.findUnique({
|
||||
where: { keyId: oldKeyId },
|
||||
});
|
||||
|
||||
@@ -180,7 +180,7 @@ export class QuantumCryptoService {
|
||||
}
|
||||
|
||||
// Mark old key as rotated
|
||||
await prisma.cryptographicKey.update({
|
||||
await prisma.cryptographic_keys.update({
|
||||
where: { keyId: oldKeyId },
|
||||
data: {
|
||||
status: 'rotated',
|
||||
|
||||
Reference in New Issue
Block a user