Skip to content
docsv0.1.0

GatePassage

GatePassage entity - Registro append-only de solicitudes/aprobaciones de gates. Cada registro representa una solicitud para pasar un gate del pipeline. NUNCA se hace UPDATE ni DELETE. Solo INSERT. Una vez creado, el pasaje se resuelve (approve/reject) una sola vez y queda inmutable. Uses polymorphic model: entity_type + entity_id instead of direct FK. CONSTRAINT CRITICO: requestedBy != approvedBy (prohibicion de auto-aprobacion, enforced a nivel de servicio). `requestedBy`/`approvedBy` are opaque principal strings (e.g. "member:42"), matching {@see Evidence::getUploadedBy()} — the engine stores them verbatim and never resolves them to an entity; the consuming product owns identity (D9).

GatePassage::__construct()

public function __construct():

GatePassage::getId()

public function getId(): int

GatePassage::getUuid()

public function getUuid(): string

GatePassage::getStatus()

public function getStatus(): Milpa\Workflow\Enums\GatePassageStatus

Obtiene el estado como enum GatePassageStatus.

GatePassage::getStatusValue()

public function getStatusValue(): string

GatePassage::getRequestedNotes()

public function getRequestedNotes(): ?string

GatePassage::getApprovedNotes()

public function getApprovedNotes(): ?string

GatePassage::getRejectedReason()

public function getRejectedReason(): ?string

GatePassage::isWaiver()

public function isWaiver(): bool

GatePassage::getWaiverJustification()

public function getWaiverJustification(): ?string

GatePassage::getMetadata()

public function getMetadata(): ?array

GatePassage::getCreatedAt()

public function getCreatedAt(): DateTime

GatePassage::getResolvedAt()

public function getResolvedAt(): ?DateTime

GatePassage::getGateDefinition()

public function getGateDefinition(): Milpa\Workflow\Entities\GateDefinition

GatePassage::getEntityType()

public function getEntityType(): string

GatePassage::getEntityId()

public function getEntityId(): int

GatePassage::getRequestedBy()

public function getRequestedBy(): string

GatePassage::getApprovedBy()

public function getApprovedBy(): ?string

GatePassage::getEvidences()

public function getEvidences(): Doctrine\Common\Collections\Collection

GatePassage::setStatus()

public function setStatus(Milpa\Workflow\Enums\GatePassageStatus $status): self

Sets the passage's status.

Parameters

Parameters of setStatus()
NameTypeDescription
$statusMilpa\Workflow\Enums\GatePassageStatus

GatePassage::setRequestedNotes()

public function setRequestedNotes(?string $requestedNotes): self

Sets the requester's notes at the time the passage was requested.

Parameters

Parameters of setRequestedNotes()
NameTypeDescription
$requestedNotes?string

GatePassage::setApprovedNotes()

public function setApprovedNotes(?string $approvedNotes): self

Sets the approver's notes at the time the passage was approved.

Parameters

Parameters of setApprovedNotes()
NameTypeDescription
$approvedNotes?string

GatePassage::setRejectedReason()

public function setRejectedReason(?string $rejectedReason): self

Sets the reason the passage was rejected.

Parameters

Parameters of setRejectedReason()
NameTypeDescription
$rejectedReason?string

GatePassage::setIsWaiver()

public function setIsWaiver(bool $isWaiver): self

Sets whether this passage was waived instead of meeting its requirements.

Parameters

Parameters of setIsWaiver()
NameTypeDescription
$isWaiverbool

GatePassage::setWaiverJustification()

public function setWaiverJustification(?string $waiverJustification): self

Sets the justification for the waiver (required when {@see self::isWaiver()} is true).

Parameters

Parameters of setWaiverJustification()
NameTypeDescription
$waiverJustification?string

GatePassage::setMetadata()

public function setMetadata(?array $metadata): self

Sets additional metadata for the passage.

Parameters

Parameters of setMetadata()
NameTypeDescription
$metadata(array<string, mixed> | null)

GatePassage::setGateDefinition()

public function setGateDefinition(Milpa\Workflow\Entities\GateDefinition $gateDefinition): self

Sets the gate definition this passage requests to pass.

Parameters

Parameters of setGateDefinition()
NameTypeDescription
$gateDefinitionMilpa\Workflow\Entities\GateDefinition

GatePassage::setEntityType()

public function setEntityType(string $entityType): self

Sets the polymorphic entity type this passage belongs to (e.g. "opportunity").

Parameters

Parameters of setEntityType()
NameTypeDescription
$entityTypestring

GatePassage::setEntityId()

public function setEntityId(int $entityId): self

Sets the polymorphic entity ID this passage belongs to.

Parameters

Parameters of setEntityId()
NameTypeDescription
$entityIdint

GatePassage::setRequestedBy()

public function setRequestedBy(string $requestedBy): self

Sets the opaque principal that requested the passage (e.g. "member:42"); never resolved to an entity by the engine — the consuming product owns identity (D9).

Parameters

Parameters of setRequestedBy()
NameTypeDescription
$requestedBystring

GatePassage::setApprovedBy()

public function setApprovedBy(?string $approvedBy): self

Sets the opaque principal that approved or rejected the passage; never resolved to an entity by the engine (D9). Must not equal {@see self::getRequestedBy()}.

Parameters

Parameters of setApprovedBy()
NameTypeDescription
$approvedBy?string

GatePassage::addEvidence()

public function addEvidence(Milpa\Workflow\Entities\Evidence $evidence): self

Adds a piece of evidence to this passage, wiring the inverse side back.

Parameters

Parameters of addEvidence()
NameTypeDescription
$evidenceMilpa\Workflow\Entities\Evidence

GatePassage::removeEvidence()

public function removeEvidence(Milpa\Workflow\Entities\Evidence $evidence): self

Removes a piece of evidence from this passage.

Parameters

Parameters of removeEvidence()
NameTypeDescription
$evidenceMilpa\Workflow\Entities\Evidence

GatePassage::approve()

public function approve(string $approverId, ?string $notes = null): self

Aprueba el pasaje del gate. CONSTRAINT: El aprobador no puede ser el mismo que el solicitante.

Parameters

Parameters of approve()
NameTypeDescription
$approverIdstring
$notes?string

GatePassage::reject()

public function reject(string $approverId, string $reason): self

Rechaza el pasaje del gate. CONSTRAINT: El aprobador no puede ser el mismo que el solicitante.

Parameters

Parameters of reject()
NameTypeDescription
$approverIdstring
$reasonstring

GatePassage::isPending()

public function isPending(): bool

Verifica si el pasaje esta pendiente de resolucion.

GatePassage::isApproved()

public function isApproved(): bool

Verifica si el pasaje fue aprobado.

GatePassage::isRejected()

public function isRejected(): bool

Verifica si el pasaje fue rechazado.

GatePassage::toArray()

public function toArray(): array

Converts the entity to an array for API responses. NOTA: requestedBy != approvedBy (self-approval prohibition, enforced at service level). Both are opaque principal strings (D9) — see the class docblock.