Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f2db545
add Updatable Field
ArthurMatsveyeu Dec 2, 2025
e2f9dc0
update UI
ArthurMatsveyeu Dec 5, 2025
abb8339
first iteration
ArthurMatsveyeu Dec 12, 2025
44391c3
[skip ci] Add swagger.yaml
envision-ci-agent Dec 12, 2025
f5e3e38
fix logic
ArthurMatsveyeu Dec 15, 2025
1132db1
Merge branch 'NF/Data-Entry-Updatability' of https://github.com/hashg…
ArthurMatsveyeu Dec 15, 2025
8231fdd
Merge remote-tracking branch 'origin/develop' into NF/Data-Entry-Upda…
ArthurMatsveyeu Dec 15, 2025
0878db5
to prev
ArthurMatsveyeu Dec 15, 2025
ec89904
get all version in dialog
ArthurMatsveyeu Dec 16, 2025
9c49605
add dialog, fix error
ArthurMatsveyeu Dec 17, 2025
e31e13e
fix get topicId
ArthurMatsveyeu Dec 18, 2025
301a60b
update UI
ArthurMatsveyeu Dec 18, 2025
291c192
Update for Indexer
ArthurMatsveyeu Dec 19, 2025
6fee449
update Indexer
ArthurMatsveyeu Dec 23, 2025
9c7e3e7
fix parser path
ArthurMatsveyeu Dec 23, 2025
d2c723b
[skip ci] Add swagger.yaml
envision-ci-agent Dec 23, 2025
2d9a894
Merge branch 'develop' into NF/Data-Entry-Updatability
ArthurMatsveyeu Dec 23, 2025
e1bcaaa
fix lint
ArthurMatsveyeu Dec 24, 2025
9af6202
add new condition
ArthurMatsveyeu Dec 24, 2025
0cde8f9
add lock button condition
ArthurMatsveyeu Dec 29, 2025
e7fd36a
fix: table field
ihar-tsykala Dec 29, 2025
f036d84
Fixed retrieving data from the table.
ArthurMatsveyeu Dec 30, 2025
a88a8c5
to prev
ArthurMatsveyeu Dec 30, 2025
dd30bf4
Correction data display when opening a table in edit mode
ArthurMatsveyeu Dec 30, 2025
f773771
fix downloadCsv
ArthurMatsveyeu Dec 30, 2025
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
96 changes: 96 additions & 0 deletions api-gateway/src/api/service/policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4440,4 +4440,100 @@ export class PolicyApi {
}

//#endregion

//#region VC Docs

/**
* Create new version VC document
*/
@Post('/:policyId/create-new-version-vc-document')
@Auth(
Permissions.POLICIES_POLICY_EXECUTE,
Permissions.POLICIES_POLICY_MANAGE,
)
@ApiOperation({
summary: 'Create new version vc document.',
description: 'Create new version vc document.',
})
@ApiParam({
name: 'policyId',
type: String,
description: 'Policy Id',
required: true,
example: Examples.DB_ID
})
@ApiBody({
description: 'Data',
type: Object
})
@ApiOkResponse({
description: 'Successful operation.',
})
@ApiInternalServerErrorResponse({
description: 'Internal server error.',
type: InternalServerErrorDTO,
})
@HttpCode(HttpStatus.OK)
async createNewVersionVcDocument(
@AuthUser() user: IAuthUser,
@Param('policyId') policyId: string,
@Body() body: any,
): Promise<any> {
try {
const engineService = new PolicyEngine();
return await engineService.createNewVersionVcDocument(user, policyId, body);
} catch (error) {
error.code = HttpStatus.UNPROCESSABLE_ENTITY;
await InternalException(error, this.logger, user.id);
}
}

