diff --git a/cmd/main-migration/migrations/20251124071457.sql b/cmd/main-migration/migrations/20251124071457.sql new file mode 100644 index 00000000..0cb4c4e7 --- /dev/null +++ b/cmd/main-migration/migrations/20251124071457.sql @@ -0,0 +1,2 @@ +-- Modify "Resume" table +ALTER TABLE "public"."Resume" ADD COLUMN "Doctor_Code" character varying(10) NULL, ADD COLUMN "Status_Code" character varying(10) NOT NULL, ADD CONSTRAINT "fk_Resume_Doctor" FOREIGN KEY ("Doctor_Code") REFERENCES "public"."Doctor" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION; diff --git a/cmd/main-migration/migrations/atlas.sum b/cmd/main-migration/migrations/atlas.sum index 87b0571b..707ee3ca 100644 --- a/cmd/main-migration/migrations/atlas.sum +++ b/cmd/main-migration/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:9o177sOy5hbZmLRLBxkW8WN1dveIe0pyAXoU84eeq0Y= +h1:87NyL1nIRuVvOiLbfdC1+PF+v2R/joAnBYyh2CrlGdU= 20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k= 20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0= 20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI= @@ -127,4 +127,5 @@ h1:9o177sOy5hbZmLRLBxkW8WN1dveIe0pyAXoU84eeq0Y= 20251119072450.sql h1:Xg+bTwqGyKPNFEQhJylvpz1wifdfmDJvcAq6vmNf0Ng= 20251120005512.sql h1:Ek6qpacAI/qVuTYxKno+uJyzn7s5z9pf3t7VA8gTzm4= 20251120074415.sql h1:NNUeJVA03EeBHJhHqPXEZoDv/PnC6yK1/cRhmukyaJo= -20251121033803.sql h1:1s3DvgbqF+lh/or9X6WGN2lwnYCZkP8JH6uJFHql15g= +20251121033803.sql h1:/vfvFX/3pzSCIHnSbMUT9EMBDykOpVkvyfeTEle9Vas= +20251124071457.sql h1:HBaNJQIzUe6wK8CgBxamuKor7ZiAASzgkkXzL6kWsjY= diff --git a/internal/domain/main-entities/resume/entity.go b/internal/domain/main-entities/resume/entity.go index cf756870..70050166 100644 --- a/internal/domain/main-entities/resume/entity.go +++ b/internal/domain/main-entities/resume/entity.go @@ -1,12 +1,18 @@ package resume import ( - "simrs-vx/internal/domain/base-entities/core" + ecore "simrs-vx/internal/domain/base-entities/core" + ed "simrs-vx/internal/domain/main-entities/doctor" + + erc "simrs-vx/internal/domain/references/common" ) type Resume struct { - core.Main - Encounter_Id *uint `json:"encounter_id" gorm:"not null"` - Value *string `json:"value"` - FileUrl *string `json:"fileUrl" gorm:"size:1024"` + ecore.Main + Encounter_Id *uint `json:"encounter_id" gorm:"not null"` + Doctor_Code *string `json:"doctor_code" gorm:"size:10"` + Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"` + Value *string `json:"value"` + FileUrl *string `json:"fileUrl" gorm:"size:1024"` + Status_Code erc.DataVerifiedCode `json:"status_code" gorm:"not null;size:10"` } diff --git a/internal/domain/references/common/common.go b/internal/domain/references/common/common.go index cc466d7b..96febd75 100644 --- a/internal/domain/references/common/common.go +++ b/internal/domain/references/common/common.go @@ -72,9 +72,11 @@ const ( DACAvailable DataAvailabilityCode = "available" // Tersedia DACUnavailable DataAvailabilityCode = "unavailable" // Tidak Tersedia - DVCNew DataVerifiedCode = "new" // Baru - DVCVerified DataVerifiedCode = "verified" // Terverifikasi - DVCRejected DataVerifiedCode = "rejected" // Ditolak + DVCNew DataVerifiedCode = "new" // Baru + DVCVerified DataVerifiedCode = "verified" // Terverifikasi + DVCValidated DataVerifiedCode = "validated" // Tervalidasi + DVCCancelled DataVerifiedCode = "cancelled" // Dibatalkan + DVCRejected DataVerifiedCode = "rejected" // Ditolak USCNew UserStatusCode = "new" // Baru USCActive UserStatusCode = "active" // Aktif