refactor anchoring to be OfficeFolder
based
This commit is contained in:
parent
ee0656b5a7
commit
f09a300010
4
src/Admin/OfficeFolderAnchor.ts
Normal file
4
src/Admin/OfficeFolderAnchor.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export * from "../Notary/OfficeFolderAnchor";
|
||||||
|
import OfficeFolderAnchor from "../Notary/OfficeFolderAnchor";
|
||||||
|
|
||||||
|
export default OfficeFolderAnchor;
|
@ -49,6 +49,5 @@ export enum EDocumentStatus {
|
|||||||
ASKED = "ASKED",
|
ASKED = "ASKED",
|
||||||
DEPOSITED = "DEPOSITED",
|
DEPOSITED = "DEPOSITED",
|
||||||
VALIDATED = "VALIDATED",
|
VALIDATED = "VALIDATED",
|
||||||
ANCHORED = "ANCHORED",
|
|
||||||
REFUSED = "REFUSED",
|
REFUSED = "REFUSED",
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,9 @@ export default class File extends Resource {
|
|||||||
@Expose()
|
@Expose()
|
||||||
public mimetype!: string;
|
public mimetype!: string;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
public hash!: string;
|
||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
public size!: number;
|
public size!: number;
|
||||||
|
|
||||||
|
9
src/Notary/EAnchoringStatus.ts
Normal file
9
src/Notary/EAnchoringStatus.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
enum EAnchoringStatus {
|
||||||
|
QUEUED = "QUEUED",
|
||||||
|
ATTEMPTING = "ATTEMPTING",
|
||||||
|
VERIFIED_ON_CHAIN = "VERIFIED_ON_CHAIN",
|
||||||
|
VERIFYING_ON_CHAIN = "VERIFYING_ON_CHAIN",
|
||||||
|
ABANDONED = "ABANDONED",
|
||||||
|
}
|
||||||
|
|
||||||
|
export default EAnchoringStatus;
|
5
src/Notary/EBlockchainName.ts
Normal file
5
src/Notary/EBlockchainName.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
enum EBlockchainName{
|
||||||
|
TEZOS = "TEZOS",
|
||||||
|
}
|
||||||
|
|
||||||
|
export default EBlockchainName;
|
@ -11,36 +11,36 @@ export default class Office extends OfficeCustomer{
|
|||||||
@Expose()
|
@Expose()
|
||||||
@IsNotEmpty({ groups: ["createFolder" , "createDeedType" , "createDocumentType", "createRule", "createRole"] ,message: "UID is required" })
|
@IsNotEmpty({ groups: ["createFolder" , "createDeedType" , "createDocumentType", "createRule", "createRole"] ,message: "UID is required" })
|
||||||
public override uid?: string;
|
public override uid?: string;
|
||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
@IsNotEmpty({ groups: ["createOffice"], message: "ID IdNote is required" })
|
@IsNotEmpty({ groups: ["createOffice"], message: "ID IdNote is required" })
|
||||||
public idNot?: string;
|
public idNot?: string;
|
||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
@IsNotEmpty({ groups: ["createOffice"], message: "Name is required" })
|
@IsNotEmpty({ groups: ["createOffice"], message: "Name is required" })
|
||||||
public override name!: string;
|
public override name!: string;
|
||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
@IsNotEmpty({ groups: ["createOffice"], message: "CRPCEN is required" })
|
@IsNotEmpty({ groups: ["createOffice"], message: "CRPCEN is required" })
|
||||||
public override crpcen!: string;
|
public override crpcen!: string;
|
||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
@IsNotEmpty({ groups: ["createOffice"], message: "Address is required" })
|
@IsNotEmpty({ groups: ["createOffice"], message: "Address is required" })
|
||||||
@ValidateNested({ groups: ["createOffice"] })
|
@ValidateNested({ groups: ["createOffice"] })
|
||||||
@Type(() => Address)
|
@Type(() => Address)
|
||||||
public override address?: Address;
|
public override address?: Address;
|
||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
public office_status?: EOfficeStatus | string;
|
public office_status?: EOfficeStatus | string;
|
||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
@Type(() => DeedType)
|
@Type(() => DeedType)
|
||||||
public deed_types?: DeedType[];
|
public deed_types?: DeedType[];
|
||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
@Type(() => User)
|
@Type(() => User)
|
||||||
public users?: User[];
|
public users?: User[];
|
||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
@Type(() => OfficeFolder)
|
@Type(() => OfficeFolder)
|
||||||
public office_folders?: OfficeFolder[];
|
public office_folders?: OfficeFolder[];
|
||||||
@ -49,4 +49,4 @@ export default class Office extends OfficeCustomer{
|
|||||||
export enum EOfficeStatus {
|
export enum EOfficeStatus {
|
||||||
ACTIVATED = "ACTIVATED",
|
ACTIVATED = "ACTIVATED",
|
||||||
DESACTIVATED = "DESACTIVATED",
|
DESACTIVATED = "DESACTIVATED",
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,8 @@ import Customer from "./Customer";
|
|||||||
import Document from "./Document";
|
import Document from "./Document";
|
||||||
import Office from "./Office";
|
import Office from "./Office";
|
||||||
import EFolderStatus from "../Customer/EFolderStatus";
|
import EFolderStatus from "../Customer/EFolderStatus";
|
||||||
|
import EAnchoringStatus from "./EAnchoringStatus";
|
||||||
|
import OfficeFolderAnchor from "./OfficeFolderAnchor";
|
||||||
|
|
||||||
export default class OfficeFolder extends OfficeFolderCustomer {
|
export default class OfficeFolder extends OfficeFolderCustomer {
|
||||||
@Expose()
|
@Expose()
|
||||||
@ -68,4 +70,10 @@ export default class OfficeFolder extends OfficeFolderCustomer {
|
|||||||
@ValidateNested({ groups: ["updateFolder"] })
|
@ValidateNested({ groups: ["updateFolder"] })
|
||||||
@Type(() => Document)
|
@Type(() => Document)
|
||||||
documents?: Document[];
|
documents?: Document[];
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
@IsOptional({ groups: ["updateFolder"] })
|
||||||
|
@ValidateNested({ groups: ["updateFolder"] })
|
||||||
|
@Type(() => Document)
|
||||||
|
anchor?: OfficeFolderAnchor | null = null;
|
||||||
}
|
}
|
||||||
|
51
src/Notary/OfficeFolderAnchor.ts
Normal file
51
src/Notary/OfficeFolderAnchor.ts
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
import Resource from "../Resource";
|
||||||
|
import { Expose, Type } from "class-transformer";
|
||||||
|
import EBlockchainName from "./EBlockchainName";
|
||||||
|
import EAnchoringStatus from "./EAnchoringStatus";
|
||||||
|
import OfficeFolder from "./OfficeFolder";
|
||||||
|
import { IsDate } from "class-validator";
|
||||||
|
|
||||||
|
export default class OfficeFolderAnchor extends Resource {
|
||||||
|
@Expose()
|
||||||
|
public uid?: string;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
public hash_sources?: string[];
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
public root_hash?: string;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
public blockchain?: EBlockchainName | string = EBlockchainName.TEZOS;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
public status?: EAnchoringStatus | string = EAnchoringStatus.QUEUED;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
public anchor_nb_try?: number = 0;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
public tx_id?: string;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
public tx_link?: string;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
public tx_hash?: string;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
@Type(() => OfficeFolder)
|
||||||
|
public folder?: OfficeFolder | null = null;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
@IsDate()
|
||||||
|
public anchored_at?: Date | null = null;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
@IsDate()
|
||||||
|
public created_at?: Date | null = null;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date | null = null;
|
||||||
|
}
|
4
src/SuperAdmin/OfficeFolderAnchor.ts
Normal file
4
src/SuperAdmin/OfficeFolderAnchor.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export * from "../Admin/OfficeFolderAnchor";
|
||||||
|
import OfficeFolderAnchor from "../Admin/OfficeFolderAnchor";
|
||||||
|
|
||||||
|
export default OfficeFolderAnchor;
|
Loading…
x
Reference in New Issue
Block a user