Skip to content

Latest commit

 

History

History
80 lines (58 loc) · 2.81 KB

enums_documentation.md

File metadata and controls

80 lines (58 loc) · 2.81 KB

Domain enum vocabulary

Current values are source contracts. Renaming values can affect stored strings and JSON; coordinate SQL/backfill and frontend mappings before a change. SortingType is descriptive metadata; each sorting command independently allocates raw input under ADR-0012. It does not authorize repeated credits for the same raw quantities.

DestinationType

src/main/java/org/code/api/domain/enums/DestinationType.java

public enum DestinationType {
    STOCK,
    SALE,
    PRESSING
}

DonorType

src/main/java/org/code/api/domain/enums/DonorType.java

public enum DonorType {
    PF,
    PJ
}

OperationType

src/main/java/org/code/api/domain/enums/OperationType.java

public enum OperationType {
    COLLECTION_INPUT,
    DONATION_INPUT,
    SALE_OUTPUT,
    SORTING_INPUT,
    SORTING_OUTPUT,
    PRESSING_INPUT,
    PRESSING_OUTPUT,
    MANUAL_ADJUSTMENT
}

SortingType

src/main/java/org/code/api/domain/enums/SortingType.java

public enum SortingType {
    GROSS,
    PRIMARY,
    FINE
}

UserRole

src/main/java/org/code/api/domain/enums/UserRole.java

public enum UserRole {
    ADMINISTRATOR,
    CITY_HALL,
    ORGANIZATION,
    REPRESENTATIVE
}

Compatibility and lifecycle vocabulary

PF means an individual donor and PJ means a legal-entity donor. These existing stored/wire codes remain unchanged; all maintained explanations are English. DestinationType retains SALE/PRESSING for historical compatibility, but new sorting/pressing requests accept only STOCK without destinationId. Typed downstream commands create real links.

Membership roles are MEMBER and MANAGER, independent of platform UserRole. Team roles are DRIVER, HELPER and OPERATOR. Sales use DRAFT/POSTED/REVERSED; processing uses POSTED/REVERSED. Stock operations use SORTING/PRESSING/SALE/REVERSAL. These states are database-checked strings in their owning modules and are documented in Swagger and ADR-0012.

Routes vocabulary

RouteContract: RouteStatus is DRAFT or ACTIVE; isActive is a separate soft lifecycle flag. RouteExecutionContract: ExecutionStatus is PLANNED, IN_PROGRESS, COMPLETED or CANCELLED. Terminal states cannot be reopened. Shared territory uses the 27 Brazilian UF codes and matching seven-digit IBGE prefixes, not a new organization role.