/**
* Get all version VC documents
*/
@Get('/:policyId/get-all-version-vc-documents/:documentId')
@Auth(
Permissions.POLICIES_POLICY_EXECUTE,
Permissions.POLICIES_POLICY_MANAGE,
)
@ApiOperation({
summary: 'Get all version VC documents.',
description: 'Get all version VC documents.',
})
@ApiParam({
name: 'policyId',
type: String,
description: 'Policy Id',
required: true,
example: Examples.DB_ID
})
@ApiParam({
name: 'documentId',
type: String,
description: 'Document Id',
required: true,
example: Examples.DB_ID
})
@ApiOkResponse({
description: 'Successful operation.'
})
@ApiInternalServerErrorResponse({
description: 'Internal server error.',
type: InternalServerErrorDTO,
})
@HttpCode(HttpStatus.OK)
async getAllVersionVcDocuments(
@AuthUser() user: IAuthUser,
@Param('policyId') policyId: string,
@Param('documentId') documentId: string
): Promise<any> {
try {
const engineService = new PolicyEngine();
return await engineService.getAllVersionVcDocuments(user, policyId, documentId);
} catch (error) {
error.code = HttpStatus.UNPROCESSABLE_ENTITY;
await InternalException(error, this.logger, user.id);
}
}
//#endregion
}
28 changes: 28 additions & 0 deletions api-gateway/src/helpers/policy-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1572,4 +1572,32 @@ export class PolicyEngine extends NatsService {
): Promise<{ documents: any[], count: number }> {
return await this.sendMessage(PolicyEngineEvents.GET_POLICY_REPOSITORY_DOCUMENTS, { user, policyId, filters });
}

/**
* Create new version policy document
* @param user
* @param policyId
* @param data
*/
public async createNewVersionVcDocument(
user: IAuthUser,
policyId: string,
data: any
): Promise<any> {
return await this.sendMessage(PolicyEngineEvents.CREATE_NEW_VERSION_VC_DOCUMENT, { user, policyId, data });
}

