refactor: update comments for clarity and consistency in DomainService, Domain, and ResourceGenerator

This commit is contained in:
Nawaz Dhandala
2026-01-19 19:47:37 +00:00
parent 290b59dfc9
commit 811fb49c2d
3 changed files with 12 additions and 6 deletions

View File

@@ -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() || "";

View File

@@ -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",

View File

@@ -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{