namespace AmpDAL.DTO.RegisterApi; // ───────────────────────────────────────────────────────────── // Composite DTO — sent by frontend to register a full API // One request inserts: MAPI + MAPIVERSION + MAPIINTERFACE + // MAPISCHEMA + MAPIDOMAIN + MAPICAPABILITY + // MAPICAPABILITYLINK + MAPIEXPOSUREPOLICY // ───────────────────────────────────────────────────────────── public class RegisterApiSaveDTO { // ── API Master (MAPI) ───────────────────────────────────── public int ApiId { get; set; } // 0 = new public string ApiKey { get; set; } = string.Empty; public string ApiName { get; set; } = string.Empty; public string? Description { get; set; } public string? AboutApi { get; set; } public string? KeyFeatures { get; set; } public string? UseCases { get; set; } public string? QuickStart { get; set; } public byte ApiKind { get; set; } // 0 Internal / 1 External / 2 Custom public byte ApiType { get; set; } // 0 REST / 1 Async / 2 Batch / 3 File / 4 Legacy public byte Criticality { get; set; } // 0 Low / 1 Medium / 2 High / 3 Critical public byte LifecycleStatus { get; set; } // 0 Draft / 1 Active / 2 Deprecated public byte VisibilityLevel { get; set; } // 0 Private / 1 Internal / 2 Partner / 3 Public public byte ApiProviderType { get; set; } // 0 Internal / 1 External public byte ExposureType { get; set; } // 0 Internal / 1 Partner / 2 Public public byte IsHeadlessEnabled { get; set; } // 0 No / 1 Yes public string? OwnerTeam { get; set; } public string? BusinessOwner { get; set; } public byte RuntimeType { get; set; } // 0 Controller / 1 FastEndpoints / 2 Worker public byte Technology { get; set; } // 0 .NET / 1 Java / 2 Python public string? RepoUrl { get; set; } public string? PipelineRef { get; set; } public int ProviderId { get; set; } public int CategoryId { get; set; } public string? Geography { get; set; } public string? RegulatoryImpact { get; set; } public string? RiskRating { get; set; } public string? SlaReference { get; set; } public string? ApiRemarks { get; set; } public short ApiSortOrder { get; set; } // ── Version (MAPIVERSION) ───────────────────────────────── public string VersionNumber { get; set; } = "1.0.0"; public byte VersionStatus { get; set; } // 0 Draft / 1 Active / 2 Deprecated / 3 Retired public byte IsBreaking { get; set; } // 0 No / 1 Yes public DateTime VersionFromDate { get; set; } public DateTime? VersionToDate { get; set; } public DateTime? SunsetDate { get; set; } public string? VersionNotes { get; set; } public string? VersionDescription { get; set; } public string? VersionRemarks { get; set; } public short VersionSortOrder { get; set; } // ── Interface (MAPIINTERFACE) ───────────────────────────── public string InterfaceName { get; set; } = string.Empty; public byte InterfaceType { get; set; } // 0 REST / 1 Async / 2 File public byte SpecType { get; set; } // 0 OpenAPI / 1 AsyncAPI / 2 SOAP / 3 Manual public byte InterfaceMethod { get; set; } // 0 GET / 1 POST / 2 PUT / 3 PATCH / 4 DELETE public string? ApiPath { get; set; } public string? InterfaceDescription { get; set; } public string? SpecLocation { get; set; } public string? InterfaceSource { get; set; } public string? InterfaceRemarks { get; set; } public string? ContentHash { get; set; } public DateTime? LastParsedAt { get; set; } public byte ParsedSuccessfully { get; set; } = 1; // 0 No / 1 Yes public short InterfaceSortOrder { get; set; } // ── Schema (MAPISCHEMA) ─────────────────────────────────── public string SchemaName { get; set; } = string.Empty; public string? SchemaDescription { get; set; } public byte SpecificationSource { get; set; } // 0 URL / 1 FileUpload / 2 RepoPath public string? SpecificationUrl { get; set; } public string? RequestJson { get; set; } public string? ResponseJson { get; set; } public string? SchemaJson { get; set; } public string? SchemaRemarks { get; set; } public short SchemaSortOrder { get; set; } // ── Domain (MAPIDOMAIN) ─────────────────────────────────── public string DomainName { get; set; } = string.Empty; public int ParentDomainId { get; set; } public string? DomainRemarks { get; set; } public short DomainSortOrder { get; set; } // ── Capability (MAPICAPABILITY) ─────────────────────────── public string CapabilityName { get; set; } = string.Empty; public string? CapabilityDescription { get; set; } public string? CapabilityRemarks { get; set; } public short CapabilitySortOrder { get; set; } // ── Artifact (MAPIARTIFACT) — optional ─────────────────── // Skip insert when ArtifactTitle is null / empty public string? ArtifactTitle { get; set; } public byte ArtifactType { get; set; } // 0 Document / 1 Diagram / 2 Specification / 3 Contract / 4 Other public string? ArtifactLocation { get; set; } public string? ArtifactRemarks { get; set; } public short ArtifactSortOrder { get; set; } // ── Operation (MAPIOPERATION) — optional ───────────────── // Skip insert when OperationKey is null / empty public string? OperationKey { get; set; } public string? OperationMethod { get; set; } // GET / POST / PUT / PATCH / DELETE public string? OperationPath { get; set; } public string? OperationSummary { get; set; } public string? OperationRemarks { get; set; } public short OperationSortOrder { get; set; } // ── Parameter (MAPIPARAMETER) — optional (requires Operation) ── // Skip insert when ParameterName is null / empty public string? ParameterName { get; set; } public string? ParameterInLocation { get; set; } // Path / Query / Header / Body public string? ParameterDataType { get; set; } public byte ParameterIsRequired { get; set; } // 0 No / 1 Yes public string? ParameterRemarks { get; set; } public short ParameterSortOrder { get; set; } // ── Exposure Policy (MAPIEXPOSUREPOLICY) — optional ────── // Skip insert when BillingCategory AND PolicySlaReference are both empty public byte AllowPartnerAccess { get; set; } // 0 No / 1 Yes public byte AllowPublicAccess { get; set; } // 0 No / 1 Yes public string? BillingCategory { get; set; } public string? PolicySlaReference { get; set; } public string? PolicyRemarks { get; set; } public short PolicySortOrder { get; set; } } // ───────────────────────────────────────────────────────────── // Result returned after a successful registration // ───────────────────────────────────────────────────────────── public class RegisterApiResultDTO { public int ApiId { get; set; } public int ApiVersionId { get; set; } public int ApiInterfaceId { get; set; } public int ApiSchemaId { get; set; } public int ApiDomainId { get; set; } public int ApiCapabilityId { get; set; } public int ApiCapabilityLinkId { get; set; } // Optional — null when not provided by frontend public int? ApiArtifactId { get; set; } public int? ApiOperationId { get; set; } public int? ParameterId { get; set; } public int? ApiExposurePolicyId { get; set; } } // ───────────────────────────────────────────────────────────── // Full read DTO — used by Get / List // ───────────────────────────────────────────────────────────── public class RegisterApiDTO { // ── API Master (MAPI) ───────────────────────────────────── public int ApiId { get; set; } public string ApiKey { get; set; } = string.Empty; public string ApiName { get; set; } = string.Empty; public string? Description { get; set; } public string? AboutApi { get; set; } public string? KeyFeatures { get; set; } public string? UseCases { get; set; } public string? QuickStart { get; set; } public byte ApiKind { get; set; } public byte ApiType { get; set; } public byte Criticality { get; set; } public byte LifecycleStatus { get; set; } public byte VisibilityLevel { get; set; } public byte ApiProviderType { get; set; } public byte ExposureType { get; set; } public byte IsHeadlessEnabled { get; set; } public string? OwnerTeam { get; set; } public string? BusinessOwner { get; set; } public byte RuntimeType { get; set; } public byte Technology { get; set; } public string? RepoUrl { get; set; } public string? PipelineRef { get; set; } public int ProviderId { get; set; } public int CategoryId { get; set; } public string? Geography { get; set; } public string? RegulatoryImpact { get; set; } public string? RiskRating { get; set; } public string? SlaReference { get; set; } public string? ApiRemarks { get; set; } public short ApiSortOrder { get; set; } public byte Status { get; set; } public DateTime CreatedOn { get; set; } public DateTime ModifiedOn { get; set; } // ── Version (MAPIVERSION) ───────────────────────────────── public int ApiVersionId { get; set; } public string VersionNumber { get; set; } = string.Empty; public byte VersionStatus { get; set; } public byte IsBreaking { get; set; } public DateTime VersionFromDate { get; set; } public DateTime? VersionToDate { get; set; } public DateTime? SunsetDate { get; set; } public string? VersionNotes { get; set; } public string? VersionDescription { get; set; } public string? VersionRemarks { get; set; } public short VersionSortOrder { get; set; } // ── Interface (MAPIINTERFACE) ───────────────────────────── public int ApiInterfaceId { get; set; } public string InterfaceName { get; set; } = string.Empty; public byte InterfaceType { get; set; } public byte SpecType { get; set; } public byte InterfaceMethod { get; set; } public string? ApiPath { get; set; } public string? InterfaceDescription { get; set; } public string? SpecLocation { get; set; } public string? InterfaceSource { get; set; } public string? InterfaceRemarks { get; set; } public string? ContentHash { get; set; } public DateTime? LastParsedAt { get; set; } public byte ParsedSuccessfully { get; set; } public short InterfaceSortOrder { get; set; } // ── Schema (MAPISCHEMA) ─────────────────────────────────── public int ApiSchemaId { get; set; } public string SchemaName { get; set; } = string.Empty; public string? SchemaDescription { get; set; } public byte SpecificationSource { get; set; } public string? SpecificationUrl { get; set; } public string? RequestJson { get; set; } public string? ResponseJson { get; set; } public string? SchemaJson { get; set; } public string? SchemaRemarks { get; set; } public short SchemaSortOrder { get; set; } // ── Domain (MAPIDOMAIN) ─────────────────────────────────── public int ApiDomainId { get; set; } public string DomainName { get; set; } = string.Empty; public int ParentDomainId { get; set; } public string? DomainRemarks { get; set; } public short DomainSortOrder { get; set; } // ── Capability (MAPICAPABILITY) ─────────────────────────── public int ApiCapabilityId { get; set; } public string CapabilityName { get; set; } = string.Empty; public string? CapabilityDescription { get; set; } public string? CapabilityRemarks { get; set; } public short CapabilitySortOrder { get; set; } // ── Artifact (MAPIARTIFACT) — null when not registered ─── public int? ApiArtifactId { get; set; } public byte? ArtifactType { get; set; } public string? ArtifactTitle { get; set; } public string? ArtifactLocation { get; set; } public string? ArtifactRemarks { get; set; } public short? ArtifactSortOrder { get; set; } // ── Operation (MAPIOPERATION) — null when not registered ── public int? ApiOperationId { get; set; } public string? OperationKey { get; set; } public string? OperationMethod { get; set; } public string? OperationPath { get; set; } public string? OperationSummary { get; set; } public string? OperationRemarks { get; set; } public short? OperationSortOrder { get; set; } // ── Parameter (MAPIPARAMETER) — null when not registered ── public int? ParameterId { get; set; } public string? ParameterName { get; set; } public string? ParameterInLocation { get; set; } public string? ParameterDataType { get; set; } public byte? ParameterIsRequired { get; set; } public string? ParameterRemarks { get; set; } public short? ParameterSortOrder { get; set; } // ── Exposure Policy (MAPIEXPOSUREPOLICY) — null when not registered public int? ApiExposurePolicyId { get; set; } public byte? AllowPartnerAccess { get; set; } public byte? AllowPublicAccess { get; set; } public string? BillingCategory { get; set; } public string? PolicySlaReference { get; set; } public string? PolicyRemarks { get; set; } public short? PolicySortOrder { get; set; } } // ───────────────────────────────────────────────────────────── // Picklist DTO — used by GetSelectList // ───────────────────────────────────────────────────────────── public class RegisterApiSelectDTO { public int ApiId { get; set; } public string ApiKey { get; set; } = string.Empty; public string ApiName { get; set; } = string.Empty; public byte ApiKind { get; set; } public byte LifecycleStatus { get; set; } }