/**
* Get all new version policy documents
* @param user
* @param policyId
* @param documentId
*/
public async getAllVersionVcDocuments(
user: IAuthUser,
policyId: string,
documentId: string,
): Promise<any> {
return await this.sendMessage(PolicyEngineEvents.GET_All_NEW_VERSION_VC_DOCUMENTS, { user, policyId, documentId });
}
}
14 changes: 14 additions & 0 deletions common/src/entity/vc-document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,18 @@ export class VcDocument extends RestoreEntity implements IVCDocument {
@Property({ persist: false, nullable: true })
_oldTableFileIds?: ObjectId[];

/**
* Last VC Version
*/
@Property({ nullable: true })
oldVersion?: boolean;

/**
* Original VC doc id for revision
*/
@Property({ nullable: true })
initId?: string;

/**
* Document defaults
*/
Expand Down Expand Up @@ -323,6 +335,8 @@ export class VcDocument extends RestoreEntity implements IVCDocument {
prop.relayerAccount = this.relayerAccount;
prop.processingStatus = this.processingStatus;
prop.policyId = this.policyId;
prop.oldVersion = this.oldVersion;
prop.initId = this.initId;
return prop;
}

Expand Down
14 changes: 9 additions & 5 deletions common/src/hedera-modules/message/message-body.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ export interface VcMessageBody extends MessageBody {
* Option
*/
option: any;
/**
* InitId
*/
initId: string;
}

/**
Expand Down Expand Up @@ -401,23 +405,23 @@ export interface SynchronizationMessageBody extends MessageBody {
/**
* User DID
*/
user?: string,
user?: string;
/**
* Policy ID (Topic ID)
*/
policy?: string,
policy?: string;
/**
* Policy Type
*/
policyType?: MultiPolicyType,
policyType?: MultiPolicyType;
/**
* Message Id
*/
messageId?: string,
messageId?: string;
/**
* Token Id
*/
tokenId?: string,
tokenId?: string;
/**
* Token amount
*/
Expand Down
24 changes: 23 additions & 1 deletion common/src/hedera-modules/message/vc-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ export class VCMessage extends Message {
* Option
*/
public option: any;
/**
* InitId
*/
public initId: string;

constructor(
action: MessageAction,
Expand All @@ -98,6 +102,7 @@ export class VCMessage extends Message {
this.document = document.getDocument();
this.hash = document.toCredentialHash();
this.issuer = document.getIssuerDid();
this.initId = document.getInitId();
if (proof.type === SignatureType.BbsBlsSignature2020) {
this.encodedData = true;
} else {
Expand Down Expand Up @@ -197,6 +202,14 @@ export class VCMessage extends Message {
this.startMessage = messageId;
}

/**
* Set initId
* @param initId
*/
public setInitId(initId: string): void {
this.initId = initId;
}

/**
* Get documents
*/
Expand All @@ -216,6 +229,7 @@ export class VCMessage extends Message {
lang: this.lang,
account: this.account,
issuer: this.issuer,
initId: this.initId,
relationships: this.relationships,
encodedData: this.encodedData,
documentStatus: this.documentStatus,
Expand Down Expand Up @@ -309,6 +323,7 @@ export class VCMessage extends Message {
_message._id = json.id;
_message._status = json.status;
_message.issuer = json.issuer;
_message.initId = json.initId;
_message.relationships = json.relationships;
_message.documentStatus = json.documentStatus;
_message.encodedData = json.encodedData || json.type === MessageType.EVCDocument;
Expand Down Expand Up @@ -359,6 +374,7 @@ export class VCMessage extends Message {
action: this.action,
lang: this.lang,
issuer: this.issuer,
initId: this.initId,
relationships: this.relationships,
hash: this.hash,
encodedData: this.encodedData,
Expand Down Expand Up @@ -386,6 +402,7 @@ export class VCMessage extends Message {
public override toJson(): any {
const result = super.toJson();
result.issuer = this.issuer;
result.initId = this.initId;
result.hash = this.hash;
result.relationships = this.relationships;
result.document = this.document;
Expand All @@ -406,6 +423,7 @@ export class VCMessage extends Message {

const result = Message._fromJson(new VCMessage(json.action), json);
result.issuer = json.issuer;
result.initId = json.initId;
result.hash = json.hash;
result.relationships = json.relationships;
result.document = json.document;
Expand All @@ -420,9 +438,13 @@ export class VCMessage extends Message {
}

/**
* Get User DID
* Set initId
*/
public override getOwner(): string {
return this.issuer;
}

public setInit(initId: string) {
this.initId = initId;
}
}
22 changes: 22 additions & 0 deletions common/src/hedera-modules/vcjs/vc-document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ export class VcDocument {
* @protected
*/
protected evidences: any[];
/**
* InitId
* @protected
*/
protected initId: string;

/**
* Constructor
Expand Down Expand Up @@ -189,6 +194,23 @@ export class VcDocument {
}
}

/**
* Get initId
*/
public getInitId(): string {
if (this.initId) {
return this.initId;
}
return null;
}

/**
* Set initId
*/
public setInitId(initId: string) {
this.initId = initId;
}

/**
* Get issuance date
*/
Expand Down
6 changes: 5 additions & 1 deletion common/src/xlsx/xlsx-to-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ export class XlsxToJson {
readOnly: true,
isPrivate: undefined,
property: undefined,
isUpdatable: false,
});
fields.push({
name: 'ref',
Expand All @@ -333,6 +334,7 @@ export class XlsxToJson {
readOnly: true,
isPrivate: undefined,
property: undefined,
isUpdatable: false,
});
fields.push({
name: 'guardianVersion',
Expand All @@ -350,6 +352,7 @@ export class XlsxToJson {
readOnly: true,
isPrivate: undefined,
property: undefined,
isUpdatable: false,
});
}
const conditions = conditionCache.map(c => c.toJson());
Expand Down Expand Up @@ -390,7 +393,8 @@ export class XlsxToJson {
customType: null,
property: null,
isRef: null,
order: row
order: row,
isUpdatable: false,
};
try {
const key = XlsxToJson.getFieldKey(worksheet, table, row, xlsxResult);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="dialog-body">
{{text}}
</div>
<div class="dialog-footer">
<div class="action-buttons">
<div class="dialog-button">
<button
(click)="onClose()"
class="guardian-button guardian-button-secondary">{{closeBtnName}}</button>
</div>
<div class="dialog-button">
<button
(click)="onSave()"
class="guardian-button guardian-button-primary">{{okBtnName}}</button>
</div>
</div>
</div>
Loading