mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
refactor: update comments for clarity and consistency in DomainService, Domain, and ResourceGenerator
This commit is contained in:
@@ -35,8 +35,10 @@ export class Service extends DatabaseService<Model> {
|
||||
createBy.data.domain = new Domain(domain.trim().toLowerCase());
|
||||
}
|
||||
|
||||
// Prevent setting isVerified during creation, EXCEPT for test domains
|
||||
// Test domains can be auto-verified since they are reserved TLDs that can't have real DNS records
|
||||
/*
|
||||
* Prevent setting isVerified during creation, EXCEPT for test domains
|
||||
* Test domains can be auto-verified since they are reserved TLDs that can't have real DNS records
|
||||
*/
|
||||
if (!createBy.props.isRoot && createBy.data.isVerified) {
|
||||
const domainStr: string = createBy.data.domain?.toString() || "";
|
||||
|
||||
|
||||
@@ -5,8 +5,10 @@ import { FindOperator } from "typeorm/find-options/FindOperator";
|
||||
import Zod, { ZodSchema } from "../Utils/Schema/Zod";
|
||||
|
||||
export default class Domain extends DatabaseProperty {
|
||||
// Reserved TLDs for testing and documentation (per IANA)
|
||||
// These domains can never have real DNS records, so they're safe for testing
|
||||
/*
|
||||
* Reserved TLDs for testing and documentation (per IANA)
|
||||
* These domains can never have real DNS records, so they're safe for testing
|
||||
*/
|
||||
public static readonly TEST_DOMAIN_SUFFIXES: string[] = [
|
||||
".example.com",
|
||||
".example.org",
|
||||
|
||||
@@ -570,8 +570,10 @@ func (r *${resourceTypeName}Resource) bigFloatToFloat64(bf *big.Float) interface
|
||||
stringplanmodifier.UseStateForUnknown(),
|
||||
}`;
|
||||
} else if (attr.optional && attr.computed) {
|
||||
// Add UseStateForUnknown() for Optional+Computed fields
|
||||
// This prevents "inconsistent result after apply" errors when server provides defaults
|
||||
/*
|
||||
* Add UseStateForUnknown() for Optional+Computed fields
|
||||
* This prevents "inconsistent result after apply" errors when server provides defaults
|
||||
*/
|
||||
if (attr.type === "string") {
|
||||
planModifiers = `,
|
||||
PlanModifiers: []planmodifier.String{
|
||||
|
||||
Reference in New Issue
Block a user